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!

GetUserAttributeAsString("myTitle", NXObject.AttributeType.String, 0) what if obj hav'nt t

Status
Not open for further replies.

Ehaviv

Computer
Jul 2, 2003
1,012
Hi
How I control this statement
if the object have not this title
I tryed try catch but that not elimunate the runtime error.
I want if the object hav'nt this title to skip and do nothig
how I acheve this.

Thanks in advanced

def_res_value = body1.GetUserAttributeAsString("myTitle", NXObject.AttributeType.String, 0)
 
Replies continue below

Recommended for you

You can use the .HasUserAttribute method to test whether an attribute with a particular title exists on the given object.

www.nxjournaling.com
 
Hi Cowski and thank you.

I want to ask your opinion about speed issue.
Actually I used sn arrayinfo of object
attributes with a for each that check
if a title exist ...

but now I want to try the above statement
and also I need to use hasattribute with it.

witch one you think is optimal for speed.

Thank you again.
 
Thank you.

Yes I think I'll do some testing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor