Displays a list of items in a checkable-style list box dialog.
rhinoscriptsyntax.CheckListBox( items, message=None, title=None)
items |
Required. List or tuple. A list of tuples containing a string and a boolean check state |
message |
Optional. String. A prompt or message. |
title |
Optional. String. A dialog box title. |
List |
A list of tuples containing the input string in items along with their new boolean check value. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
layers = rs.LayerNames()
if layers:
items = [(layer, rs.IsLayerOn(layer)) for layer in layers]
results = rs.CheckListBox(items, "Turn layers on/off", "Layers")
if results:
for layer, state in results: rs.LayerVisible(layer, state)