×
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

Attributes - Component/Instance

Attributes - Component/Instance

Attributes - Component/Instance

(OP)
Hi guys,
This is a follow up question to this thread: thread561-384240: How to identify parts that are having different properties applied in different Contexts?

Does anybody know if it is possible to automatically delete an attribute on the component and not the instance using NXOpen? I can remove and change the instance attributes no problem, but the presence of a component attribute of the same name overrides what we can see in NX.

This is what I've got so far:

Component[] children = theSession.Parts.Work.ComponentAssembly.RootComponent.GetChildren();
foreach (Component child in children)
{
     child.SetInstanceUserAttribute("CALLOUT", 0, "Instance Callout here...", Update.Option.Now);
}
 
I've tried the following but this doesn't delete the component attribute, only the instance:

child.DeleteInstanceUserAttribute(NXObject.AttributeType.String, "CALLOUT", false, Update.Option.Now); 

Any information will be gratefully received.

RE: Attributes - Component/Instance

If you want to delete the component attribute, you would use:

CODE

child.DeleteUserAttribute(...) 

When adding a component to an assembly, any existing part attributes are applied to the component and the instance. Once the component has been added, the values of these attributes can be overridden at the component and/or the instance level.

The hierarchy is: Part -> Instance -> Component

www.nxjournaling.com

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