Layer

class rhino3dm.Layer
Layer()

Layer constructor

PathSeparator
Name

str: Gets or sets the name of this layer.

FullPath

str: Gets the full path to this layer. The full path includes nesting information.

Id

Guid: Gets or sets the ID of this layer object. You typically do not need to assign a custom ID.

Index
ParentLayerId

Guid: Gets the ID of the parent layer. Layers can be organized in a hierarchical structure, in which case this returns the parent layer ID. If the layer has no parent, Guid.Empty will be returned.

IgesLevel

int: Gets or sets the IGES level for this layer.

Color

System.Drawing.Color: Gets or sets the display color for this layer.

PlotColor

System.Drawing.Color: Gets or sets the plot color for this layer.

PlotWeight

float: Gets or sets the weight of the plotting pen in millimeters. A weight of 0.0 indicates the “default” pen weight should be used. A weight of -1.0 indicates the layer should not be printed.

LinetypeIndex

int: Gets or sets the line-type index for this layer.

RenderMaterialIndex

int: Gets or sets the index of render material for objects on this layer that have MaterialSource() == MaterialFromLayer. A material index of -1 indicates no material has been assigned and the material created by the default Material constructor should be used.

Visible
Locked
Expanded
HasPerViewportSettings(viewportId)

Verifies that a layer has per viewport settings.

Parameters:

viewportId (Guid) – If not Guid.Empty, then checks for settings for that specific viewport. If Guid.Empty, then checks for any viewport settings.

Returns:

True if the layer has per viewport settings, False otherwise.

Return type:

bool

DeletePerViewportSettings(viewportId)

Deletes per viewport layer settings.

Parameters:

viewportId (Guid) – If not Guid.Empty, then the settings for that viewport are deleted. If Guid.Empty, then all per viewport settings are deleted.

Return type:

void

PerViewportColor(viewportId)

Gets the display color for this layer.

Parameters:

viewportId (Guid) – If not Guid.Empty, then the setting applies only to the viewport with the specified id.

Returns:

The display color.

Return type:

System.Drawing.Color

SetPerViewportColor(viewportId, color)

Sets the display color for this layer.

Parameters:
  • viewportId (Guid) – If not Guid.Empty, then the setting applies only to the viewport with the specified id.

  • color (System.Drawing.Color) – The display color.

Return type:

void

DeletePerViewportColor(viewportId)

Remove any per viewport layer color setting so the layer’s overall setting will be used for all viewports.

Parameters:

viewportId (Guid) – If not Guid.Empty, then the setting for this viewport will be deleted. If Guid.Empty, the all per viewport layer color settings will be removed.

Return type:

void

GetPersistentVisibility()

The global persistent visibility setting is used for layers whose visibility can be changed by a “parent” object. A common case is when a layer is a child layer (ParentId is not nil). In this case, when a parent layer is turned off, then child layers are also turned off. The persistent visibility setting determines what happens when the parent is turned on again.

Return type:

bool

SetPersistentVisibility(persistentVisibility)

Set the global persistent visibility setting for this layer.

Return type:

void

UnsetPersistentVisibility()

Remove any explicit persistent visibility setting from this layer

Return type:

void

GetPersistentLocking()

The persistent locking setting is used for layers that can be locked by a “parent” object. A common case is when a layer is a child layer (Layer.ParentI is not nil). In this case, when a parent layer is locked, then child layers are also locked. The persistent locking setting determines what happens when the parent is unlocked again.

Return type:

bool

SetPersistentLocking(persistentLocking)

Set the persistent locking setting for this layer

Return type:

void

UnsetPersistentLocking()

Remove any explicitly persistent locking settings from this layer

Return type:

void