PDA

View Full Version : SaveAs New Name



chomuth
17th Feb 2010, 03:53 pm
Thanks in Advance I am New to this forum

I need to save a file with the same name but add something like Plot_ at the beginning of the name also saved in an older version

Problem: To view certain elements in AutoCad 2010 that were creaed in Civil3d 2010, I had to save the file in an older version of Autocad. I saved it as AutoCad 2000 it seemed to work.

So if the design Engineer can save thier drawing and also at the same time save a copy with the same name but have Plot in front of the DWGNAME

This below works but saved file is Hard Coded in it.

(vl-load-COM)
(vla-SaveAs (vla-get-ActiveDocument(vlax-get-acad-object)) "test1.dwg" ac2000_dwg)

Correct me if I am wrong. DONT ANYONE LAUGH (Outloud that is:)
I need to get the DWGNAME
Maybe through getvar
(setq name (getvar "DWGNAME"))
(setq plot "plot_")
strcat these together some how
and place in this code
(vl-load-COM)
(vla-SaveAs (vla-get-ActiveDocument(vlax-get-acad-object)) "test1.dwg" ac2000_dwg)

Does anyone have a complete answer?
Thanks Again
A Newb to Lisp

Lee Mac
17th Feb 2010, 03:55 pm
You pretty much had it, nice one:



(vl-load-COM)
(vla-SaveAs (vla-get-ActiveDocument
(vlax-get-acad-object))

(strcat (getvar "DWGPREFIX") "plot_" (getvar "DWGNAME"))

ac2000_dwg)

chomuth
17th Feb 2010, 05:58 pm
That is Perfect.

chomuth
17th Feb 2010, 05:59 pm
Thank You so much

Lee Mac
17th Feb 2010, 06:14 pm
Thank You so much

No worries, you did most of it :)