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:
Any information will be gratefully received.
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
CODE
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