Cannonscale setvar

Cannonscale setvar

whitney_jeff
Collaborator Collaborator
1,152 Views
7 Replies
Message 1 of 8

Cannonscale setvar

whitney_jeff
Collaborator
Collaborator

Accidentaly used the wrong name for my original post

 

I have a setup lisp routine that creates a scale factor - I would like to pass that on to cannoscale, but cannoscale seems to only recognize architectural formats such as 1/8" = 1'-0".

 

The test expression (if (=  sf 96) would be the start of the expression (sf is my scale factor) - but I cannot figure out how to pass the arch scale 1/8" = 1'-0" on to cannoscale in a setvar statement.

 

I tried (setvar "cannoscale '1/8"=1'-0") but it seems the second quote mark messes it up.  How can I get around this?

 

Many thanks!

0 Likes
Accepted solutions (1)
1,153 Views
7 Replies
Replies (7)
Message 2 of 8

dbroad
Mentor
Mentor

(setvar "cannoscale '1/8\"=1'-0")

 

put a backslash to escape the quote.

Architect, Registered NC, VA, SC, & GA.
Message 3 of 8

whitney_jeff
Collaborator
Collaborator

returns "too many arguments"

 

I tried (setvar "cannoscale" '1/8\"=1'-0")

(setvar "cannoscale" '1/8\"=1'-0")

(setvar "cannoscale '1/8"=1\'-0")

and other variations

0 Likes
Message 4 of 8

hmsilva
Mentor
Mentor

Hi Jeff,

 

try

(setvar 'CANNOSCALE "1/8\" = 1'-0\"")

 

there are spaces and a last "

 

Hope this helps,
Henrique

 

 

EESignature

0 Likes
Message 5 of 8

whitney_jeff
Collaborator
Collaborator

There is no joy in Muddville Smiley Embarassed

 

The leading single quote I have (') is equal to (quote), but the second single quote used as the foot mark (1') as well as all the double (") quotes (inch marks) really seems to mess everything up.  I wonder if I would be better off doing a setq for the scale and then using something like (setq 1-8 "1/8\"=1\'-0\"") and then (setvar "cannonscale" 1-8)?

0 Likes
Message 6 of 8

dbroad
Mentor
Mentor
Accepted solution

Sorry, I didn't look at your code closely enough.  setvar takes 2 arguments, the variable name and the value.  There are two possible ways to enter the variable name, 1)as a double quoted string, or 2) as a single quoted variable

 

(setvar 'cannoscale "1/8\" = 1'-0\"")

or

(setvar "cannoscale" "1/8\" = 1'-0\"")

 

The value cannot begin with a single quote because cannoscale must have a string.  In addition, the name must be exact with spaces.

 

Before coding, I suggest using getvar as in

(getvar "cannoscale")

"1/8\" = 1'-0\""

 

It will show you exactly what to type if the annotation scale is already set.

Architect, Registered NC, VA, SC, & GA.
Message 7 of 8

whitney_jeff
Collaborator
Collaborator

DB - that worked.  I swear I tried that combination and it bombed.  AutoLISP - go figure!

 

Thanks for your help and patience!

 

0 Likes
Message 8 of 8

dbroad
Mentor
Mentor

You're welcome.

Architect, Registered NC, VA, SC, & GA.