Hi @antoine3,
Rhino.Python’s rhinoscriptsyntax library is just a library of Python functions that are designed to emulate legacy RhinoScript. So it makes sense that rhinoscriptsyntax
does not contain what you are looking for (either).
Note, rhinoscriptsyntax
just makes calls into RhinoCommon. You can vifew the source code to rhinoscriptsyntax
here.
To set the per-viewport layer properties, you’ll need to go to RhinoCommon directly. Here are a few methods that will be useful to you.
Layer.PerViewportPlotColor
Layer.SetPerViewportPlotColor
Layer.PerViewportPlotWeight
Layer.SetPerViewportPlotWeight
Here is a simple example:
import Rhino
import scriptcontext as sc
import System
def test_per_viewport_layer_settings():
layer = sc.doc.Layers.CurrentLayer
if not layer:
return
color = System.Drawing.Color.Chartreuse
weight = 0.25
layer.PlotColor = color
layer.PlotWeight = weight
view = sc.doc.Views.ActiveView
if isinstance(view, Rhino.Display.RhinoPageView):
details_views = view.GetDetailViews()
for detail in details_views:
layer.SetPerViewportPlotColor(detail.Viewport.Id, color)
layer.SetPerViewportPlotWeight(detail.Viewport.Id, weight)
sc.doc.Views.Redraw()
if __name__ == "__main__":
test_per_viewport_layer_settings()
Hope this helps.
– Dale