Returns or modifies the layer of an object.
rhinoscriptsyntax.ObjectLayer ( object_id, layer=None )
rhinoscript.object.ObjectLayer ( object_id, layer=None )
object_id |
Required. String, Guid, or list/tuple of Strings or Guids. The identifier(s) of the object(s). |
layer |
Optional. String. The name of an existing layer. If omitted, the current object layer is returned. If object_ids is a list or tuple representing more than one object, this parameter is required |
String |
If a layer is not specified, the object's current layer if successful. |
String |
If a layer is specified, the object's previous layer if successful. |
Number |
If object_id represents multiple objects, the number of objects modified. |
import rhinoscriptsyntax as rs
id = rs.GetObject("Select object")
if id: rs.ObjectLayer(id, "Default")