PDA

View Full Version : vla-saveas Automation Error



matt.worland
2004-08-13, 02:24 PM
Hello everyone I am having difficulties with the 5th line of code. It gives me an "Automation Error. Error saving the document"
When I look in windows explorer there is a dwl of the original file. Do I need to close the original file after saving it to a dxf? If so how.

I am trying to save the file as a dxf then back to a dwg and delete the dxf file.

(setq strDwgDoc (vla-get-activedocument (vlax-get-acad-object)))
(setq strName (vl-string-right-trim ".dwg" (vla-get-fullname strDwgDoc)))
(vla-saveas strDwgDoc strName ac2000_dxf)
(setq strName (vl-string-right-trim ".dxf" (vla-get-fullname strDwgDoc)))
(vla-saveas strDwgDoc strName ac2000_dwg)
(vl-file-delete (strcat strname ".dxf"))

Help please
Thanks
Matt

RobertB
2004-08-13, 02:56 PM
Why don't you reverse the logic? Or do you desire to continue working in the drawing?

matt.worland
2004-08-13, 03:25 PM
This file will be closed afterwards and another opened. Not sure how else to reverse the logic though.
Thanks,
Matt

RobertB
2004-08-13, 05:44 PM
Oh, I see... you are saving as a dxf then that dxf back to a dwg. May I ask what the logic is to doing that?

matt.worland
2004-08-13, 05:53 PM
A member of our LUG keeps getting drawings that were opened or created in an educational version of AutoCAD. (not exactly sure how he gets the educational plot stamp) Now when he plots a file in the full version of AutoCAD 2000 he gets the educational plot stamp. He said that if he does a saveas as dxf then back to a dwg the plot stamp is eliminated. I was trying to write a batch processing lisp that will help automate this to make sure that none of the files he currently has contain this plot stamp. I have never seen this problem before so Im kinda going by what he said will work. Any other suggestions.

Matt

Mike.Perry
2004-08-14, 12:34 PM
Hi

You may find the following thread of some use (talks a little about the "Educational Plot Stamp") -

Educational stamp issues (http://forums.augi.com/showthread.php?t=6708&highlight=educational+stamp)

Have a good one, Mike

matt.worland
2004-08-16, 01:11 PM
Thanks Mike