Cancel
Showing results for 
Search instead for 
Did you mean: 

Mimic the functionality of the little red checkboxes next to components

Valued Contributor
Valued Contributor

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:

      dspPrt.ModelingViews.WorkView.FitAfterShowOrHide(View.ShowOrHideType.BothShowAndHide)

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. Smiley Happy

 

Thanks

 

 NX 9.0

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015
5 REPLIES

Re: Mimic the functionality of the little red checkboxes next to components

Honored Contributor
Honored Contributor

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:

  • an empty box means the component is not loaded
  • a check in the box means that the component is at least partially loaded
  • a grey check means the component is hidden or is using the "empty" reference set
  • a red check means the *component itself* is not hidden
  • there can be a red check and nothing in the graphics window if there is nothing in the used reference set (other than the "empty" ref set, which gets a grey mark) OR if the *body itself* has been explicitly hidden by the user.
  • if you right click on a component in the navigator and see the "open -> component fully" option, this component is partially loaded; if you do not see the "open" option, this component is already fully loaded.

 

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:

https://docs.plm.automation.siemens.com/tdoc/nx/10/nx_help/#uid:an_tree_ov

Re: Mimic the functionality of the little red checkboxes next to components

Valued Contributor
Valued Contributor

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.

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015

Re: Mimic the functionality of the little red checkboxes next to components

Valued Contributor
Valued Contributor

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.

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015

Re: Mimic the functionality of the little red checkboxes next to components

Honored Contributor
Honored Contributor

Can you post your relevant code section(s) that open the components?

 

Edit: nevermind, looks like you solved the problem.

Re: Mimic the functionality of the little red checkboxes next to components

Valued Contributor
Valued Contributor

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)

 

NX 9.0.3.4 MP13
VB.net
Visual Studio 2015