Python SpaceClaim API: Setting object visibility from selection
Greetings,
I am trying to "check the box" for a number of parts in the structure tree. Using the recording feature of the API, I get the ViewHelper.SetObjectVisibility class/method. Trying to apply this to my existing selection yields nothing though - code below. How can I toggle the parts based on my existing selection?
select_bodies = []
for i_body in GetRootPart()GetComponents():
if i_body.GetName().Equals(""):
select_bodies.append(i_body)
# Change Object Visibility
selection = Selection.Create(select_bodies)
visibility = VisibilityType.Show
inSelectedView = False
faceLevel = False
ViewHelper.SetObjectVisibility(selection, visibility, inSelectedView, faceLevel)
# EndBlock
# Change Object Visibility
selection = Selection.Create(select_bodies)
ViewHelper.HideOthers(selection)
# EndBlock
Answers
-
Selection.GetActive() will get the active selection from the graphics window.
0