Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Python : hide layers in detail and zoom to remaining objects

$
0
0

Hallo, I´m trying to write a function in python that hides all layers in a detail but some and zoom the detail to extend in the remaining objects. Since I do not find any method in rhinoscriptsyntax and am not really fond of rhinocommand, I am trying using rs.Command(), unsuccesfully. What am I doing wrong?

def detailLayersVisibile(detail_id,layers):
# select detail
rs.UnselectAllObjects()
rs.SelectObject(detail_id)
rs.Command('-Detail Enable ', echo=False)
rs.UnselectAllObjects()

#all layers in doc
L_all = rs.LayerNames()

#cycle through layers
for layer in L_all:
    if not(layer in layers):
        commandHide = "_HideLayersInDetail Layers "+layer
        rs.Command(commandHide)

return rs.ZoomExtents()

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles