Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Attributes - Component/Instance

Status
Not open for further replies.

poc275

Aerospace
Feb 12, 2016
1
Hi guys,
This is a follow up question to this thread: thread561-384240

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:

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

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

Any information will be gratefully received.
 
Replies continue below

Recommended for you

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor