Layers
Components for reading, creating, finding and editing AutoCAD layers.
AutoCAD Layer
AutoCAD › Layers · Introduced v1.0.0
Reads the details of an existing AutoCAD layer and breaks them out into separate values. Feed it a layer and you get back its name, identifiers, assigned colour and lock state, ready to inspect or pass on to other nodes.
Inputs
LayerAutoCAD LayerAn AutoCAD Layer
Outputs
NameTextThe name of the AutoCAD Layer.
The Id of the AutoCAD Layer.
LinePatternIdAutoCAD ObjectIdThe Id of Line Patten of the AutoCAD Layer.
ColourAutoCAD ColourThe color associated with the layer
LockedBooleanBoolean value indicating if the AutoCAD Layers is Locked
See also
Set AutoCAD Layer, Get AutoCAD Layers, Get AutoCAD Layer By Name, Create AutoCAD Layer
Create AutoCAD Layer
AutoCAD › Layers · Introduced v1.0.0, updated v1.0.20
Creates a new layer in an AutoCAD document. Give it a name and, optionally, a colour and a target document; if no document is supplied the active drawing is used. The new layer's details are returned. If a layer with the same name already exists it is returned instead of creating a duplicate.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
NewNameTextThe name of the AutoCAD Layer.
The color associated with the layer
Outputs
NameTextThe name of the AutoCAD Layer.
The Id of the AutoCAD Layer.
LinePatternIdAutoCAD ObjectIdThe Id of Line Patten of the AutoCAD Layer.
ColourAutoCAD ColourThe color associated with the layer
LockedBooleanBoolean value indicating if the AutoCAD Layers is Locked
Menu & behaviour
- Recomputes automatically when relevant objects are added, modified, or erased in the AutoCAD/Civil document.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and no drawing is open. Open a drawing or connect a document. |
| Warning | A Layer with this name already exists | A layer of that name is already in the drawing; the existing layer is returned. Choose a different name to create a new one. |
See also
AutoCAD Layer, Get AutoCAD Layer By Name, Get AutoCAD Layers, Set AutoCAD Layer
Get AutoCAD Layer By Name
AutoCAD › Layers · Introduced v1.0.0, updated v1.0.20
Finds a single layer in an AutoCAD drawing by its exact name. Optionally target a specific document; if none is supplied the active drawing is searched. Use this when you already know the layer name and want to pull just that one layer.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
NameTextThe name of the AutoCAD Layer to retrieve
Outputs
LayerAutoCAD LayerThe AutoCAD Layer matching the name, or the default layer if no matching layer is found
Menu & behaviour
- Recomputes automatically when relevant objects are added, modified, or erased in the AutoCAD/Civil document.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and no drawing is open. Open a drawing or connect a document. |
| Warning | No layer exists with name: {name} | No layer matches the supplied name. Check the spelling, or use Get AutoCAD Layers to list available layers. |
See also
AutoCAD Layer, Get AutoCAD Layers, Create AutoCAD Layer, Set AutoCAD Layer
Get AutoCAD Layers
AutoCAD › Layers · Introduced v1.0.0, updated v1.0.20
Returns every layer in an AutoCAD drawing as a list. Optionally target a specific document; if none is supplied the active drawing is used. Use this to browse all layers or to feed downstream nodes that filter or process them.
Inputs
An AutoCAD Document. If not provided, the active document will be used.
Outputs
LayersAutoCAD LayerThe AutoCAD Layers
Menu & behaviour
- Recomputes automatically when relevant objects are added, modified, or erased in the AutoCAD/Civil document.
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No active AutoCAD document available | No document was supplied and no drawing is open. Open a drawing or connect a document. |
See also
AutoCAD Layer, Get AutoCAD Layer By Name, Create AutoCAD Layer, Set AutoCAD Layer
Set AutoCAD Layer
AutoCAD › Layers · Introduced v1.0.0, updated v1.0.4
Edits the properties of an existing AutoCAD layer. Connect a layer and supply any of the new name, line pattern, colour or lock state; values you leave unconnected keep their current settings. The layer is only rewritten when something actually changes, and the updated details are returned.
Inputs
LayerAutoCAD LayerAn AutoCAD Layer
NewNameTextoptionalThe name of the AutoCAD Layer.
The Id of Line Patten of the AutoCAD Layer.
The color associated with the layer
LockedBooleanoptionalBoolean value indicating if the AutoCAD Layers is Locked
Outputs
NameTextThe name of the AutoCAD Layer.
The Id of the AutoCAD Layer.
LinePatternIdAutoCAD ObjectIdThe Id of Line Patten of the AutoCAD Layer.
ColourAutoCAD ColourThe color associated with the layer
LockedBooleanBoolean value indicating if the AutoCAD Layers is Locked
Exceptions
| Level | Message | Cause & fix |
|---|---|---|
| Error | No document available | The drawing that owns this layer could not be located. Make sure the source drawing is open. |
See also
AutoCAD Layer, Create AutoCAD Layer, Get AutoCAD Layer By Name, Get AutoCAD Layers