Purpose of the pause in commands?

Purpose of the pause in commands?

Anonymous
Not applicable
1,208 Views
7 Replies
Message 1 of 8

Purpose of the pause in commands?

Anonymous
Not applicable

So in the past i've asked for help here on specific code and the problems that ive had usually involved improper syntax, most commonly lacking one or more pauses in a command line. i.e. something like this.

 

(command "._offset" (getreal "\nEnter Wall Thickness: ") (entlast) pause "")

What is the purpose of the pause? How do I know if I need it? How do I know how many I need?

Thanks

Garrett

0 Likes
1,209 Views
7 Replies
Replies (7)
Message 2 of 8

dbroad
Mentor
Mentor

It allows the programmer to allow the user to enter information requested by the command. IOW, it waits and receives input.

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

ВeekeeCZ
Consultant
Consultant

It pause the program for user input such as number input, entity selection...
Try the OFFSET command and see what are you asked for.

 

Your program could be also rewritten using PAUSE 3 times:

 

(command
"offset"
PAUSE ; for enter wall thickness
PAUSE ; for entity pick
PAUSE ; for side pick
"" ; enter to end the command
)

Message 4 of 8

Anonymous
Not applicable

So basically using Pause makes the command go through its base progression, whereas if i took out the pause I could put in my own input line

0 Likes
Message 5 of 8

Ranjit_Singh
Advisor
Advisor

Read some more info on PAUSE in AutoCAD help here.

0 Likes
Message 6 of 8

ВeekeeCZ
Consultant
Consultant

Yes. It's the purpose of the whole thing to minimize the user input. But something is the problem to know how many PAUSE you need, because it could be different (you can select one entity, or then... using window selection or click one by one).. then you can use this approach:

 

(command "offset")
(while (> (getvar 'cmdactive) 0)

(command PAUSE))

 

...which will fill up the command with PAUSE while the command is active.

0 Likes
Message 7 of 8

dmfrazier
Advisor
Advisor

The command goes thru its "base progression" either way.  It's just a way to give the user the opportunity to respond to the normal command prompt(s), as opposed to providing the input programmatically.  Which way you go is entirely based on how you want your program to work.

0 Likes
Message 8 of 8

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

....

 

(command "._offset" (getreal "\nEnter Wall Thickness: ") (entlast) pause "")

What is the purpose of the pause? How do I know if I need it? How do I know how many I need?

 

....

In this case, it's to pick to which side you want the last object Offset.  And then it builds in the Enter [""] to end  the Offset command, because without that it will prompt you to pick another object to Offset, which presumably you don't need if this is designed to always use on the last thing [presumably Line] you drew.  It saves you the trouble of ending the command yourself, in a routine designed for only a single Offset operation.

 

You could  omit the pause and  the "", and if this is the last thing in the routine, it would just leave you in the command, at the which-side prompt, but then after you picked a side, you'd still have to tell it you're done with another Enter, manually.

Kent Cooper, AIA
0 Likes