Displays a dialog box prompting the user to select a layer.
rhinoscriptsyntax.GetLayer (title="Select Layer", layer=None, show_new_button=False, show_set_current=False)
rhinoscript.userinterface.GetLayer (title="Select Layer", layer=None, show_new_button=False, show_set_current=False)
title |
Optional. String. A dialog box title. |
layer |
Optional. String. The name of a layer to pre-select. If omitted, the current layer will be pre-selected. |
show_new_button |
Optional. Boolean. Display the "New" layer button. If omitted, the button is not displayed. |
show_set_current |
Optional. Boolean. Display the "Set layer current" check box. If omitted, the check box is not displayed. |
String |
The name of the selected layer if successful. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select object")
if obj:
layer = rs.GetLayer("Select Layer", rs.ObjectLayer(obj), True, True)
if layer: rs.ObjectLayer( obj, layer )