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
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
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
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
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.
I have updated the vb file to show the method. Depending on the type of attribute you find using FindAttribute.. use GetStringAttribute, GetIntegerAttribute, etc. Look at the code you will understand.