Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Mentor
2,342 Posts
9 Kudos
Registered: ‎11-18-2003
Post 1 of 5

Pausing a script... Used to be that....

304 Views, 4 Replies
04-25-2013 08:42 AM

I been using AutoCAD for quite some time now...

It Used to be, perhaps even back to release 9 dos that I would use a script to iterate through several dozen drawings. Most times I did this to simply check through the drawings to see that I made necessary edits. To do this, I simply went to a dos prompt and piped the drawing names with path info to an ASCII file. Then I'd edit the file and quickly add appropriate 'open' and 'save' commands before and after every drawing.

 

To get the script to pause which allowed me to check (and edit) I could include a semi colon ';' ... at the time, this was not a comment as it is now, but an unknown command. When autocad would through throw up an 'Unknown Command' notice and effectively pause the script... I'd make the necessary edits, then issue 'Resume' command which would run through the script where it had stopped. Now however the semi colon is a comment.

 

I did simply try just now what I knew was an unknown command... this seems to work.

 

I wonder now if there is not a better way?

Valued Contributor
54 Posts
1 Kudo
Registered: ‎02-02-2012
Post 2 of 5

Re: Pausing a script... Used to be that....

04-25-2013 10:24 AM in reply to: mdhutchinson

You would need to send a "backspace" key to make it pause.

 

WshShell.SendKeys("{BKSP}")

 Thats in VBS though so I'm not sure it will help...I'm still learning myself but if you're experianced maybe you'll know how to apply that.

Distinguished Contributor
218 Posts
2 Kudos
Registered: ‎04-01-2008
Post 3 of 5

Re: Pausing a script... Used to be that....

04-25-2013 12:46 PM in reply to: mdhutchinson

that is exactly what i have done for years too, although i use a little old visual basic script generator. i used the command "pause" which is not a command at all and a pgp shortcut for "Resume".

 

there is a great program called ScriptPro and this is exactly the feature i requested they add and they said we will look at it.  if ScriptPro encounters an error it just moves right along so its worthless for this task of reviewing drawings and making small changes.

 

the short answer is that i dont think there is a better way.

 

 

Mentor
167 Posts
43 Kudos
Registered: ‎10-06-2010
Post 4 of 5

Re: Pausing a script... Used to be that....

10-07-2013 03:45 PM in reply to: art_turner

I agree, this is a very useful feature of scripts. Two of the routines supplied with Multi-Batch are “Pause Script to Work on Drawing” and “Pause Script to Work on Drawing and Save”. We use the incorrect command -Type_Resume_to_continue- this pauses the routine and by typing Resume on the AutoCAD command line resumes the script and moves onto the next drawing.

 

Most of the time you can add more commands to the routine to prepare the drawing after opening, things like purge, change to paperspace and lock viewports then Pause the script to give the drawing a final check. Next type Resume and it will save the drawing and move onto the next drawing in the list. It is a very useful feature.

 

Patrick
http://www.multi-batch.com/

Distinguished Contributor
218 Posts
2 Kudos
Registered: ‎04-01-2008
Post 5 of 5

Re: Pausing a script... Used to be that....

10-09-2013 09:38 AM in reply to: mdhutchinson

i will check it out. i built a zoom extents and save into my script too, so i can zoom around, stretch a dimension here or there, and just do my two letter RESUME alias to reset the view, save and bring up the next one.

 

this is the only thing preventing me from really using script-pro, missing one of the two main things i use a script generator for, the other is printing.   

 

i actually prefer a dumb little script generator that just creates a script text file parsed with all the file names i can drag and drop in drawing, over the script-pro total control method.

 

one of the things limiting script pro is that its hard to learn since it doesnt really use scripts, for instance it doesnt need open and close statements. they need more examples. its not that hard it just throws you at first since its different.

 

 

 

 

 

 

 

 

 

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!