strange behavior from lisp.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I wrote a lisp routine which turns layers on and off and brings them to the foreground in order, it's a one press button which sets the draworder for our xrefs. The lisp routine is fine, I think, it is as follows -
(defun C:FY (/ BT TP) ;DEFINES FY TO RUN COMMAND SETS BT AND TP AS LOCAL VARIABLES
(setq bt (getvar "extmin") ;SET BT UPPER RIGHT CORNER
tp (getvar "extmax") ;SET TP LOWER RIGHT CORNER
) ;_ end setq
(COMMAND "-LAYER" "OFF" "*" "Y" "") ;TURNS ALL LAYERS OFF.
(COMMAND "-LAYER" "ON" "S-WALLOV" "") ;TURNS ON S-WALLOV
(COMMAND "_DRAWORDER" "W" BT TP "" "F" "") ;SETS THE DRAW ORDER FOR S-WALLOV ON TOP.
(COMMAND "-LAYER" "OFF" "*" "Y" "") ;TURNS ALL LAYERS OFF.
(COMMAND "-LAYER" "ON" "S-WALLUN" "") ;TURNS ON S-WALLUN
(COMMAND "_DRAWORDER" "W" BT TP "" "F" "") ;SETS THE DRAW ORDER FOR S-WALLUN ON TOP.
(COMMAND "-LAYER" "ON" "*" "") ;TURNS ALL LAYERS ON.
(COMMAND "-LAYER" "OFF" "*" "Y" "") ;TURNS ALL LAYERS OFF.
(COMMAND "-LAYER" "ON" "S-MARKING" "") ;TURNS ON S-MARKING
(COMMAND "_DRAWORDER" "W" BT TP "" "F" "") ;SETS THE DRAW ORDER FOR S-MARKING ON TOP.
(COMMAND "-LAYER" "OFF" "*" "Y" "") ;TURNS ALL LAYERS OFF.
(COMMAND "-LAYER" "ON" "*HATCH*" "") ;TURNS ON HATCH
(COMMAND "_DRAWORDER" "W" BT TP "" "B" "") ;SETS THE DRAW ORDER FOR ALL HATCH ON BACK.
(COMMAND "-LAYER" "ON" "*" "") ;TURNS ALL LAYERS ON.
(COMMAND "_REGENALL") ;REGENS VIEW
(PRINC) ;ENDS
)
could probably be better but its the first routine ive written. Anyway the problem comes when I use my macro, I have this lisp in my startup suite so it loads on autocad startup, but when I press my button macro it seems to add in a right click on every line of the lisp routine, but if I type fy in the command line it runs perfectly. The problem occurs when I use the macro to run the lisp routine.
The macro is simply -
^C^C(C:FY)
any suggestions?