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
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