using 'cal in a tool palette command string

using 'cal in a tool palette command string

awatt
Advocate Advocate
1,128 Views
2 Replies
Message 1 of 3

using 'cal in a tool palette command string

awatt
Advocate
Advocate

This works as a tool palette command string:

^C^C_mleaderscale^m'cal^mgetvar(dimscale)^m

 

But when I insert this between two other commands, it doesn't work.

^C^C_servar^m_cmleaderstyle^mVC_Parts^m^C^C_servar^mmleaderscale^m'cal^mgetvar(dimscale)^m^C^C_mleader

The output is as follows: (The last *Cancel* is me hitting the escape key)

 

Command: _setvar
Enter variable name or [?] <MLEADERSCALE>: mleaderscale

Enter new value for MLEADERSCALE <1.00>: 'cal
>>>> Expression: getvar(dimscale)

Resuming SETVAR command.

Enter new value for MLEADERSCALE <1.00>: *Cancel*

Command:
Command: _mleader
Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>: 5

Invalid Input.
Specify leader arrowhead location or [leader Landing first/Content first/Options] <Options>: *Cancel*

 

It looks like something is being passed out of sequence, but I'm out of ideas.

 

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

Paul_Gander
Advocate
Advocate
Accepted solution

You need to add a \ character at the end of the calculation so that AutoCAD uses the result as input for the current command.

Try this:

 

^C^Cmleaderstyle;VC_Parts;mleaderscale;'cal;getvar(dimscale);\_mleader
Message 3 of 3

awatt
Advocate
Advocate

It works.

 

Why?

The page describing special characters lists that one as a pause for user input.

About Special Control Characters

 

Thank you very much.

0 Likes