Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

desperate attribute help needed

Status
Not open for further replies.

nmiltner

Bioengineer
Jan 30, 2008
98
I am trying to vrite a VB/NXopen script to see if an attribute exitsts
in a part. If that attribute exists, I want to add other attributes
to the part, if it doesn't I want to do nothing to it.

is there a command like isStringattribute("string")?

I am using NX3 and NX5
 
Replies continue below

Recommended for you

I'll take a stab at it, but bear in mind that I am stuck on NX2 right now so my suggestion is untested.

Failing to find anything specific in the help files, my first inclination would be to try to assign the value of the attribute in question to a variable. If you try to access an attribute that doesn't exist I would expect some sort of error to be thrown. You should be able to catch it with an 'on error' or 'try' 'catch' clause. If there is no error, continue adding new attributes; if an error is thrown, exit the sub/function.
 
Thanks Cowski. I'll try that. I'm not exactly a programmer, but I'll try to wing it. I'll post back with results
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor