×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Does an attribute exist

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

(OP)
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

RE: Does an attribute exist

hi all,

good quest. i also interest this answer...


thx,

Best Regards,
Rudolf JONAS
Mechanical Engineer
Hungary

RE: Does an attribute exist

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

RE: Does an attribute exist

Public Sub AskPartAttribute ( _
    <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

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

RE: Does an attribute exist

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources