Restore Layer State
layer_state_restoreApply a saved layer state to existing drawing layers, skipping missing ones and leaving new layers untouched. Reports how many layers and properties moved, with warnings for refusals.
Instructions
Apply a saved state to the layers that still exist.
missing_layers (in the state, not in the drawing) are skipped, never
created; new_layers (in the drawing, not in the state) are untouched;
applied says how many layers and which properties moved. Refusals: an
unknown state name (lists the saved ones), a property outside the eight
(names the index). Live, a layer AutoCAD refuses to change (freezing the
active layer, making a frozen layer current) lands in warnings instead
of failing the call; the state's current layer is thawed before it is
made current when frozen is being restored, so save → freeze → restore
round-trips. Portable server states, not Layer States Manager entries.
Pack: settings · lean: no.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | A name from layer_state_list | |
| properties | No | Subset of on, frozen, locked, color, linetype, lineweight, plot, current; omit for all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||