Visibility in Group/Component editing
-
I have two tools that are using model.raytest(ray) and have bumped into a problem with DrawingElement visibility in Group/Component editing mode.
All DrawingElement methods dealing with visibility - visible? and hidden? they refer to a state of the element in a model, but are completely unaware of a visibility of the element on a screen (OpenGL 3D space to be "precise").
Group/Component editing options allow to Hide elements from a view, but how can we check it from Ruby?! Is there a way to figure out whether such an entity is really "visible on a screen".
-
I have found Model.active_path from SU 7.0+. It looks I will have to compare an oldest entity in a family I get from the raytest with oldest entity from the active_path...
Are there users still using SU6?
-
The only one I could think of is Pilou
-
@tomasz said:
I have two tools that are using model.raytest(ray) and have bumped into a problem with DrawingElement visibility in Group/Component editing mode.
All DrawingElement methods dealing with visibility - visible? and hidden? they refer to a state of the element in a model, but are completely unaware of a visibility of the element on a screen (OpenGL 3D space to be "precise").
Group/Component editing options allow to Hide elements from a view, but how can we check it from Ruby?! Is there a way to figure out whether such an entity is really "visible on a screen".
Use the second item in the returned array, with is the instance path array. Traverse through this and check if any of these entities are hidden on on a hidden layer. Works in all versions of SU.
-
@thomthom said:
Use the second item in the returned array, with is the instance path array. Traverse through this and check if any of these entities are hidden on on a hidden layer. Works in all versions of SU.
Thomas, it is not what I have been looking for. I know that this works, but I doesn't give you an info on whether an object is hidden by 'Group/Component editing' option from the 'Window/Model Info/Components'.
The Model.active_path solution works very well. I have to obviously traverse whole active_path and compare each element with the second element of rayrest return.
-
@jolran said:
The only one I could think of is Pilou
-
Ah, ok now I understand. Yes, then Model.active_path is what you need. And checking if Hide Rest of Model or Hide Similar Components is enabled.
Advertisement