Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Does an attribute exist 1

Status
Not open for further replies.

nmiltner

Bioengineer
Jan 30, 2008
98
0
0
US
How do I check to see if an attribute exists using NXOPEN, in NX3/5? I am trying modify a journal that was written to see if an attribute exists. If that Attribute exists, I want to modify the part, if not, I want to do nothing to it. Thanks
 
Replies continue below

Recommended for you

Sny suggestions with this?
by the way I the language is VB. Currently we are using setAttribute("attribute", value) to set attributes in a part. Is there something like askAttribute("Attribute") that can query if an Attribute exists? Thanks again
 
hi all,

I think, if i would like to get any info from NX object, I have to make a call to the .NET-wrapped User Function API (UF wrapper). Or can I Access the classes in the NX Open API, which are packaged in managed .NET DLLs? I think, any tag is got via NXOpen.UF, which are packed in UF wrapped code. This technique is named Interoperability.
Anybody have comment?

thanks,

Best Regards,
Rudolf JONAS
Mechanical Engineer
Hungary
 
hi ufsure,

Ok. I understand, this is an UF wrapped method. I must use Open C API map as enumeration;

open C enum name: UF_ATTR_ask_part_attribute
nxopen .NET class: UF_ATTR
nxopen .NET enumeration name: AskPartAttribute.
I must create an enumeration (out of the main method) which contents any attributes type name as enum member.
But I do not find the next step... my vb macro always terminated/aborted with any error.
Do you have a sample program which use wrapped method?

thanks,


Best Regards,
Rudolf JONAS
Mechanical Engineer
Hungary
 
Suresh,

many thanks for great macro.
I have one question... How do you get the value of attribute? I look for the UFAttr class, but I do not find any method for value accessing.

available methods:

AskPartAttribute(Tag)
Delete(Tag, Int32, String)
DeleteAll(Tag, Int32)
FindAttribute(Tag, Int32, String, Int32)

thanks,



Best Regards,
Rudolf JONAS
Mechanical Engineer
Hungary
 
Status
Not open for further replies.
Back
Top