Hi everyone,
I having a problem with this code that I am trying to write. I am looking to have it run the pline command with the endpoint osmode on as I pick different parts of my drawing.
The way it is written now it will pick the first two point but after that it will not use the endpoint osmode.
I hope somebody can help me
Thanks,
Kyle C.
Code:
(DEFUN C:PL1 (/ *Error* useros usercmd)
;; error function & Routine Exit
(defun *error* (msg)
(if
(not
(member
msg
'("console break"
"Function cancelled"
"quit / exit abort"
""
)
)
)
(princ (strcat "nError: " msg))
); endif
;;reset all variables here
(if useros
(setvar "osmode" useros)
)
(if usercmd
(setvar "CMDECHO" usercmd)
)
(setq useros nil
usercmd nil
)
);end error function (defun *Error* (msg) ; embedded defun
(setq useros (getvar "osmode")
usercmd (getvar "CMDECHO")
)
(setvar "cmdecho" 0)
(setq os1 (getvar "osmode"))
(princ "MACRO: PLINE WITH ENDPOINT ON")
(setvar "osmode" 1)
(COMMAND "_PLINE" (getpoint "nPick First point: "))
;(while (> (getvar "cmdactive") 0)) ; I am not sure if I need this or not, if I use it, it locks up Autocad
(princ "nNext Point: ");let 'em know it wants another point
(command pause);pause for subsiquent points
(setvar "osmode" os1)
(SETVAR "CMDECHO" 1)
(princ)
)