That reference is helpful for changing the visibility of layers in a viewport. But it does not affect collapsing and expanding layers in the Layers tab that I pictured above. I need a way for the C++ script to be able to do what I manually do in the Layers tab when I click on the Down Arrow in front of a parent layer name.
This shows the needed command in Rhinocommon syntax:
def ExpandLayer( layer, expand ):
"""Expands a layer. Expanded layers can be viewed in Rhino's layer dialog
layer (str): name of the layer to expand
expand (bool): True to expand, False to collapse
bool: True or False indicating success or failure
import rhinoscriptsyntax as rs
rs.ExpandLayer( "Default", False )
layer = __getlayer(layer, True)
if layer.IsExpanded==expand: return False
layer.IsExpanded = expand
Perhaps you know a way to execute a Rhinocommon command from C++?
@dale, any suggestions?