Script to save my drawing in a different folder

Script to save my drawing in a different folder

acad
Explorer Explorer
1,239 Views
2 Replies
Message 1 of 3

Script to save my drawing in a different folder

acad
Explorer
Explorer

Good afternoon! 

 

For my work I have to edit a lot of .dxf drawings and save them to a different location, as .dwg (2013) file. 

However! 

My .dxf files are all named 001, 002, 003 etc. 

I would like to rename them to:

20190619 001

20190619 002

20190619 003

etc. 

 

I have written the following script: 

(COMMAND "_SAVEAS" "2013" (STRCAT "R:/Projects/217/rev A/DWG/" (vl-filename-base (GETVAR 'DWGNAME))))

This will save my files as .dwg (2013) in the correct folder, but with the same file name I started with. 

 

The file name I get:

001

 

The file name I want: 

20190619 001

 

I have tried google, tried adding getvar 'dwgprefix but I am not sure how and where I have to place this in my script. Nothing seems to work. 

 

I hope someone can help me! Thanks in advance! 

0 Likes
Accepted solutions (1)
1,240 Views
2 Replies
Replies (2)
Message 2 of 3

doglips
Advocate
Advocate
Accepted solution

Maybe something like:

(COMMAND "_SAVEAS" "2013" (STRCAT "R:/Projects/217/rev A/DWG/" "20190619 " (vl-filename-base (GETVAR 'DWGNAME))))

0 Likes
Message 3 of 3

acad
Explorer
Explorer

It worked, thanks!

0 Likes