In an assembly, next to each component is a little red checkbox. The function of this red checkbox is to simply to turn on and off components to the average user. I am wondering what is actually happening behind the scences when this checkbox is hit. (It's function is not recordable as far as I can tell)
I'm wondering how the red checkbox works because I can't seem to replicate it's function using loading / unblanking code. For example, I have a list of components. I wish to load these components and show them in the NX graphics window. I have identified three separate cases.
Case 1: Components start unloaded from a fresh NX Session
- I fully load all the components, run them through unblanking and regenerate the display. No problems, all unloaded components are now loaded and shown in the graphics window.
Case 2: Components are loaded
- I ensure all partially loaded components are fully loaded, run them through unblanking and regen, no problems.
Case 3: Components were previously loaded, but have just been closed
- Now all the closed parts are fully loaded just fine, (.IsFullyLoaded outputs true) except they are not shown in the graphics window. Even after a unblanking and a regeneration of the display. (Yes with the unblanking I use a show.fit:
The difference in this case is that the little red checkboxes are not checked next to the components. Checking these boxes and re-running the code results in a desired output. (I'm trying to access the occurence bodies from the component). If you were to click the red checkbox at this point, the component will be shown and its occurence body will be accesible.
I hope I have correctly communicated my issues. Basically there is something magical to these little red checkboxes and I would like to know what it is.
Solved! Go to Solution.
I could use some clarification on case 3.
"Case 3: Components were previously loaded, but have just been closed
- Now all the closed parts are fully loaded just fine, (.IsFullyLoaded outputs true) except they are not shown in the graphics window."
Are you saying that your code loaded the components, closed them, then re-opened them and the check marks are red, but nothing shows up in the graphics window?
Some observations on the assembly navigator check boxes from my time using NX:
A dotted checkbox means the component is suppressed. Normal components are indicated by a yellow cube icon. Drafting components are indicated by a yellow cube on a drawing sheet....
Here's a list of the icons and their meanings:
Thanks for the breakdown, the checkbox is quite a complex process.
Some clarification on case 3. The code only loads the desired components (and all their placeholder parents). Example use case:
1. Fresh NX Session
2. Code loads all desired components and all placeholder parents. Code then unblanks all components and placeholder parents. All components are loaded, with red check marks and shown in the graphics window
3. User then manually closes all components open in assembly
4. Re-run code. All components are loaded, with grey check marks and not shown in graphics window. Even running a ctrl + shift + u (unblank all) will not cause anything to be shown.
No components are on the empty reference set or surpressed. The problem is that I do not know how to force these components to open with red check marks.
I think I have found a solution to the issue that I am experiencing. Just now I have switched the loading code from using Session.Parts.Open to Part.ComponentAssembly.OpenComponents.
From my last test, this correctly opened all the components, and shown them all in the graphics window with red check marks in the assembly navigator.
Can you post your relevant code section(s) that open the components?
Edit: nevermind, looks like you solved the problem.
This code functioned as desired
Dim openStatus() As Assemblies.ComponentAssembly.OpenComponentStatus = Nothing Dim partLoadStatus As PartLoadStatus = Nothing partLoadStatus = wrkPrt.ComponentAssembly.OpenComponents(ComponentAssembly.OpenOption.ComponentOnly, cmps.ToArray, openStatus)
This code did not show the components in the nx graphics window
ufSes.Assem.AskComponentData(componentsToProcess(count).Tag, partName, refsetName, instanceName, origin, csysMatrix, transform) Dim theLoadStatus As PartLoadStatus = Nothing nxSes.Parts.Open(partName, theLoadStatus)