I am running NX under TC. I have a VERY small test assembly (maybe 500 components). I need to be able to view all children in an assembly through code when it is assumed that the structure is not yet updated and no compoennts are loaded. Basically, I am starting with a fresh load of an assembly in NX.
To my knowledge, calling this on the root component is the fastest way to get he entire assembly:
Component comps = new Component;
comps = mycomp;
mycomp.updateStructure(comps, -1, true);
But in my test environemnt, this is taking 20 seconds to accomplish. With real world models, this will explode to unacceptable amounts of time. Am I doing anything wrong? Is there a faster way to do this (ufunc possibly)?
I don't have a definitive answer however could offer some advice....
Are you sure that increasing the parts by a factor of 10 for example is actually increasing the lookup time by a factor of 10?
Have you increased your dataset to make sure?
If not you may find of your 20seconds for 500 parts, a significant chunk is latency of the connection to TC which is fixed no matter how many or few parts you are looking up.
If that isn't the case I'm guessing ITK code in TC should be significantly faster. After all at that point it's just looinkg up data from an sql database. The tricky thing then will be poking TC with nxopen to return the parts list, and that's something I don't have experience with yet.
Hope that helps...
Not sure what you are doing exactly. Two things:
1. Update structure performance was improved in NX10. If you are running in NX10 or higher, you don't have to do anything specific to see those improvements.
2. If you are doing something significant that is computationally intensive with the output from update structure, instead of doing update structure in one go, you can do the update structure level by level in the main thread and perform your own actions in the secondary thread. Secondary thread must not contain any NX Open calls. All NX Open calls should occur in the main thread.