Jump to content

Script with batch


Balthor

Recommended Posts

Hi,

 

I'm trying to run the same script in many files.

 

I can do it with a batch BUT it is necessary to close the Autocad before opening the next file.

 

Is there a way to just close the drawing, leaving the AutoCad open, and open the next drawing and running the script?

 

Thanks in advance

Link to comment
Share on other sites

post what you are running and somebody will examine it for you.

 

all my batch scripts open a drawing, run the commands and QSAVE the drawing making it ready for opening the next drawing

 

or I open a drawing and run the script.

Link to comment
Share on other sites

FOR %%f in (c:\CAD_scripts\change_frame\dwg\*.dwg) do START /WAIT C:\"Program Files"\"Autodesk"\"AutoCAD LT 2013"\acad.exe /nologo /b "c:\CAD_scripts\change_frame\moldura.scr" %%f

 

 

This is my batch, it open Autocad, run script ( that closes Autocad) and repeat....

 

If I don't close the Autocad, the batch wont work

Link to comment
Share on other sites

Something like this open autocad then script only 1 session of autocad you can open and close drawings as many times as you like.

 

Open dwg1 (load "lisp or script")

Open dwg2 (load "lisp or script")

 

What does moldura.scr do this will have an effect on the script continuing can you post.

Link to comment
Share on other sites

The moldura.scr it's a script that uses attedit to change some block attributes, nothing complex.

 

Open dwg1 (load "lisp or script")

Open dwg2 (load "lisp or script")

 

How would you do that in a batch?

 

Is it possible to use Lisp to do the same thing ( open a file, run a script, close it, open another file and repeat)?

Link to comment
Share on other sites

If you really have LT, LISP won't help you.

 

I used to use DOS & EXCEL to create my scripts which would end up looking something like this...

open
"p:P4GB003432-00-SK-0001-01.dwg"
plot
....(lots of commands)
open
y
"p:P4GB003432-00-SK-0001-02.dwg"
plot
....(lots of commands)
open
y
"p:P4GB003432-00-SK-0001-03.dwg"
plot
....(lots of commands)
qnew
y

so that the script contained all the commands I needed to (in this case) plot a batch of files.

 

Do a search on Lee Mac's site. I am sure he has a batch builder routine which I think might run on LT.

Link to comment
Share on other sites

Sorry missed the LT I would second Dbroada use excel to make a list go to start CMD old DOS command screen appears taking Dbroada example above

p:

cd \mydesign\project52

dir *.dwg >dwglst.txt /b ............ this make a list of your dwgs open in excel

 

Another way is to use WORD you can find the end of line using search replace you can add stuff at start or end of lines the end of line is ^p

 

dwg1

dwg2

dwg3

 

do replace ^p with open ^p

you now have

open dwg1

open dwg2

Link to comment
Share on other sites

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...