Showing results for 
Search instead for 
Did you mean: 

Replace Reference Set


Here my code

foreach (String str in identifiers)
Component comp = (Component)theSession.Parts.Work.ComponentAssembly.RootComponent.FindObject(str);
theSession.Parts.Work.ComponentAssembly.ReplaceReferenceSet(comp, "BODY");



How come when i implment this it leaves all the components that are in the list of "identifiers" untouched.

It finds them, It just doesn't change the reference set of any of the selected components to "BODY". Is there something else I should be Calling?


Re: Replace Reference Set


Do these components have a "BODY" reference set?

The default reference set for solids that NX creates is named "MODEL".

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | KF
Production: [NX8.5.3.3 MP11 64bit] Testing: [NX12.0.0.27 MP1]

Re: Replace Reference Set

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Were you able to get this to work?


Are the components of interest top level components in the workPart? If not, try {component var}.DirectOwner.ReplaceReferenceSet(...)