Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD LT 2012 macro error

1 REPLY 1
Reply
Message 1 of 2
shodenfudeuchi
245 Views, 1 Reply

AutoCAD LT 2012 macro error

I am using AutoCAD LT 2012. I am creating a macro to draw a breakline (Express Tools command alike). I would like to get in DIESEL to setvar the "USERR3" use the latest value of the environment variable "LE", but the previous value will be obtained.
How can I get the latest value? Please help.

^C^C_id;\_setenv;P1;$M=$(getvar,LASTPOINT);_id;\_setenv;P2;"$M=$(getvar,LASTPOINT)";_ucs;$M="$(getenv,P1)";"""$(getenv,P2)""";;_dist;$M="$(getenv,P1)";"""$(getenv,P2)""";_setenv;LE;"""""""""""""""$M=$(getvar,DISTANCE)""""""""""""""";_setvar;USERR3;$(if,$(<,$(strlen,"$(getenv,LE)"),6),"$(getenv,LE)",$(substr,"$(getenv,LE)",1,6));_pline;$M=non;"$(getenv,P1)";non;@$(-,$(/,$(getvar,USERR3),2),$(/,$(getvar,USERR3),10)),0;non;@$(/,$(getvar,USERR3),20),$(/,$(getvar,USERR3),10);non;@$(/,$(getvar,USERR3),10),-$(/,$(getvar,USERR3),5);non;@$(/,$(getvar,USERR3),20),$(/,$(getvar,USERR3),10);non;@$(-,$(/,$(getvar,USERR3),2),$(/,$(getvar,USERR3),10)),0;;_ucs;w;

1 REPLY 1
Message 2 of 2
gil.dalton
in reply to: shodenfudeuchi

If you tweak your GETVAR function slightly to "$M=$(getvar,LASTPOINT)"; it should work. The quotes cause the GETVAR to be evaluated in a second step at which point it will return the new LASTPOINT value.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost