Let's see if I understand: you already have layers dimaligned, dimlinear, etc. (or want to
create them if they don't exist.) Then you want the ensuing dimension to appear on the
appropriate layer. But you don't want to be stranded in that layer; you want to go back to
your original layer. Yes?
You can write a function named "dimlinear" that overrides to built-in one. I think that is
risky, because it depends on loading acad.lsp (or whatever self-loader). I would use
c:dl() or c:da() instead. Anyway, try this and let me know if it comes close:
(defun c:dl( / ) ; dimlinear to layer DIMLINEAR
(setq clay(getvar "clayer"))
(command "layer" "m" "dimlinear" "") ;this will either make it or activate it
(command "dimlinear"
(getpoint "\nSpecify the first extension line origin: ")
(getpoint "\nSpecify the second extension line origin: ")
(getpoint "\nSpecify dimension line location: ")
)
(command "layer" "s" clay "" )
(princ))
The reason for the getpoints is, if you just allow the dimension command to prompt, it
will quit and terminate the lisp function before it gets to the last line. Unfortunately,
you give up dragging the dimension lines this way.
rs
wrote in message news:5576074@discussion.autodesk.com...
I am wanting to write a new routine for making layer changes based on what I type in the
command line, since I dont use buttons for these functions. i have not written a LISP
routine in about 4yrs and am very rusty on this. I would like the layer to change to
DIM(does not need to be in all caps) when i type in DIM****(whatever is after dim, like
linear, aligned) and hit enter. since I dont use the button for this, I dont want to add
that step in the button command. any help would be appreciated.
Thanks,
Michael Reiter
www.reiterdrafting.com
michael@reiterdrafting.com