Skip to content

LayerTable

Public Class

Inheritance Hierarchy

System.Object
Rhino.FileIO.CommonComponentTable. Layer.
Rhino.DocObjects.Tables.RhinoDocCommonTable. Layer.
Rhino.DocObjects.Tables.LayerTable

Namespace: Rhino.DocObjects.Tables

Assembly: RhinoCommon (in RhinoCommon.dll)

Syntax

public sealed class LayerTable : RhinoDocCommonTable<Layer>,
ICollection<Layer>, IEnumerable<Layer>, IEnumerable

The LayerTable type exposes the following members.

Properties

Name

Description


Public Property

Returns number of layers in the layer table, excluding deleted layers.


Public Property

(Overrides

.)


Public Property

Returns number of layers in the layer table, including deleted layers.

(Overrides

.)


Public Property
Code Example

At all times, there is a “current” layer. Unless otherwise specified, new objects are assigned to the current layer. The current layer is never locked, hidden, or deleted. Returns reference to the current layer. Note that this reference may become invalid after a call to AddLayer().


Public Property
Code Example

At all times, there is a “current” layer. Unless otherwise specified, new objects are assigned to the current layer. The current layer is never locked, hidden, or deleted. Returns: Zero based layer table index of the current layer.


Public Property

Document that owns this table.


Public Property

Conceptually, the layer table is an array of layers. The operator[] can be used to get individual layers. A layer is either active or deleted and this state is reported by Layer.IsDeleted.


Methods

Name

Description


Public Method

Adds a new layer with default definition to the layer table.


Public Method
Code Example

Adds a new layer with specified definition to the layer table.


Public Method
Code Example

Adds a new layer with specified definition to the layer table.


Public Method

Adds all of the layer in the specified layer path, beginning with the root. Layer paths contain one or more valid layers names, with each name separated by

. For example, “Grandfather::Father::Son”.


Public Method

Adds all of the layer in the specified layer path, beginning with the root. Layer paths contain one or more valid layers names, with each name separated by

. For example, “Grandfather::Father::Son”.


Public Method

Adds a new reference layer with default definition to the layer table. Reference layers are not saved in files.


Public Method

Adds a new reference layer with specified definition to the layer table Reference layers are not saved in files.


Public Method

Marks all items as deleted.

(Inherited from CommonComponentTable.T..)


Public Method

Basic tool used by the add layer methods.


Public Method

Deletes layer.

(Overrides

.)


Public Method

Deletes layer.


Public Method

Deletes layers.


Public Method

Deletes layer.


Public Method

Deletes layer.


Public Method

Duplicates, or copies, one or more layers. Duplicated layers are added to the document.


Public Method

Duplicates, or copies, a layer. Duplicated layers are added to the document.


Public Method

Equals

Determines whether the specified object is equal to the current object.

(Inherited from Object.)


Public Method

Searches for a layer using the fully qualified name, that includes ancestors.

Deleted layers have no name.


Public Method

Uses the guid to find a model component. Deleted objects cannot be found by id. The guid is the value that is stored in the .Id property. In a single document, no two active objects have the same guid. If an object is replaced with a new object, then the guid persists. For example, if the _Move command moves an object, then the moved object inherits its guid from the starting object. If the Copy command copies an object, then the copy gets a new guid. This guid persists through file saving/opening operations. This function will not find grip objects.

(Inherited from CommonComponentTable.T..)


Public Method

Retrieves a Layer object based on Index. This search type of search is discouraged. We are moving towards using only IDs for all tables.


Public Method
Code Example

Finds the layer with a given name. If multiple layers exist that have the same name, the first match layer index will be returned.

Deleted layers have no name.

The default layer is NOT included in the search. If required, use the overload with startIndex input.


Public Method

Finds the next layer that has an index equal or higher than the searched value.

Search in case-insensitive.


Public Method

Finds a Layer given its name hash.


Public Method

Makes a layer and all of its parent layers visible.


Public Method

Makes a layer and all of its parent layers visible.


Public Method

(Overrides

.)


Public Method

GetHashCode

Serves as the default hash function.

(Inherited from Object.)


Public Method

Returns the indices of layers that are selected on the Layer user interface.


Public Method

Gets an array of layer indices that are sorted by the values of

.


Public Method

GetType

Gets the Type of the current instance.

(Inherited from Object.)


Public Method
Code Example

Gets the next unused layer name used as default when creating new layers.


Public Method
Code Example

Obsolete.

Gets the next unused layer name used as default when creating new layers.


Public Method

Modifies layer settings.


Public Method

Modifies layer settings.


Public Method

Deletes a layer and all geometry objects on a layer.


Public Method

Deletes a layer and all geometry objects on a layer


Public Method

Selects layers in the Layer user interface.


Public Method

At all times, there is a “current” layer. Unless otherwise specified, new objects are assigned to the current layer. The current layer is never locked, hidden, or deleted.


Public Method

Updates the layer sort order


Public Method
SortByLayerName

Sort layers, in the layer table, by their name in either ascending or descending order. This function sorts layers in the same manner as Rhino’s Layers panel.


Public Method

ToString

Returns a string that represents the current object.

(Inherited from Object.)


Public Method

Undeletes a layer that has been deleted by DeleteLayer().


Public Method

Restores the layer to its previous state, if the layer has been modified and the modification can be undone.


Public Method

Restores the layer to its previous state, if the layer has been modified and the modification can be undone.


Public Method

Restores the layer to its previous state, if the layer has been modified and the modification can be undone.


Public Method

Restores the layer to its previous state, if the layer has been modified and the modification can be undone.