flowerrobot Posted September 19, 2008 Posted September 19, 2008 hey, im still learning alot of the format of how to present a lisp commands, could some one please tell me why this code wont work? (DEFUN C:da() (GRAPHSCR) (if (= 1 (getvar "dimlfac")) (progn (command "dimclrt" 2) ;yellow text (command "linetype" "s" "continuous"\\) (command ".layer" "m" "dim" \) (command "celweight" 15) (command "_dimaligned") );progn (progn (command "dimclrt" 3) ;green text (command "linetype" "s" "continuous"\\) (command ".layer" "m" "dim" \) (command "celweight" 15) (command "_dimaligned") );progn );if ) Quote
CarlB Posted September 19, 2008 Posted September 19, 2008 In a lisp "command" function, use "pause" instead of a backslash: not - (command "linetype" "s" "continuous"\\) instead - (command "linetype" "s" "continuous" pause pause) Quote
lpseifert Posted September 19, 2008 Posted September 19, 2008 You may also want to try (command ".-linetype" "s" "continuous" "") (command ".-layer" "m" "dim" "") the 2 double quotes "" act as an enter Quote
flowerrobot Posted September 19, 2008 Author Posted September 19, 2008 Thanks guys, ill have a look on monday, the weird thing is, it works for all other commands except this one aye, ive got 10 code similar with the same format and they work it was only this one that dosnt, do you kno why they work yet this one dosnt? could you also please explain why i should use your methods? as i dont under stand the difference,why "" can = \\ while "" can also = \ please excuse my ignorance Quote
flowerrobot Posted September 21, 2008 Author Posted September 21, 2008 neither work for some reason if i run the vba in autocad it works fine if i copy it into the command line it loads fine i dont understand it works fine for all the other commands just not this one??? ;Dimension angled (defun c:da() (graphscr) (if (= 1 (getvar "dimlfac")) (progn (command "dimclrt" 2) ;yellow text (command "linetype" "s" "continuous" pause pause) (command ".layer" "m" "dim" pause) (command "celweight" 15) (command "dimaligned") );progn (progn (command "dimclrt" 3) ;green txt (command "linetype" "s" "continuous" pause pause) (command ".layer" "m" "dim" pause) (command "celweight" 15) (command "dimaligned") );progn );if ) ;Dimension angled (defun c:da() (graphscr) (if (= 1 (getvar "dimlfac")) (progn (command "dimclrt" 2) ;yellow text (command "linetype" "s" "continuous" "" "") (command ".layer" "m" "dim" "") (command "celweight" 15) (command "dimaligned") );progn (progn (command "dimclrt" 3) ;green txt (command "linetype" "s" "continuous" "" "") (command ".layer" "m" "dim" "") (command "celweight" 15) (command "dimaligned") );progn );if ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.