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().
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.
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.
Remarks:
Detaching a worksession reference model, or purging a linked instance definition, removes its layers but leaves the table slots they occupied empty. The slots cannot be closed up, because table indices are persistent references that objects store - object attributes hold a layer index - so renumbering would repoint existing objects at the wrong layer. Count spans the empty slots, and they accumulate for the life of the document - one per purge.
An index that lands on an empty slot returns the document's default layer rather than throwing. Nothing about that layer says it is a stand-in: it reports the name "Default" and ordinary values for every other property, so enumerating a table that has been purged several times reports several layers that are not there. The one distinguishing mark is the index - a stand-in reports Index -1, never the index you asked for - so test index == Layers[index].Index before treating an entry as real. Enumerating the table with foreach goes through the document manifest rather than the raw table array, so it does not visit empty slots at all and is the safer way to walk the table. See RH-97389.
Returns: Reference to the layer. If layer_index is out of range, the current layer is returned. Note that this reference may become invalid after AddLayer() is called.
definition of new layer. The information in layer is copied. If layer.Name is empty the a unique name of the form "Layer 01" will be automatically created.
Returns: >=0 index of new layer -1 layer not added because a layer with that name already exists.
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 ModelComponent.NamePathSeparator. For example, "Grandfather::Father::Son".
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 ModelComponent.NamePathSeparator. For example, "Grandfather::Father::Son".
definition of new layer. The information in layer is copied. If layer.Name is empty the a unique name of the form "Layer 01" will be automatically created.
Returns: >=0 index of new layer -1 layer not added because a layer with that name already exists.
Worksession reference model serial number, where: 0: Layer is not a reference layer. 1: Layer is a reference layer but not part of a worksession reference file. 2-1000: Reserved for future use. >1000: Worksession reference model serial number.
Linked instance definition serial number, where: 0: Layer is not from a liked instance definition. 1-1000: Reserved for future use. >1000: Linked instance definition serial number.
Returns: The index of the last layer created if successful, RhinoMath.UnsetIntIndex on failure.
If true, no warning message box appears if a layer the layer cannot be deleted because it is the current layer or it contains active geometry.
Returns: true if successful. false if layerIndex is out of range or the layer cannot be deleted because it is the current layer or because it layer contains active geometry.
If true, no warning message box appears if a layer the layer cannot be deleted because it is the current layer or it contains active geometry.
Returns: true if successful. false if layerIndex is out of range or the layer cannot be deleted because it is the current layer or because it layer contains active geometry.
If true, no warning message box appears if a layer the layer cannot be deleted because it is the current layer or it contains active geometry.
Returns: true if successful. false if layerIndex is out of range or the layer cannot be deleted because it is the current layer or because it layer contains active geometry.
Returns: true if successful. false if layerIndex is out of range or the layer cannot be deleted because it is the current layer or because it layer contains active geometry.
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.
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.
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.
Remarks: This function changes the value of Layer.SortIndex. It does not change the index order of layers in the layer table.