Jump to content

Recommended Posts

Posted

I'm trying to create a batch for processing multiple files. But autocad won't run a script file on startup.

FOR %%f in ("C:\batchtest\*GAZ*.dwg") DO START /WAIT "C:\Program Files\Autodesk Map 3D 2007\acad.exe" %%f /b C:\batchtest\script.scr

 

These are the contents of the batch file. It opens the drawings but does nothing after. If I start the script with the script command it works.

Posted

So you set it up such that the batch file opens all the drawings first?

Posted
So you set it up such that the batch file opens all the drawings first?

 

No it should go through the drawings one by one.

 

That part is ok, it works. But the script is not executed.

Posted

Would you care to post the script that isn't working?

Posted
Would you care to post the script that isn't working?

 

If I load the script manually it runs ok. So that's not the problem.

 

its only 3 lines

 

buff - custom command, loaded from lisp

qsave

quit

Posted

It looks like this will start AutoCAD for each drawing found, wait for it to quit, then start another instance. That might be OK for a small number of drawings but you might consider creating your script to run inside the first instance and process your drawings.

 

Your script would be generated with a batch file and look like this:

 

TestScript.scr:

 

open

drawing1

buff

qsave

close

open

drawing2

buff

qsave

close

open

drawing3

buff

qsave

close

.

.

.

.

Posted

also include the command line switch and script name in the first set of parentheses.

 

"C:\Program Files\Autodesk Map 3D 2007\acad.exe /b C:\batchtest\script.scr"

Posted
also include the command line switch and script name in the first set of parentheses.

 

"C:\Program Files\Autodesk Map 3D 2007\acad.exe /b C:\batchtest\script.scr"

 

If I put it like this it won't even start autocad, all I get is an empty dos command line box.

Posted
I'm trying to create a batch for processing multiple files. But autocad won't run a script file on startup.

FOR %%f in ("C:\batchtest\*GAZ*.dwg") DO START /WAIT "C:\Program Files\Autodesk Map 3D 2007\acad.exe" %%f /b C:\batchtest\script.scr

 

These are the contents of the batch file. It opens the drawings but does nothing after. If I start the script with the script command it works.

 

Look... I am attaching 5 files, one of them is the batch lisp... it will allow you to open and close a entire directory of files and apply a variable (if you wish so) At this moment the only variable added will be mirrtext=0, but you can add more or place a ";" if you don´t want any variable added to your drawings to be batch processed..

 

And the other lisp "pdf.lsp" is the lisp you want to batch use... there is another small lisp that must be automatically loaded when autocad starts.. this lisp will load the script everytime you get into a drawing.. and (the batch.lsp will help you to open and save multiple drawings only)

 

If you want me to configure them all in your autocad so you just replace them in your hard disk to work.. send me your lisp, tell me what autocad version you´re using or send me your acad2005doc.lsp or acad2006doc.lsp or acad2008.lsp or depending on your autocad version..

 

then I will just need your lisp to apply, your acad"version"doc.lsp and that's all, I'll send you the files configured to run the script at startup, and the batch to apply your lisp to an entire directory... I use it this way and I can create thousands of pdf files by just using this batch and the script. (the only problem is that some drawing may require you to accept something before opening and then you must click to keep the batch going on.. )

 

If you know how to load a lisp automatically everytime you open a drawing... then you just need to follow the sequence in attached files and replace names with your own files and names.. and it should work as you need. Works for me.

Let me know if you want my help.

batch and script at startup.zip

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...