@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