PDA

View Full Version : create folders - then rename + repath files



pixel8er
2010-10-23, 02:11 AM
Hi all

I was wondering how to create a set of folders based on my template folder structure, rename the drawing files to include the project number and repath them - ideally with a script as I can understand them!

For example:

_I have a master template folder structure which is pre-populated with empty template drawing files. The drawing files are contained in folders called 'Work' and 'Sheet'.

_'Work' folder containing drawing files named XXXXX_TEXT.dwg, XXXXX_HATCH.dwg, etc

_'Sheet' folder with drawing files named XXXXX_L001.dwg, XXXXX_L002.dwg, etc

_The drawing files in the 'Work' folder are xref'd into the drawing files in the 'Sheet' folder as overlay with relative paths

I want to:

1. deploy a copy of the master template folder structure to a specific location on the network
2. rename the root folder from 'Template_MasterFolderStructure' to '12345_ProjectName' or whatever the new project number and name is
3. rename the files in both 'Work' and 'Sheet' folders to replace XXXXX with the project number ie 12345
4. repath the xrefs accordingly

I'm not sure if this is even possible with a script. I appreciate any pointers.

Thank you

Paul

pixel8er
2010-10-24, 03:33 AM
Another piece of info - this is not for a one-off scenario. This is for use every time I need to create a new project folder

1. deploy a copy of the master template folder structure to a specific location on the network
I have got this to work using the xcopy command but what I want is to have a GUI prompt for the destination folder rather than having to edit the syntax of the xcopy routine every time I deploy a new project.

2. rename the root folder from 'Template_MasterFolderStructure' to '12345_ProjectName' or whatever the new project number and name is
I want this to happen via the GUI too

3. rename the files in both 'Work' and 'Sheet' folders to replace XXXXX with the project number ie 12345
I want this to happen via the GUI too

4. repath the xrefs accordingly
not sure how to do this yet - ideally as part of the GUI

RobertB
2010-10-28, 05:38 PM
When you say "script" are you thinking a SCR file? If so, it isn't going to happen.

It's possible with Visual LISP or .NET but it won't be trivial. It's probably a couple of hours of programming at least.

pixel8er
2010-10-29, 03:09 PM
Hi RobertB

Yes SCR file. Only because I don't know lisp or VBA....yet! So starting as a script to get the first part correct and test was easier for me as a script.

mmm..maybe I've bitten off more than I should. Will do some more thinking and research on Lisp and VBA

Regards
Paul

cadtag
2010-11-01, 08:53 PM
or heck, a batch file would do it. with a parameter for the new portion of the name

probably simpler than LISP, and a lot easier to get into than dotnet