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

Change Macro to Lisp

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
hidden_intuition
552 Views, 7 Replies

Change Macro to Lisp

I am having a difficult time translating diesel macros to a lisp command.

 

I have:

 

^C^C^C_-layer SET;E-UTILITY;;-insert;"BLOCK-NAME";S;$M=$(/,1,$(getvar,cannoscalevalue));

 

When I create a lisp, I use (getvar "cannoscale"), it still comes in at a different size than the one used from macro. What am I missing with the $'s / and 1?

7 REPLIES 7
Message 2 of 8
Shneuph
in reply to: hidden_intuition

Looks like you may need to use 

(/ 1.0 (getvar "cannoscale"))

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 3 of 8
hidden_intuition
in reply to: Shneuph


@Shneuph wrote:

Looks like you may need to use 

(/ 1.0 (getvar "cannoscale"))


 

That gives me "error: bad argument type: numberp: "1:50""

Message 4 of 8
Shneuph
in reply to: hidden_intuition

ah yes.. try

(/ 1.0 (getvar "cannoscalevalue"))

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 5 of 8
hidden_intuition
in reply to: Shneuph


@Shneuph wrote:

ah yes.. try

(/ 1.0 (getvar "cannoscalevalue"))


I overlooked that one myself. I had that and then just copied and pasted your response and thought nothing of it. Kept getting the same response til I noticed I was missing a " ) " on the line. Works great now.

 

I appreciate your help.

 

 

BTW, what does the slash and 1 represent?

Message 6 of 8
Shneuph
in reply to: hidden_intuition

You are dividing the 1 by the cannoscalevalue (which is a decimal).  e.g. cannoscalevalue for 1/4"=1'-0" is 0.0208333. 1/0.0208333 = 48

 

AutoLISP Operators Help

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 7 of 8
hidden_intuition
in reply to: Shneuph

I thought the slash might represent dividing but wasn't sure how it played into the cannoscale.

 

Thanks!

Message 8 of 8
alanjt_
in reply to: hidden_intuition

This is what Tool Palettes were created for.

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

Post to forums  

Autodesk Design & Make Report

ā€Boost