how to show INSUNITS in taskbar with MODEMACRO and LISP?

how to show INSUNITS in taskbar with MODEMACRO and LISP?

boicottms
Enthusiast Enthusiast
1,293 Views
2 Replies
Message 1 of 3

how to show INSUNITS in taskbar with MODEMACRO and LISP?

boicottms
Enthusiast
Enthusiast

Hello,

I use this Diesel expression to convert INSUNITS in meaningfull units in a text field (very useful in title blocks) :

%<\AcDiesel $(index,$(getvar,insunits),"-,in,ft,mi,mm,cm,m,km,µin,mil,yd,Å,nm,μm,dm,dam,hm,Gm,au,ly,pc")>%

I also create a command, showing the same thing in a menù command, through the CUI, setting its name to:

~Current unit: $(index,$(getvar,insunits),"-,in,ft,mi,mm,cm,m,km,µin,mil,yd,Å,nm,μm,dm,dam,hm,Gm,au,ly,pc")Cattura2.PNG

 

 

Then I discoverd that I can show it in the status bar with the commands:

modemacro
$(index,$(getvar,insunits),"-,in,ft,mi,mm,cm,m,km,µin,mil,yd,Å,nm,μm,dm,dam,hm,Gm,au,ly,pc")

But this is not loaded with each drawing. This should be done with lisp code. I started to play with this:

(SETVAR "modemacro"
(STRCAT "UNITS: $(index,$(getvar,insunits),"-,in,ft,mi,mm,cm,m,km,µin,mil,yd,Å,nm,μm,dm,dam,hm,Gm,au,ly,pc")")
)
;(replace this code with your own Diesel expression)
;end setvar

But I couldn't get it to work. I must do some stupid autolisp syntax errors.

Any help?

Thank youCattura.PNG

 

 

0 Likes
Accepted solutions (2)
1,294 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution
(SETVAR "modemacro" (strcat "UNITS: " "$(index,$(getvar,insunits),\"-,in,ft,mi,mm,cm,m,km,µin,mil,yd,A,nm,µm,dm,dam,hm,Gm,au,ly,pc\")"))

Or simply:

(SETVAR "modemacro" "UNITS: $(index,$(getvar,insunits),\"-,in,ft,mi,mm,cm,m,km,µin,mil,yd,A,nm,µm,dm,dam,hm,Gm,au,ly,pc\")")

 

The issue are inner quotation marks, read HERE

Message 3 of 3

boicottms
Enthusiast
Enthusiast
Accepted solution

@ВeekeeCZ

thank you, that works!

0 Likes