Save Layer State
layer_state_saveSave a named snapshot of all layer on/frozen/locked/color/linetype/lineweight/plot flags plus the current layer to the drawing, so setups can be restored and travel with the file.
Instructions
Snapshot every layer's on/frozen/locked/color/linetype/lineweight/plot flags plus the current layer as a named state stored in the drawing.
These are the server's own portable layer states: JSON chunks in an XRECORD
under the ACADMCP_LAYERSTATES dictionary. They live in the file and
travel with it, work on both engines, and do not appear in AutoCAD's
Layer States Manager (LAYERSTATE). Same name replaces (replaced: true).
Refusals: an empty or control-character name, a non-string description.
Pack: settings · lean: no.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | State name, e.g. PLOT-SET or DESIGN | |
| description | No | Free text stored with the state |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||