Layers

Components for reading, creating, finding and editing AutoCAD layers.


AC-LyrLayers

AutoCAD Layer

AutoCAD Layer icon

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

An AutoCAD Layer

Outputs

NameText

The name of the AutoCAD Layer.

The Id of the AutoCAD Layer.

LinePatternIdAutoCAD ObjectId

The Id of Line Patten of the AutoCAD Layer.

The color associated with the layer

LockedBoolean

Boolean value indicating if the AutoCAD Layers is Locked

See also

Set AutoCAD Layer, Get AutoCAD Layers, Get AutoCAD Layer By Name, Create AutoCAD Layer



AC-AddLyrLayers

Create AutoCAD Layer

Create AutoCAD Layer icon

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

DocumentAutoCAD Documentoptional

An AutoCAD Document. If not provided, the active document will be used.

NewNameText

The name of the AutoCAD Layer.

NewColourAutoCAD Colouroptional

The color associated with the layer

Outputs

NameText

The name of the AutoCAD Layer.

The Id of the AutoCAD Layer.

LinePatternIdAutoCAD ObjectId

The Id of Line Patten of the AutoCAD Layer.

The color associated with the layer

LockedBoolean

Boolean 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

LevelMessageCause & fix
ErrorNo active AutoCAD document availableNo document was supplied and no drawing is open. Open a drawing or connect a document.
WarningA Layer with this name already existsA 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



AC-LyrLayers

Get AutoCAD Layer By Name

Get AutoCAD Layer By Name icon

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

DocumentAutoCAD Documentoptional

An AutoCAD Document. If not provided, the active document will be used.

NameText

The name of the AutoCAD Layer to retrieve

Outputs

The 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

LevelMessageCause & fix
ErrorNo active AutoCAD document availableNo document was supplied and no drawing is open. Open a drawing or connect a document.
WarningNo 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



AC-LyrsLayers

Get AutoCAD Layers

Get AutoCAD Layers icon

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

DocumentAutoCAD Documentoptional

An AutoCAD Document. If not provided, the active document will be used.

Outputs

The AutoCAD Layers

Menu & behaviour

  • Recomputes automatically when relevant objects are added, modified, or erased in the AutoCAD/Civil document.

Exceptions

LevelMessageCause & fix
ErrorNo active AutoCAD document availableNo 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



AC-SetLyrLayers

Set AutoCAD Layer

Set AutoCAD Layer icon

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

An AutoCAD Layer

NewNameTextoptional

The name of the AutoCAD Layer.

NewLinePatternIdAutoCAD ObjectIdoptional

The Id of Line Patten of the AutoCAD Layer.

NewColourAutoCAD Colouroptional

The color associated with the layer

LockedBooleanoptional

Boolean value indicating if the AutoCAD Layers is Locked

Outputs

NameText

The name of the AutoCAD Layer.

The Id of the AutoCAD Layer.

LinePatternIdAutoCAD ObjectId

The Id of Line Patten of the AutoCAD Layer.

The color associated with the layer

LockedBoolean

Boolean value indicating if the AutoCAD Layers is Locked

Exceptions

LevelMessageCause & fix
ErrorNo document availableThe 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