Showing results for 
Search instead for 
Do you mean 
Reply

NX10 C# Add Proximity to ComponentGroup Question

Hi!

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);
                theSession.Parts.Work.ComponentAssembly.Subsets.CreateProximitySearchTermBuilder(pst);

 

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.

1 REPLY

Re: NX10 C# Add Proximity to ComponentGroup Question

Have you searched the Solutions database?

    https://solutions.industrysoftware.automation.siemens.com/

(maybe search on "ComponentGroups")

 

Also search the examples included with NX install:
%UGII_BASE_DIR%\UGOPEN\SampleNXOpenApplications

 

Hope you find something...

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