Answer command prompts in macro

Answer command prompts in macro

snappyjazz
Collaborator Collaborator
1,110 Views
3 Replies
Message 1 of 4

Answer command prompts in macro

snappyjazz
Collaborator
Collaborator

Hello,

It's been years since I have customized AutoCAD, but I remember writing CUI command macros as being pretty simple. My struggle is really simple, but I don't remember how to answer the command prompts after calling a command. I thought it was just a matter of putting spaces or semicolons after the command call to do this. Please help refresh my memory, and sorry for the rudimentary question! My macro is as follows:

^C^C-insert;(findfile "filename.dwg")  ;;  ;;  ;;

 

snappyjazz_1-1654785272165.png

 

I've tried putting an amalgam of spaces and semicolons after the command, but nothing will answer the scale and rotation prompts.

 

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

Kent1Cooper
Consultant
Consultant
Accepted solution

You need to give it an insertion point before it asks the scale and rotation questions.  A backslash is to pause for User input such as that.  After that, a single semicolon is Enter for accepting each of the defaults for those, with no spaces between.  Something like this [untested]?

  ^C^C-insert;(findfile "filename.dwg");\;;;

I'm not positive the Enter ; between the (findfile) function and the \ is needed, as it would be at the end of a spelled-out Block name -- the end of the function itself may complete the supplying of the name, without that.  If the above doesn't work, try it without that one semicolon.

 

This all assumes inserting something that you know exists, is in a support file search path location, is not defined for uniform scaling, and is without Attributes.

Kent Cooper, AIA
Message 3 of 4

tramber
Advisor
Advisor
Accepted solution

Generaly:

-insert "blockname or file as you did" 111,2132 1 1 0

But you can also use \ as a pause.

ie :

^C^C_-insert "blockname";\1;1;0

or

^C^C_-insert "blockname";\\\\

 

There was a prompt not to forget that you forgot ! The specification of the insertion point. It needs a pause or a coordinate


EESignature

Message 4 of 4

snappyjazz
Collaborator
Collaborator

@Kent1Cooper 

@tramber 

I knew it was simple! This is a homer simpson forehead slap "DOH" moment. Thank you!

 

0 Likes