Save as multiple files

Save as multiple files

Anonymous
Not applicable
2,525 Views
6 Replies
Message 1 of 7

Save as multiple files

Anonymous
Not applicable

Hi there,

 

I have a template dawg file which I need to save as different files with different file names. Is there a way to open my template dwg file and perform a Save as multiple times? I do not mind if it is has an incremental number, if I could automate this also it would be perfect, I am trying at least to automate the Save as process...

 

Thanks in advance

0 Likes
Accepted solutions (1)
2,526 Views
6 Replies
Replies (6)
Message 2 of 7

pendean
Community Legend
Community Legend

You'd want to use SAVE command in full AutoCAD, not SAVEAS (and not QSAVE): look up usage in HELP to see what it does, its a great tool. Can you post examples of the other destinations please, and confirm these will never change (or is this something that always changes)?

 

0 Likes
Message 3 of 7

Anonymous
Not applicable

Hi and thank you for the quick response. I have a template schematic file which is empty but I need to replicate the file with different file names so that the technicians can start drawing the various schematics. I would like to be able to save multiple times the same file under different file names without performing every time a Save As... all in the same folder location

0 Likes
Message 4 of 7

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

.... I would like to be able to save multiple times the same file under different file names without performing every time a Save As... all in the same folder location


As @pendean said, use SAVE, not SAVEAS.  SAVEAS takes you into the drawing it creates, whereas SAVE makes a new drawing but leaves you in the one you did it from.  And don't use ribbon or pull-down so-called "Save" items or icons, which actually get you the QSAVE command, the same as Ctrl+S.  You will need to type in SAVE to use it manually, or an AutoLisp routine would not be difficult to come up with, incrementing file names somehow.  It would not be able to start in one drawing and continue in another, which is one reason why SAVE is preferable to SAVEAS.  If you are looking to automate the process, would you want to be asked how many copies to make?  Should it increment a simple number as suffix to the file name, or some other differentiation?  Should it put them all in the same folder as the current drawing, or would that be a shared location but you would want them made in something like a job-specific folder?

Kent Cooper, AIA
0 Likes
Message 5 of 7

Anonymous
Not applicable

Thank you both for your answers, I would look into a routine that would locally Save incrementally my file in a specific folder X number of times...

 

I will start by the save command as per your suggestions. I do not have autolisp experience to do such thing but definitely will put it in my to-do list as it is a way to automate a process much needed within my organisation

0 Likes
Message 6 of 7

Sea-Haven
Mentor
Mentor

A script may be a simple alternative to a lisp, it is basically a text file that just tells Autocad what to do and can be repeated. A simple method is to use excel to create it, so can have path in 1 column, file name in next, number in next, then use concatenate to join it all up. Now the nice thing copy the column direct to Autocad and it will run.

 

 

 

filedia 0
save d:\\acadtemp\\dwgtest.dwg
save d:\\acadtemp\\dwgtest1.dwg
save d:\\acadtemp\\dwgtest2.dwg
filedia 1

 

 

 screenshot340.png

screenshot341.png

 

If your path has spaces you need to make sure path is contained in "  "

0 Likes
Message 7 of 7

pbejse
Mentor
Mentor

@Anonymous wrote:

Hi there,

 

I have a template dawg file which I need to save as different files with different file names. Is there a way to open my template dwg file and perform a Save as multiple times? I do not mind if it is has an incremental number, if I could automate this also it would be perfect, I am trying at least to automate the Save as process...

 

Thanks in advance


Besides using "save" as the accepted solution, one can also create a copy of a file without opening  the tempalte drawing. 

 

(defun c:demo ( / theTemplate filenames quantity location)
  (setq theTemplate (findfile "c:\\temp\\TheTemplate.dwt"))

  (if
    (and
      theTemplate
      (setq filenames (getstring T (strcat  "\nEnter file name <"
					 (setq fn (vl-filename-base theTemplate)) ">: ")))
      (setq filenames (if (eq "" filenames) fn filenames ))
      (setq quantity (getint "\nHow many copies: "))
      (setq location (acet-ui-pickdir "\nSelect project folder"))
      )
    (progn
     (repeat quantity
       (Vl-file-copy theTemplate  (strcat location "\\" filenames " " (itoa quantity) ".dwg"))
	 (setq quantity (1- quantity)))
     (startapp "explorer" location)
     )
    )(princ)
  )

The name of the template or you can even be prompted for a template file

The number of files to save [ quantity ] or you can always keep that as a constant value

 

You can even use as many templates as you want

(foreach itm  '(
		("Survey.dwg" "D:\\TemplateLocation\\TML\\Survey.dwt")
		("PBase.dwg" "D:\\TemplateLocation\\TML\\PBase.dwt")
		("Existing Legend.dwg" "D:\\TemplateLocation\\TML\\Existing Legend.dwt")
		("Border.dwg" "D:\\TemplateLocation\\TML\\Border.dwt")
		("Pipes.dwg" "D:\\TemplateLocation\\TML\\Pipes Template.dwg")
			      )

Target name

Template name

 

HTH

 

0 Likes