Control visibility of Parts


At the moment I have the problem that I want to control the visibility of components in a assembly.
I cant find a code that returns whether the component is shown or hidden at the moment. I found codes for the Suppression of components but not for the visibility.
I tried to record a Journal but it was not helpful. I also searched in the Siemens Documentation without any success.

Can someone help me? Is it possible at all to control the visibility with a journal?

Thank in Advance

There are many factors that determine the visibility of component geometry, the main 2 being: is the component loaded and is it hidden?
In older versions of UG/NX, hiding/showing geometry was referred to as "blanking" and "unblanking". Newer versions of NX have updated this nomenclature in the GUI, but the old terms still show up in the API. If you have a reference to a component object (and let's assume it is loaded), you can access the .IsBlanked property to determine if the component is shown or hidden. You can also use the .Blank() or .Unblank() methods to hide or show the component.

Besides the load status and the hidden status, here are a few more things that may cause component geometry to be invisible:

  • reference set in use (i.e. the "empty" reference set or any other reference set that contains no objects)
  • layer visibility status of the layer the component is on
  • "layer visible in view" status
  • component geometry may be hidden independently of the component itself
  • view dependent edits can hide geometry in a drafting or model view
  • if the component is suppressed it will not show up in the graphics window
  • if the component is set to "reference only" or "non-geometric"

There are probably a few more conditions that I'm forgetting at the moment, but I think you get the idea.

oh great thanks for the quick reply!
I tried to use the methods and it works well. But for some reasons the code works only for some parts...
I have parts in my assembly that are invisible for sure. But the .IsBlanked method returns "false".
I don't know the reason for this behaviour of the parts. Maybe it has something to do with the suppression. In the assembly I suppress parts by expressions. Some times when I supress and unsuppress a part with a expression, the part is unsuppressed but the part remains invisible (I can make the part visible by using the "show" button).
I don't know if this is the reason for my problem...