PDA

View Full Version : Batch file for changing file name



XCrossWindsX
28th Dec 2011, 02:47 pm
Hello,

Autocad 2011. The company I am working for is changing its data base to a new format. The new format limits the file name length. I have dozens of dies containing a 1000 files each which are going to need to be renamed and replotted.

I have a batch file for renaming the system file names. I have a batch plot program for plotting the drawings after they have been renamed but i need a batch program for renaming the files.

The files are numbered for example 11-3333333-202222 on the drawings and I need to reduce the file's name size on all prints by (1) charachter. I found I can remove the 13th character in all the file names (as shown with the bolded 0) and will fix the problem.

Is there a way to create a batch file that will open a group of drawings. Edit the Titleblock (AMPFORMAT), change the TAGS (T4 & T42) which are the file names by deleting the 13th character in each name.

A batch program that can be modified to do it? A program I can purchase that will give me the capabilities?

Thanks

BIGAL
29th Dec 2011, 02:34 am
I think what you want is a script, same as a batch but runs within Autocad theres lots of change attribute stuff here using tag name etc just search.

Heres a script example


open dwg1 (load "changetags") close Y
open dwg2 (load "changetags") close Y
open dwg3 (load "changetags") close Y


Just post again if stuck

ps use your batch rename files as a start just rename to .scr then use normal search replace or paste into excel and use copy to create extra stuff per line concactenante for new column then paste back into a scr file via notepad

Organic
29th Dec 2011, 02:41 am
I'd tell the company it is not realistically possible to go back and rename/reprint all old jobs and will take you X hours to do and thus cost the company $Y.

BIGAL
29th Dec 2011, 02:50 am
Dink The changing attributes is the easy bit if you know how but I would agree reprinting all drawings how many trees do you need to cut down to make paper, if a copy is required we are in the paperless world now (haha) as part of process create PDF's for record and print as required.

As for the time run over night no real cost.

Xwinds post a dwg with the title block mark the changes required.

BIGAL
29th Dec 2011, 02:57 am
This post probably has all the answers it was just a click away.

http://www.cadtutor.net/forum/showthread.php?63660-Title-Block-Attribute-Script

XCrossWindsX
1st Jan 2012, 08:07 am
Thanks. I will give this all a look through on Monday when I return to work.

Unfortunately, corporate has put together a (super) team thats in charge and making all the decisions for the company worldwide on this changeover of the database. You know how that goes. :)