I can't find a keystroke or combination of keystrokes that will issue the "escape" command in a script file without ending the script. In other words, I want a line in the script which will issue the "escape" command and then go to the next line of the script and continue on. I never learned Lisp and don't have time to learn it for this exercise.
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
In a macro, you can use ^C or ^C^C to act as escape, I'm not sure whether the same would work in a script however.
I can't see why you would need to issue an Escape though? Surely there is a better way to accomplish your task.
If you are using LT (I.E.: no LISP support), Then
You may be out of luck.
Else
Use an IF statement.
End If
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.
@Anonymous wrote:I can't find a keystroke or combination of keystrokes that will issue the "escape" command in a script file without ending the script. ....
Neither can I, nor can I find anything in Help about it. ^C [which works in macros as Lee mentioned] doesn't work in Scripts, and (command) with no arguments [which works in Lisp] stops the entire Script. Various things involving nil and such get invalidity error messages.
One thing that you might be able to use, depending on the particular circumstances, is to do something [anything] to "finish" whatever command you're in, and then put in a U to Undo it.
However, I agree that there may be a better way to accomplish whatever you're trying to do than something that requires cancelling.
Try this technique.
To cause an interrupt in the script, do:
(command)
And, to get it going again, at the top of your script, add:
(defun C:N ()
(command "_resume")
)
Then, after your interrupt, just type in N to resume.
Good luck.
EC-CAD
Thanks to all for the suggestions. Here's the solution that accomplishes my task:
By setting ATTREQ to "0", I can then redefine a block using the block=redefined block method of block insertion, placing the block at 0,0 (instead of needing to "escape"), invoke ATTSYNC to fix all the existing copies of the block, then erase the block at 0,0 by choosing "L" (last). This way I can redefine multiple blocks in one script file without interruption. Of course, running that script as a batch file fixes all the drawings in a project without needing my intervention.
@Anonymous wrote:.... using the block=redefined block method of block insertion, placing the block at 0,0 (instead of needing to "escape"), invoke ATTSYNC ..., then erase the block at 0,0 by choosing "L" (last). ....
A small suggestion: The Last option in selection within an editing command finds the last object visible within the screen display area. That may or may not be the last object added to the drawing. If you're zoomed in or panned over to where a Block inserted at 0,0 isn't visible on the screen, then it will erase something else.
Maybe that's not an issue, if you always do this zoomed out to the drawing limits or something. But if it's a possibility, I suggest using (getvar 'viewctr) as the insertion point. That will always put it in the middle of the screen, so it will always be there on-screen to be selected for erasure. [That's assuming the Block's content has a reasonable positional relationship to its insertion point, and the zoom level isn't too extremely far in for a Block that has no actual drawn content at its insertion point].
Or, instead of using Erase Last, use (entdel (entlast)), which will remove the last thing in the drawing, whether or not it's visible or even in the current space. [That's assuming that Attsync doesn't change the draw order somehow -- I haven't experimented with that.]
Aaah, so the (command) itself is the solution!
I tried to click on it because I thought there was a link to another forum thread! When I found it apparently broken, I kept searching for the other thread. The funny thing is I did find somewhere else saying (command) to be typed in the script! 😄
Can't find what you're looking for? Ask the community or share your knowledge.