Does an attribute exist
Does an attribute exist
(OP)
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





RE: Does an attribute exist
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
RE: Does an attribute exist
good quest. i also interest this answer...
thx,
Best Regards,
Rudolf JONAS
Mechanical Engineer
Hungary
RE: Does an attribute exist
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
RE: Does an attribute exist
<OutAttribute> ByRef attribute As Tag _
)
If the output tag is null attribute does not exist. Search documentation for "UF_ATTR_ask_part_attribute" for more details.
Suresh
www.technisites.com.au
RE: Does an attribute exist
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
RE: Does an attribute exist
I have attached an example program that queries if an attribute exists.
Regards,
Suresh
www.technisites.com.au
RE: Does an attribute exist
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
RE: Does an attribute exist
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.
Regards,
Suresh
www.technisites.com.au