Author Topic: UCS Error Handler  (Read 291 times)

0 Members and 1 Guest are viewing this topic.

Biscuits

  • Bull Frog
  • Posts: 464
UCS Error Handler
« on: February 14, 2020, 10:00:11 AM »
I'm at a loss on how to include an error handler that would make sure "UCS world" get restored if this routine is canceled.
Would appreciate any help. Thanks

Code: [Select]
;MyRect
(defun c:MR ()

(setvar "autosnap" 47)
(setvar "autosnap" (boole 6 (getvar "autosnap") 8))

(setq p1(trans(getpoint"\nCorner of rectangle: ")1
0)p2(trans(getpoint"\npoint on X axis: "(trans p1 0 1))1 0))

(command"._UCS""_Z"(trans p1 0 1)(trans p2 0 1))
(command"._RECTANGLE"(trans p1 0 1))

(while(wcmatch(getvar"CMDNAMES")"*RECTANGLE*")(command pause))
  (command"._UCS""w")
  (Command "change" "last" "" "p" "LA" "CUSTOMER_HOUSE" "")
  (setvar "autosnap" 47)
(princ)
)