Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Jan 30, 2008
Messages
98
Location
US
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
 
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

Back
Top