I am attempting to set up toolbars buttons that will have settings of text style, size, justification, layer, etc..using multiline text. When I place a macro in a toolbar button it does not take all of the settings established in the macro (mainly the justification settings); ^C^C-textstyle standard ^C^C-layer s E-TEXT ^C^Cmtext \ J MC \\ When I create a lisp routine it works; (DEFUN C:multilinetext (/) (COMMAND "textstyle" "standard") (initdia) (command ".mtext" PAUSE "J" "MC" "" "")) I have had this happen with other commands strings as well, can anyone tell me why some commands work in a macro and others only work in a lisp routine?
First, in your macro, only the first set of ^C^C are needed, and I use smei-colons instead of spaces in macros just so I can see them all. My guess is that after you set the current layer to E-TEXT you're hitting a cncel with a set of ^C^C before you cleanly exit the layer command. Try losing the ^C^C and add a space (semi-colon). What I've done is create a subroutine that sets the layer and textstyle like follows: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;; Set Current Layer to TEXT STYLE name (defun txstla ()(SETVAR "CMDECHO" 0) (setq txst (strcat "txt" (rtos (getvar "dimscale") 2 0))) (setq txla (tblsearch "layer" "Txt")) (if (/= txla nil) (setq txclr (abs (cdr (assoc '62 txla)))) (setq txclr 4) ) (setq ntxst (tblsearch "style" txst)) (if (/= ntxst nil) (progn (setq txst (cdr (assoc '2 ntxst))) (setvar "textstyle" txst) ) (progn (command ".style" txst "romans" (* (getvar "dimscale") 0.1) "0.7" "" "" "" "") ) ) (setq ntxla (tblsearch "layer" txst)) (if (= ntxla nil) (command "_layer" "m" txst "c" txclr "txt*" "") (command "_layer" "t" txst "s" txst "") ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Then I just prefix any text command with (txstla)
Thank you for the info, as you can see I am not a programmer by any means. I will take the semicolons into the applications. The other is more like alien text to me, therefore I am unable to apply it to what I need.