Layer Methods

Layers are the primary organizational tool in Rhino. Layers are like transparent overlays on which you can organize and group objects.  

With version 4.0, Rhino introduced hierarchical layers - layers that can have a parent layer and one or more child layers. This has made organizing projects easier.

With version 5.0, the hierarchical layer scheme has been extended to allow the same layer name to appear in different parts of the layer tree. This is conceptually similar to having the same file name in different location in the file system.

To prevent possible layer name conflicts, all RhinoScript functions now accept and return a layer's "full path" name. For example, if you have a root layer named "First Floor" and it has a child layer named "Electrical", you would refer to this layer as "First Floor::Electrical".

The following methods are available for adding, querying or manipulating layers.

 

Method

Description

AddLayer

Adds a new layer.

CurrentLayer

Returns or changes the current layer.

DeleteLayer

Removes an empty layer.

ExpandLayer

Expands or contracts a layer.

GetLayerUserText

Returns user text that is stored on a layer.

IsLayer

Verifies a layer exists.

IsLayerChangeable

Verifies objects on a layer can be changed.

IsLayerChildOf

Verifies a layer is a child of another layer.

IsLayerCurrent

Verifies a layer is the current layer.

IsLayerEmpty

Verifies a layer contains no objects.

IsLayerExpanded

Verifies a layer is expanded.

IsLayerLocked

Verifies a layer is locked.

IsLayerOn

Verifies a layer is on.

IsLayerParentOf

Verifies a layer is a parent of another layer.

IsLayerReference

Verifies a layer is reference.

IsLayerSelectable

Verifies objects on a layer are selectable.

IsLayerVisible

Verifies objects on a layer are visible.

LayerChildCount

Returns the number of child layers of a layer.

LayerChildren

Returns the names of a layer's child layers.

LayerColor

Returns or changes a layer's color.

LayerCount

Returns the number of layers.

LayerId

Returns the identifier of a layer given the layer's name.

LayerIds

Returns the identifiers of all layers in the document.

LayerLinetype

Returns or changes a layer's linetype.

LayerLocked

Returns or changes a layer's locked property.

LayerMaterialIndex

Returns or changes a layer's material index.

LayerMode

Returns or changes a layer's mode.

LayerName

Returns the name of a layer given the layer's identifier.

LayerNames

Returns layer names.

LayerOrder

Returns a layer's display order index.

LayerPrintColor

Returns or changes a layer's print color.

LayerPrintWidth

Returns or changes a layer's print width.

LayerVisible

Returns or changes a layer's visibility property.

MatchLayer

Matches layer properties.

MergeLayer

Merges a layer with another layer.

ParentLayer

Returns a layer's parent layer.

PurgeLayer

Removes an existing layer.

RenameLayer

Renames a layer.

SelectedLayers

Returns the layers that are selected in Rhino's layer UI.

SelectLayers

Selects layers in Rhino's layer UI.

SetLayerUserText

Sets or removes user text stored on a layer.