opeenna
2008-03-01, 01:02 PM
Hi,
I am trying to make a custom hatch command that switches to a particular layer i want the hatch to be drawn on, then displays the hatch dialog, lets me make the hatch, and after it is complete it reactivates the layer that was current before the command was invoked.
but even though i start the hatch command without the dash (command "hatch") it activates the command line version of the hatch command. what am i doing wrong?
here is the full code:
(defun c:chatch ()
(setq cmdsave (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq lyrsave (getvar "clayer"))
(setq currentfloorhatchlayer (strcat currentfloor "_DB10-hatch"))
(command "-layer" "t" currentfloorhatchlayer "")
(command "-layer" "s" currentfloorhatchlayer "")
(setvar "cmdecho" 1)
(command "hatch")
;restore original current layer
(command "-layer" "s" lyrsave "")
(setvar "cmdecho" cmdsave)
(princ)
)
I am trying to make a custom hatch command that switches to a particular layer i want the hatch to be drawn on, then displays the hatch dialog, lets me make the hatch, and after it is complete it reactivates the layer that was current before the command was invoked.
but even though i start the hatch command without the dash (command "hatch") it activates the command line version of the hatch command. what am i doing wrong?
here is the full code:
(defun c:chatch ()
(setq cmdsave (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq lyrsave (getvar "clayer"))
(setq currentfloorhatchlayer (strcat currentfloor "_DB10-hatch"))
(command "-layer" "t" currentfloorhatchlayer "")
(command "-layer" "s" currentfloorhatchlayer "")
(setvar "cmdecho" 1)
(command "hatch")
;restore original current layer
(command "-layer" "s" lyrsave "")
(setvar "cmdecho" cmdsave)
(princ)
)