cancel
Showing results for 
Search instead for 
Did you mean: 

How to select the same volume size of the entities?

Pioneer
Pioneer

How to select the same volume size of the entities?

 

Thanks.

5 REPLIES

Re: How to select the same volume size of the entities?

Esteemed Contributor
Esteemed Contributor

Could you describe in more detail what you are trying to accomplish, currently I don't have any clue of what you are saying Smiley Wink

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: How to select the same volume size of the entities?

Pioneer
Pioneer
I want to choose the same size objects to edit and count their numbers in a complex part file, they may be in different layers or showing different colors, but they have the same volume.

Re: How to select the same volume size of the entities?

Siemens Phenom Siemens Phenom
Siemens Phenom

This code uses a SNAP function to calculate volume, but the basic approach would be the same using NX/Open functions. You just cyle through the bodies in the part, looking for ones that have the desired target volume. If you find one, you add it to a list. The code is written in C#.

 

      double targetVolume = 999;  // change to whatever you want
      double tol = 0.1;           // change to whatever you want

      var bodyList = new System.Collections.Generic.List<NXOpen.Body>();

      foreach (NXOpen.Body body in workPart.Bodies)
      {
         double thisVolume = Snap.Compute.Volume(body);
         if (System.Math.Abs(targetVolume - thisVolume) < tol) bodyList.Add(body);
      }
      var bodyArray = bodyList.ToArray();
山田
yamada

Re: How to select the same volume size of the entities?

Pioneer
Pioneer
Thank you Yamada.I am not a programmer, but an operator. Can you tell me how to use it directly in the NX to complete my work.

Re: How to select the same volume size of the entities?

Siemens Phenom Siemens Phenom
Siemens Phenom

> I am not a programmer, but an operator

 

Then you probably should post your question in the "Design" forum, I don't think there is any way to do this in interactive NX, but let's see what the gurus in the design forum say.

山田
yamada