Insert command into existing macro to change the annotation scale

Insert command into existing macro to change the annotation scale

Anonymous
Not applicable
1,357 Views
4 Replies
Message 1 of 5

Insert command into existing macro to change the annotation scale

Anonymous
Not applicable

The macro below is to scale a selection set (title block and other text related items, which are in model space) to the scale of (/ 64.0 48), which actually changes the existing scale of 1/4" = 1'-0" to 3/16" = 1'-0".
I would also like to have this same macro change the annotation scale, in the lower right of the Autocad screen, to 3/16" = 1'-0".
I tried to introduce the cannoscale command and the system variable but could not get either to work.

 

^C^C(if (setq tb (ssget))(command "scale" tb "" '(0 0 0)(/ 64.0 48)))(command "zoom" "extents")

0 Likes
Accepted solutions (1)
1,358 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

Perhaps you didn't consolidate multiple operations into one 'thenexpr' argument for the (if) function.  Try collapsing all those commands into one (command) function for the purpose, something like [untested]:

 

^C^C(if (setq tb (ssget)) (command "scale" tb "" '(0 0 0) (/ 64.0 48) "cannoscale" 64 "zoom" "extents"))

 

It could also be done using (progn) to "wrap" multiple different functions into one 'thenexpr' argument, using (setvar) for the CANNOSCALE setting, and (command) for only the Scaling and Zooming.

Kent Cooper, AIA
0 Likes
Message 3 of 5

Anonymous
Not applicable
Accepted solution

I put the cannoscale command first, before the "if". That worked.

0 Likes
Message 4 of 5

m_rogoff
Advocate
Advocate

Hi, nice macro. I'd like to use it too. 

 

I'm not sure exactly how you got this to work. I've tried several different itterations of moving the cannoscale command in front of "if", but I can't seem to get the ( ) and string right. Can you please spell it out for me. Thanks!!  (I also removed zoom e)

 

This is one of my attemps

^C^C("cannoscale" 64 (if (setq tb (ssget)) (command "scale" tb "" '(0 0 0) (/ 64.0 48)))

0 Likes
Message 5 of 5

Anonymous
Not applicable

Here is what I ended up using:

 

^C^Ccannoscale;3/16" = 1'-0";(if (setq tb (ssget))(command "scale" tb "" '(0 0 0)(/ 64.0 48)))(command "zoom" "extents")