cancel
Showing results for 
Search instead for 
Did you mean: 

AskBoundingBoxAligned takes forever to finish

Hi all,

 

I wonder if anyone can help me test the following C# file on the following prt file and tell me the results?

 

Just run the file as journal or compile it as dll.

 

The code does a simple job as to find the bounding box aligned with WCS for the part. There are about 2000 faces for the program to process. In my computer, it takes 30s or more to finish running. 

 

Is this the case for you guys too?

 

I would say my computer is a nice one with i7 CPU, 16G ram and NX is running on the ssd. I have another prt file with 10000 bodies and as large as 300 Mb. For that prt file, this program takes about 0.5 second to processing each face. Therefore, if I select 500 faces in that prt file and want to know their extremes in XYZ direction (WCS), I'll have to wait about 4 mins for the program to finish.

 

I am running NX 9.0.3.

 

Thanks in advance,

 

Steph

 

4 REPLIES

Re: AskBoundingBoxAligned takes forever to finish

Esteemed Contributor
Esteemed Contributor

On my HP Zbook 17 with the specifications shown below the entire process needs only 0.25 seconds to calculate the box with NX 10.0.3 and NX 11.0.1

For those not running an English localized system add the lines to specify the English localization, else you get problems with the numerical strings containing commas instead of periods.

Session theSession = Session.GetSession();
UI theUI = UI.GetUI();
UFSession theUfSession = UFSession.GetUFSession();

System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");

SystemInfo.PNG

 

 

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: AskBoundingBoxAligned takes forever to finish

Thank you Stefan.

 

I actually asked a few people to test the code too. For those running NX 9.0 or lower, the function will take up to 50s to finish. And for those running NX 10.0 or higher, the code will finish at less than 1 second.

 

As a matter of fact, the objective that I wrote the code is to find the extreme XYZ in a given coordinate system for the selected objects. Then I can create a grid on XY/ZY/ZX plane that covers the area of the selected objects, as the followings show,

1.JPG2.JPG

 

 

Is there a workaround for this program? Maybe, Let's say, can I rotate the view to a given coordinate system and then ask the extreme screen distance of the selected objects and then use this screen distance to create a grid?

 

 

Re: AskBoundingBoxAligned takes forever to finish

Esteemed Contributor
Esteemed Contributor

Have you tried AskBoundingBoxExact, which also allows specifying the CSYS to be used?

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: AskBoundingBoxAligned takes forever to finish

I just tried  AskBoundingBoxExact the results is even worst in my NX 9.0

 

But if I use NXOpen.Tooling CreateBoxBuilder, the box can be generated in less than 1 second.