Showing results for 
Search instead for 
Did you mean: 

NX10 C# Add Proximity to ComponentGroup Question



I want to automatically generate ComponentGroup with proximity.
CommandCommandContextMenu in Assembly NavigatorContextMenu in Assembly Navigator

First i have tried to create a normal ComponentGroup with: (C#)

NXOpen.Assemblies.ComponentGroup cg = theSession.Parts.Work.ComponentGroups.CreateComponentGroup("TestName");

That is working really fine for me, but i can´t find any information for this Proximity option except of the Class Library.

 SearchResultElement[] sre =  new SearchResultElement[100];
                SubsetBuilder sb = theSession.Parts.Work.ComponentAssembly.Subsets.CreateSubsetBuilder(new Subset());
                ProximitySearchTerm pst = sb.Recipe.CreateProximitySearchTerm(SearchTerm.SearchTermLogicType.Include, sre, add.ProximityValue, true);


That is all what i have found out, but i have no idea if I am right or if that is completely the wrong direction.

I also thought i could execute the command itself but i also found no information about that.

Can anyone hook me up with some example code or some documentation about this topic?

 I also tried out do it via Journaling but the Assembly Navigator is not supported, no recording there and the command is only displayed via comment.


Re: NX10 C# Add Proximity to ComponentGroup Question

Esteemed Contributor
Esteemed Contributor

Have you searched the Solutions database?

(maybe search on "ComponentGroups")


Also search the examples included with NX install:


Hope you find something...

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled