Cancel
Showing results for 
Search instead for 
Did you mean: 

Get Tool information

Valued Contributor
Valued Contributor

I used NX 10 in my work and write a module .dll on Open C++.

I tried to retrieve information about added mill tool in cam setup.

Write a simple code:

NXOpen::Part * workPart(theSession->Parts()->Work());
NXOpen::CAM::Tool * tool1(dynamic_cast<NXOpen::CAM::Tool *>(workPart->CAMSetup()->CAMGroupCollection()->FindObject(obj_name)));
unsigned int start_time = clock();
NXOpen::CAM::ToolBuilder * toolBuilder1(workPart->CAMSetup->CAMGroupCollection()->CreateMillToolBuilder(tool1));
unsigned int end_time = clock();
unsigned int run_time = end_time - start_time;

Then time to execute this code about 300-400 msec per one tool, it is so long relative to other function.

4 REPLIES

Re: Get Tool information

Esteemed Contributor
Esteemed Contributor

It *could* be the time it takes to create the preview.

If I understand correctly, when you create/edit a tool, NX creates a "temporary" part in the background, models up the tool, and displays that model.

All of which takes a fair amount of time.

 

There is a customer default (Manufacturing -> Tools -> "Display" tab -> "preview" block) you could try turning off.

I don't see a preference for this (although I may have missed it).

 

 

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


Re: Get Tool information

Valued Contributor
Valued Contributor
I turn off a preview tool and dynamic tool axis and try execute code.
Code execution time was reduced by adout 50 msec..

Re: Get Tool information

How are you running this? If it is without the UI, the preview and dynamic tool axis should not have any effect. 

When I open a tool dialog, 300 msec seems reasonable. What time are you expecting, and why? Creating a builder is similar to a dialog - it takes a little time, depending on tracking points, library reference, and other factors.

What are trying to do, just extract tool parameters? 

Mark Rief
Retired Siemens

Re: Get Tool information

Valued Contributor
Valued Contributor
I get a matref tool to library, and parameters: diam, lenght and etc.
Turn off a dynamic tool axis doesn't effective.
I solve my problem, change value of variable UGII_CAM_LIBRARY_TOOL_ASCII_LOAD_LIMIT over than size of file tool_database.dat.