layerstate-restore

AutoCad AutoLISP Functions

 
layerstate-restore
 
 
 

Restores a layer state into the current drawing

(layerstate-restore layerstatename viewport
[restoreflags])

Arguments

layerstatename

A string specifying the name of the layer to restore.

viewport

An ename (ads_name) of the viewport to which layerstatename should be restored. If viewport is nil, the layer state is restored to model space.

restoreflags

Optional integer sum affecting how the layer state is restored.

1- Turn off all layers not in the restored layer state

2- Freeze all layers not in the restored layer state

4- Restore the layer state properties as viewport overrides (requires viewport to be not a nil value).

Return Values

nil if the layer state does not exist or contains no layers; otherwise, returns a list of layer names.

Examples

(layerstate-restore “myLayerState“ viewportId 5)
(“Layername1” “Layername2“)