PDA

View Full Version : toolbar dimlinear macro help


d_m_hopper
2008-02-19, 03:37 PM
I do not write macros at all, here is how it currently written

^C^C(command "_.cmdecho" "0" "_.layer" "_t" "apdim" "_s" "apdim" "" "_.textstyle" "dmt" "_.cmdecho" "1" "_dimlinear" pause pause pause)

what I would like is for it to have the ability to rerun the macro when I hit enter, spacebar, etc.....currently it opens the help menu or cui dialog?

what do I need to do to change that?

irneb
2008-02-19, 05:06 PM
I do not write macros at all, here is how it currently written

^C^C(command "_.cmdecho" "0" "_.layer" "_t" "apdim" "_s" "apdim" "" "_.textstyle" "dmt" "_.cmdecho" "1" "_dimlinear" pause pause pause) what I would like is for it to have the ability to rerun the macro when I hit enter, spacebar, etc.....currently it opens the help menu or cui dialog?

what do I need to do to change that?
Copy all that code (except for the ^C^C) into a LSP file & suround with a command function wrapper. Preferably the ACAD.LSP or ACADDOC.LSP (in the support paths). If none exists create one using Notepad. The contents you'll add would look like below:

(defun c:DimLayTxt (/ ) ;Create a new command (change the name after c: if you wish)
(command "_.cmdecho" "0" "_.layer" "_t" "apdim" "_s" "apdim" "" "_.textstyle" "dmt" "_.cmdecho" "1" "_dimlinear" pause pause pause)
(princ)
)

After this change the macro to the name of the function, in this case DimLayTxt. You may have to restart AutoCAD for the function to load automatically.

d_m_hopper
2008-02-20, 09:48 PM
hey irneb, thanks for your help...I did not want another lisp routine to keep track of though....so I modified my search on this site and found some helpful macro tips and came up with this macro

*^C^Cosmode;767;orthomode;1;-layer;set;epdim;;textstyle;dmt;dimlinear

:mrgreen: