Apply script to multiple drawings

Apply script to multiple drawings

Anonymous
Not applicable
16,084 Views
7 Replies
Message 1 of 8

Apply script to multiple drawings

Anonymous
Not applicable

Hell all,

I am just learning how to write scripts, and so far feel pretty comfortable with writing them.

The only thing I cant figure out is to write it to open multiple drawings and apply that script to it.

I do not have Script PRo and probably wont be able to get it due to work restrictions (I cant download anything because you need administrators rights).

I have looked at other peoples questions on how to do this, but have not had any luck.

Can someone please assist me on this?

 

Thanks in advance!

knj777

 

0 Likes
Accepted solutions (1)
16,085 Views
7 Replies
Replies (7)
Message 2 of 8

hmsilva
Mentor
Mentor

Hi knj777,

 

to run a script in mutiple dwgs, without Script PRo or other,

 

you'll have to hardcoded in the script file the dwg path, open, comands, close, open the next one, commands,...

 

Or if you are using AC2013+, you may use the AutoCAD Core Console.

To run a script in mutiple dwgs with ACCConsole, you'll have to create a batch file to start the console, open the dwg, run the .scr file.

>> link to a good explanation <<

 

Hope this helps,
Henrique

 

EESignature

Message 3 of 8

Anonymous
Not applicable

Thanks for you answers. I forgot to mention that there are about 200 drawings and I really would not like to type all of that in, due to the naming convention of the drawings.

0 Likes
Message 4 of 8

hmsilva
Mentor
Mentor
You're welcome, knj777

Did you read about the AutoCAD Core Console, in my post?

Henrique

EESignature

Message 5 of 8

3wood
Advisor
Advisor
Accepted solution

Lee Mac's Scriptwriter is a very good one to apply your script to multiple files.

The only problem I found is if the drawing name contains special unicode characters such as ø, it will stops.

 

Message 6 of 8

Anonymous
Not applicable

Thank you very much for Lee Mac's Scriptwriter . It works fine. It only stopped on AutoCAD recover files. I ran on more than 2000 files. After I deleted all recover files, it worked great.

Regards,

 

Mian

0 Likes
Message 7 of 8

cadffm
Consultant
Consultant

Hi @Anonymous,

can you replicate such a situation (problem with recover files by using the linked program)?

If so and your RECOVERAUTO is set to 0 (this is default), set it to 1 and do the test again.

Is it now working also with files which have to recover?

 

In may/june 2010 when the wscript was written, the AutoCAD Version 2011 was brand new and perhaps @Lee_Mac didn't know about the new

recover system variable, which has since Version 2013 one valid value more .

Even though recoverauto should not solve your described problem, consideration in batch processes usually makes sense.

Sebastian

0 Likes
Message 8 of 8

Anonymous
Not applicable

That works great! Thanks Leemac for this!

The only thing you need to pay attention to is that all the commands need to be in the same line otherwise it will not work. you can put the comment in the hyphen ; too.  Example: ;this program is bla bla..

0 Likes