LISP: layerstate-restore - restoreflags

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
At our company we use layer states in our drawings, and for easy switching between layer states a small lisp allows us to quickly switch between them. When selecting a layer state from the ribbon, all layers not defined by the layer state are turned off, when using our LISP this doesn't happen, and it would be best that it did.
The code is really simple for each layerstate:
(defun c:100 () (layerstate-restore "LMAN_100" (acet-currentviewport-ename)) (command "REGENALL") )
The REGENALL is added for fun.
According to Autodesk the code is built as follows:
(layerstate-restore layerstatename viewport [restoreflags])
restoreflags
Type: Integer
Optional numeric 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).
So the solution would probably be to insert the "restoreflags". Can't figure out how to do it though. Anyone an idea?