Is there a way of opening existing cmds in the visual lisp editor and edit them to do something else? I'd like to set up a lisp where 'uu' would switch the drawing units from decimal to architectural units and hittng 'uu' again would switch it back.
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
Try this routine but you need to hit F2 after running the code .
(defun c:uu nil (if *decimal* (progn (command "_.-units" "2" "" "" "" "" "") (setq *decimal* nil) ) (progn (command "_.-units" "4" "" "" "" "" "") (setq *decimal* t) ) ) (princ) )
Another:
(defun c:uu nil (setvar 'lunits (- 6 (getvar 'lunits))) (princ) )
Assumes units are already set to either Decimal or Architectural.
Lee
To add to the other comments: I'd suggest naming the function something more descriptive so it won't clash with something else. You can always map "UU" to the command in the PGP file, which is much easier to edit than LISP files.