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

Control Layout visibility with SetPerViewportVisible

$
0
0

@flokart wrote:

Hi,
to control the layout visibility by layers i tried the following code.

import Rhino as rh

for i in range(len(x)):
    PageView = rh.RhinoDoc.ActiveDoc.Views.Find(x[i],False)
    PageViewPortID = PageView.ActiveViewportID
    LayerIndex = rh.RhinoDoc.ActiveDoc.Layers.Find(y[i],True)
    LayerObj = rh.RhinoDoc.ActiveDoc.Layers.FindIndex(LayerIndex)
    
    LayerObj.SetPerViewportVisible(PageViewPortID,True)
    
    PageView.Redraw()

and the result seems to to work because in the layer panel the visible button (lamp) for the page view is ON but nothing is visible in the page view.

if i double click on the page view to get into the detail view the visibility lamp turns OFF

What i need to change in the code above turn this button on (lamp) so that the layer gets visible in the DetailPageView ?

Thanks in advanced for any Help.

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5875

Trending Articles