Message 1 of 7

Not applicable
07-22-2020
05:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone, I'm trying to write a lisp routine for a co-worker so he can put a dimension on his dwg on the dimension layer. Trying to grab the CLAYER, change layer to Dim layer for the dimension, and once the dimension is in place I would like the current layer to be on the layer before the routine started.
I have this so far:
(defun c:d ()
(setq oldlay (getvar "clayer"))
(command "-layer" "m" "DIMENSION" "c" "1" "DIMENSION" "L" "continuous" "DIMENSION" "lw" ".18" "DIMENSION" "")
(command "dimlinear" (prompt getpoint "Specify first extension line origin:") (prompt getpoint "Specify second extension line origin: ") (prompt getpoint "Specify dimension line location: "))
(setvar "clayer" oldlay)
(princ)
I can start on any layer, the routine changes the layer to Dim layer, and can drop a dimension in the DWG, but after the dimension is in place, it doesn't go back to original layer. Any help would be appreciated greatly!
Solved! Go to Solution.