Click or drag to resize

Layer Class

[Missing <summary> documentation for "T:Rhino.DocObjects.Layer"]

Inheritance Hierarchy

Namespace:  Rhino.DocObjects
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
[SerializableAttribute]
public class Layer : CommonObject

The Layer type exposes the following members.

Constructors
  NameDescription
Public methodLayer
Initializes a new instance of the Layer class
Protected methodLayer(SerializationInfo, StreamingContext)
Initializes a new instance of the Layer class
Top
Properties
  NameDescription
Public propertyColor
Gets or sets the display color for this layer.
Public propertyComponentStatus
Gets or sets the status of the layer.
(Overrides ModelComponentComponentStatus.)
Public propertyComponentType
Returns Layer.
(Overrides ModelComponentComponentType.)
Public propertyDeletedName
Gets the name of a component that is deleted.
(Inherited from ModelComponent.)
Public propertyDisposed
Indicates if this object has been disposed or the document it originally belonged to has been disposed.
(Inherited from CommonObject.)
Public propertyCode exampleFullPath
Gets the full path to this layer. The full path includes nesting information.
Public propertyHasId
Returns a value indicating whether the component has an ID.
(Inherited from ModelComponent.)
Public propertyHasIndex
Returns a value indicating whether the component has an Index.
(Inherited from ModelComponent.)
Public propertyHasName
Returns a value indicating whether the component has a Name.
(Inherited from ModelComponent.)
Public propertyHasUserData
Gets true if this class has any custom information attached to it through UserData.
(Inherited from CommonObject.)
Public propertyId
Gets or sets the ID of this layer object. You typically do not need to assign a custom ID.
Public propertyIdIsLocked
Returns a value indicating whether the component ID is already locked.
(Inherited from ModelComponent.)
Public propertyIgesLevel
Gets or sets the IGES level for this layer.
Public propertyIndex
Gets or sets the model component index attribute.
(Inherited from ModelComponent.)
Public propertyIndexIsLocked
Returns a value indicating whether the component Index is already locked.
(Inherited from ModelComponent.)
Public propertyIsComponentStatusLocked
The component status itself can be locked. This returns an indication.
(Inherited from ModelComponent.)
Public propertyIsDeleted
Gets a value indicating whether this layer has been deleted and is currently in the Undo buffer.
Public propertyIsDocumentControlled
If true this object may not be modified. Any properties or functions that attempt to modify this object when it is set to "IsReadOnly" will throw a NotSupportedException.
(Inherited from CommonObject.)
Public propertyIsExpanded
Gets or sets a value indicating whether this layer is expanded in the Rhino Layer dialog.
Public propertyCode exampleIsLocked
Gets or sets a value indicating the locked state of this layer.
Public propertyIsReference
Gets a value indicting whether this layer is a referenced layer. Referenced layers are part of referenced documents.
Public propertyIsSystemComponent
True if this model component is a system constant.

An incomplete list of system constant model components is below:

  • ON_ModelComponent::Unset

  • ON_InstanceDefinition::Empty

  • ON_Linetype::Unset
  • ON_Linetype::Continuous
  • ON_Linetype::ByLayer
  • ON_Linetype::ByParent

  • ON_Layer::Unset
  • ON_Layer::Default

  • ON_TextStyle::Unset
  • ON_TextStyle::Default
  • ON_TextStyle::ByLayer
  • ON_TextStyle::ByParent

  • ON_DimStyle::Unset
  • ON_DimStyle::Default
  • ON_DimStyle::DefaultInchDecimal
  • ON_DimStyle::DefaultInchFractional
  • ON_DimStyle::DefaultFootInchArchitecture
  • ON_DimStyle::DefaultMillimeterSmall
  • ON_DimStyle::DefaultMillimeterLarge
  • ON_DimStyle::DefaultMillimeterArchitecture
(Inherited from ModelComponent.)
Public propertyIsValid
Tests an object to see if it is valid.
(Inherited from CommonObject.)
Public propertyIsVisible
Gets or sets the visibility of this layer.
Public propertyLayerIndex
Gets or sets the index of this layer.
Public propertyLinetypeIndex
Gets or sets the line-type index for this layer.
Public propertyCode exampleName
Gets or sets the name of this layer.
Public propertyNameIsLocked
Returns a value indicating whether the component Name is already locked.
(Inherited from ModelComponent.)
Public propertyCode exampleParentLayerId
Gets the ID of the parent layer. Layers can be origanized in a hierarchical structure, in which case this returns the parent layer ID. If the layer has no parent, Guid.Empty will be returned.
Public propertyStatic memberPathSeparator
The string "::" (colon,colon) is used to separate parent and child layer names.
Public propertyPlotColor
Gets or sets the plot color for this layer.
Public propertyPlotWeight
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.
Public propertyRenderMaterial
Gets or sets the RenderMaterial for objects on this layer that have MaterialSource() == MaterialFromLayer. A null result indicates that no RenderMaterial has been assigned and the material created by the default Material constructor or the RenderMaterialIndex should be used.
Public propertyRenderMaterialIndex
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.
Public propertySortIndex
Runtime index used to sort layers in layer dialog.
Public propertyUserData
List of custom information that is attached to this class.
(Inherited from CommonObject.)
Public propertyUserDictionary
Dictionary of custom information attached to this class. The dictionary is actually user data provided as an easy to use sharable set of information.
(Inherited from CommonObject.)
Public propertyUserStringCount
Gets the amount of user strings.
Top
Methods
  NameDescription
Public methodClearId
Resets the HasId property of the model component to false, if possible.
(Inherited from ModelComponent.)
Public methodClearIndex
Resets the HasIndex property of the model component to false, if possible.
(Inherited from ModelComponent.)
Public methodClearName
Resets the HasName property of the model component to false, if possible.
(Inherited from ModelComponent.)
Public methodCode exampleCommitChanges
Protected methodConstructConstObject
Assigns a parent object and a subobject index to this.
(Inherited from CommonObject.)
Public methodCopyAttributesFrom
Copy typical attributes from another layer
Public methodDataCRC
Increments the Cyclic Redundancy Check value by this instance.
(Inherited from ModelComponent.)
Public methodDefault
Sets layer to default settings.
Public methodDeletePerViewportColor
Remove any per viewport layer color setting so the layer's overall setting will be used for all viewports.
Public methodDeletePerViewportPlotColor
Remove any per viewport layer plot color setting so the layer's overall setting will be used for all viewports.
Public methodDeletePerViewportPlotWeight
Remove any per viewport layer plot weight setting so the layer's overall setting will be used for all viewports.
Public methodDeletePerViewportSettings
Deletes per viewport layer settings.
Public methodDeletePerViewportVisible
Remove any per viewport visibility setting so the layer's overall setting will be used for all viewports.
Public methodDispose
Actively reclaims unmanaged resources that this instance uses.
(Inherited from CommonObject.)
Protected methodDispose(Boolean)
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

(Inherited from CommonObject.)
Public methodEnsurePrivateCopy
If you want to keep a copy of this class around by holding onto it in a variable after a command completes, call EnsurePrivateCopy to make sure that this class is not tied to the document. You can call this function as many times as you want.
(Inherited from CommonObject.)
Public methodEquals(Object)
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodEquals(Object) (Overrides ObjectEquals(Object).)
Public methodEquals(Layer)
Protected methodFinalize
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
(Inherited from CommonObject.)
Public methodGetChildren
Gets immediate children of this layer. Note that child layers may have their own children.
Public methodStatic memberGetDefaultLayerProperties
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)

Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetHashCode (Overrides ObjectGetHashCode.)
Public methodStatic memberGetLeafName(String)
Get a layer name's "leaf" level name
Public methodStatic memberGetLeafName(Layer)
Get a layer name's "leaf" level name
Public methodGetObjectData
Populates a System.Runtime.Serialization.SerializationInfo with the data needed to serialize the target object.
(Inherited from CommonObject.)
Public methodStatic memberGetParentName(String)
Get a layer's "parent" path name
Public methodStatic memberGetParentName(Layer)
Get a layer's "parent" path name
Public methodGetPersistentLocking
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.
Public methodGetPersistentVisibility
The persistent visbility setting is used for layers whose visibilty 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.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetUserString
Gets user string from this geometry.
Public methodGetUserStrings
Gets a copy of all (user key string, user value string) pairs attached to this geometry.
Public methodHasPerViewportSettings
Verifies that a layer has per viewport settings.
Public methodIsChildOf(Int32)
Public methodIsChildOf(Guid)
Public methodIsChildOf(Layer)
Public methodIsParentOf(Int32)
Public methodIsParentOf(Guid)
Public methodIsParentOf(Layer)
Public methodStatic memberCode exampleIsValidName
Determines if a given string is valid for a layer name.
Public methodIsValidWithLog
Determines if an object is valid. Also provides a report on errors if this object happens not to be valid.
(Inherited from CommonObject.)
Public methodLockId
Locks the component Id property.
(Inherited from ModelComponent.)
Public methodLockIndex
Locks the component Index property.
(Inherited from ModelComponent.)
Public methodLockName
Locks the component Name property.
(Inherited from ModelComponent.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodNonConstOperation
For derived classes implementers.

Defines the necessary implementation to free the instance from being const.

(Inherited from CommonObject.)
Protected methodOnSwitchToNonConst
Is called when a non-const operation first occurs.
(Inherited from CommonObject.)
Public methodPerViewportColor
Gets the display color for this layer.
Public methodPerViewportIsVisible
Gets the per viewport visibility of this layer.
Public methodPerViewportPersistentVisibility
Gets the per layer persistent visibility. The persistent visbility setting is used for layers whose visibilty 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.
Public methodPerViewportPlotColor
Gets the plot color for this layer.
Public methodPerViewportPlotWeight
Gets the plot weight, in millimeters, for this layer.
Public methodSetPersistentLocking
Set the persistent locking setting for this layer
Public methodSetPersistentVisibility
Set the persistent visibility setting for this layer
Public methodSetPerViewportColor
Sets the display color for this layer.
Public methodSetPerViewportPersistentVisibility
Sets the per layer persistent visibility. The persistent visbility setting is used for layers whose visibilty 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.
Public methodSetPerViewportPlotColor
Sets the plot color for this layer.
Public methodSetPerViewportPlotWeight
Sets the plot weight, in millimeters, for this layer.
Public methodSetPerViewportVisible
Controls layer visibility in specific viewports.
Public methodSetUserString
Attach a user string (key,value combination) to this geometry.
Public methodToString (Overrides ObjectToString.)
Public methodUnsetPersistentLocking
Remove any explicity persistent locking settings from this layer
Public methodUnsetPersistentVisibility
Remove any explicit persistent visibility setting from this layer
Public methodUnsetPerViewportPersistentVisibility
Remove any per viewport persistent visibility setting so the layer's overall setting will be used for all viewports.
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Public operatorStatic memberInequality
Top
Version Information

Rhino for Mac

Supported in: 5.4

Rhino for Windows

Supported in: 6.9
See Also