# Layer class

Namespace: [Rhino.DocObjects](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.docobjects.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
[Serializable]
public sealed class Layer : ModelComponent, IEquatable<Layer>
```

## Constructors

- [Layer](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/ctor.md)

## Properties

- [Color](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/color.md): Gets or sets the display color for this layer.
- [ComponentStatus](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/componentstatus.md): Gets or sets the status of the layer.
- [ComponentType](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/componenttype.md): Returns [ModelComponentType.Layer](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponenttype.md).
- [Description](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/description.md): Gets and sets a short description of the layer.
- [FullPath](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/fullpath.md): Gets the full path to this layer. The full path includes nesting information.
- [Id](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/id.md): Gets or sets the ID of this layer object. You typically do not need to assign a custom ID.
- [IgesLevel](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/igeslevel.md): Gets or sets the IGES level for this layer.
- [IsCurrent](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/iscurrent.md): Returns true if the layer is the current layer.
- [IsDeleted](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/isdeleted.md): Gets a value indicating whether this layer has been deleted and is currently in the Undo buffer.
- [IsExpanded](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/isexpanded.md): Gets or sets a value indicating whether this layer is expanded in the Rhino Layer dialog.
- [IsLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/islocked.md): Gets or sets a value indicating the locked state of this layer.
- [IsReference](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/isreference.md): Gets a value indicting whether this layer is a referenced layer. Referenced layers are part of referenced documents.
- [IsReferenceParentLayer](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/isreferenceparentlayer.md): Returns true if the layer is a parent layer of the layer tree from a linked instance definition or the layer tree from a worksession reference model.
- [IsVisible](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/isvisible.md): Gets or sets the global visibility of this layer.
- [IsVisibleInUserInterface](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/isvisibleinuserinterface.md): Return true if the layer is visible in user interfaces that display layers. Returns false if the layer not visible in user interfaces. This is a runtime property that does not persist in .3dm files. This property is also used by the Layers panel to filter layers.
- [LayerIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/layerindex.md): (obsolete) Gets or sets the index of this layer.
- [LinetypeIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/linetypeindex.md): Gets or sets the line-type index for this layer.
- [ModelIsVisible](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/modelisvisible.md): Gets or sets the model visiblity of this layer.
- [ModelPersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/modelpersistentvisibility.md): Gets or sets the model persistent visibility of this layer. The persistent viability setting is used for layers whose visibility can be changed by a parent layer. 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.
- [Name](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/name.md): Gets or sets the name of this layer.
- [ParentLayerId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/parentlayerid.md): 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.
- [PathSeparator](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/pathseparator.md): (static, obsolete) The string "::" (colon,colon) is used to separate parent and child layer names.
- [PersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/persistentvisibility.md): Gets or sets the global persistent visibility setting for this layer.
- [PerViewportIsVisibleInNewDetails](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/perviewportisvisibleinnewdetails.md): Gets and sets the initial per viewport visibility of this layer in newly created detail views.
- [PlotColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/plotcolor.md): Gets or sets the plot color for this layer.
- [PlotWeight](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/plotweight.md): 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.
- [RenderMaterial](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/rendermaterial.md): Gets or sets the [RenderMaterial](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.rendermaterial.md) for objects on this layer that have MaterialSource() == MaterialFromLayer. A null result indicates that no [RenderMaterial](https://developer.rhino3d.com/api/rhinocommon/type/rhino.render.rendermaterial.md) has been assigned and the material created by the default Material constructor or the [Layer.RenderMaterialIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/rendermaterialindex.md) should be used.
- [RenderMaterialIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/rendermaterialindex.md): 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.
- [SectionStyleIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/sectionstyleindex.md): Gets or sets the section style index for this layer.
- [SortIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/sortindex.md): Runtime index used to sort layers in layer dialog.
- [UserStringCount](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/userstringcount.md): Gets the amount of user strings.

## Methods

- [CommitChanges](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/commitchanges.md): (obsolete)
- [CopyAttributesFrom](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/copyattributesfrom.md): Copy typical attributes from another layer
- [Default](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/default.md): Sets layer to default settings.
- [DeleteAllUserStrings](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deletealluserstrings.md)
- [DeleteModelVisible](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deletemodelvisible.md): Remove any model visibility setting so the layer's global setting will be used for all viewports.
- [DeletePerViewportColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deleteperviewportcolor.md): Remove any per viewport layer color setting so the layer's overall setting will be used for all viewports.
- [DeletePerViewportPlotColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deleteperviewportplotcolor.md): Remove any per viewport layer plot color setting so the layer's overall setting will be used for all viewports.
- [DeletePerViewportPlotWeight](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deleteperviewportplotweight.md): Remove any per viewport layer plot weight setting so the layer's overall setting will be used for all viewports.
- [DeletePerViewportSettings](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deleteperviewportsettings.md): Deletes per viewport layer settings.
- [DeletePerViewportVisible](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deleteperviewportvisible.md): Remove any per viewport visibility setting so the layer's overall setting will be used for all viewports.
- [DeletePlotColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deleteplotcolor.md): Removes the plot color for layer. The layer's color will be used for the plot color.
- [DeleteUserString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/deleteuserstring.md)
- [Equals](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/equals.md): (2 overloads)
- [GetChildren](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getchildren.md): (2 overloads) Gets immediate children of this layer. Note that child layers may have their own children.
- [GetCustomSectionStyle](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getcustomsectionstyle.md): Get an optional custom section style associated with these attributes.
- [GetDefaultLayerProperties](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getdefaultlayerproperties.md): (static) Constructs a layer with the current default properties. The default layer properties are: color = Rhino.ApplicationSettings.AppearanceSettings.DefaultLayerColor line style = Rhino.ApplicationSettings.AppearanceSettings.DefaultLayerLineStyle material index = -1 IGES level = -1 mode = NormalLayer name = empty layer index = 0 (ignored by AddLayer)
- [GetHashCode](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/gethashcode.md)
- [GetLeafName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getleafname.md): (2 overloads, static) Get a layer name's "leaf" level name
- [GetParentName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getparentname.md): (2 overloads, static) Get a layer's "parent" path name
- [GetPersistentLocking](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getpersistentlocking.md): 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.
- [GetPersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getpersistentvisibility.md): 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.
- [GetUserString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getuserstring.md): Gets user string from this geometry.
- [GetUserStrings](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/getuserstrings.md): Gets a copy of all (user key string, user value string) pairs attached to this geometry.
- [HasPerViewportSettings](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/hasperviewportsettings.md): Verifies that a layer has per viewport settings.
- [HasSelectedObjects](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/hasselectedobjects.md): Returns true if the layer has one or more selected Rhino objects.
- [IsChildOf](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/ischildof.md): (3 overloads)
- [IsParentOf](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/isparentof.md): (3 overloads)
- [IsValidName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/isvalidname.md): (static, obsolete) Determines if a given string is valid for a layer name.
- [ParentLayer](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/parentlayer.md): Returns parent of a layer.
- [PerViewportColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/perviewportcolor.md): Gets the display color for this layer.
- [PerViewportIsVisible](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/perviewportisvisible.md): Gets the per viewport visibility of this layer.
- [PerViewportPersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/perviewportpersistentvisibility.md): Gets the per layer persistent visibility. The persistent viability setting is used for layers whose visibility can be changed by a parent layer. 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.
- [PerViewportPlotColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/perviewportplotcolor.md): Gets the plot color for this layer.
- [PerViewportPlotWeight](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/perviewportplotweight.md): Gets the plot weight, in millimeters, for this layer.
- [RemoveCustomSectionStyle](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/removecustomsectionstyle.md)
- [SetCustomSectionStyle](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setcustomsectionstyle.md)
- [SetPersistentLocking](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setpersistentlocking.md): Set the persistent locking setting for this layer
- [SetPersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setpersistentvisibility.md): Set the global persistent visibility setting for this layer.
- [SetPerViewportColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setperviewportcolor.md): Sets the display color for this layer.
- [SetPerViewportPersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setperviewportpersistentvisibility.md): Sets the per layer persistent visibility. The persistent viability setting is used for layers whose visibility can be changed by a parent layer. 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.
- [SetPerViewportPlotColor](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setperviewportplotcolor.md): Sets the plot color for this layer.
- [SetPerViewportPlotWeight](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setperviewportplotweight.md): Sets the plot weight, in millimeters, for this layer.
- [SetPerViewportVisible](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setperviewportvisible.md): Controls layer visibility in specific viewports.
- [SetUserString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/setuserstring.md): Attach a user string (key,value combination) to this geometry.
- [ToString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/tostring.md)
- [UnsetModelPersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/unsetmodelpersistentvisibility.md): Remove any model persistent visibility setting from this layer.
- [UnsetPersistentLocking](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/unsetpersistentlocking.md): Remove any explicitly persistent locking settings from this layer
- [UnsetPersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/unsetpersistentvisibility.md): Remove any explicit persistent visibility setting from this layer
- [UnsetPerViewportPersistentVisibility](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/unsetperviewportpersistentvisibility.md): Remove any per viewport persistent visibility setting so the layer's overall setting will be used for all viewports.

## Operators

- [operator ==](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/op-equality.md): (static)
- [operator !=](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.layer/op-inequality.md): (static)

## Inherited Members

- From [ModelComponent](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent.md): [DeletedName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/deletedname.md), [HasId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/hasid.md), [HasIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/hasindex.md), [HasName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/hasname.md), [IdIsLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/idislocked.md), [Index](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/index.md), [IndexIsLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/indexislocked.md), [InstanceDefinitionModelSerialNumber](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/instancedefinitionmodelserialnumber.md), [IsComponentStatusLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/iscomponentstatuslocked.md), [IsSystemComponent](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/issystemcomponent.md), [ModelSerialNumber](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/modelserialnumber.md), [NameIsLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/nameislocked.md), [ReferenceModelSerialNumber](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/referencemodelserialnumber.md), [ClearId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/clearid.md), [ClearIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/clearindex.md), [ClearName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/clearname.md), [DataCRC](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/datacrc.md), [LockId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/lockid.md), [LockIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/lockindex.md), [LockName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/lockname.md)
- From [CommonObject](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject.md): [Disposed](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/disposed.md), [HasUserData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/hasuserdata.md), [IsDocumentControlled](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/isdocumentcontrolled.md), [IsValid](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/isvalid.md), [UserData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/userdata.md), [UserDictionary](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/userdictionary.md), [ConstructConstObject](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/constructconstobject.md), [Dispose](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/dispose.md), [EnsurePrivateCopy](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/ensureprivatecopy.md), [GetObjectData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/getobjectdata.md), [IsValidWithLog](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/isvalidwithlog.md), [NonConstOperation](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/nonconstoperation.md), [OnSwitchToNonConst](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/onswitchtononconst.md), [ToJSON](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/tojson.md)
