.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use CloseAndSave in 2013?

3 REPLIES 3
Reply
Message 1 of 4
classof
465 Views, 3 Replies

How to use CloseAndSave in 2013?

hi ..

 

Imports Autodesk.AutoCAD.Runtime

Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.EditorInput

Public Class DocumentTest

    <CommandMethod("CD")> _    

       Public Sub Main()

        Dim dm As DocumentCollection = Application.DocumentManager     

        Dim ActiveDoc As Document = dm.MdiActiveDocument

        For Each doc As Document In dm

            If doc <> ActiveDoc Then           

              DocumentExtension.CloseAndDiscard(doc)          

           Else       

           DocumentExtension.CloseAndSave(doc, "C:\DocumentTest.dwg")     ' ERROR 

       End If   

      Next

    End Sub

End Class

 

please help me~~

3 REPLIES 3
Message 2 of 4
Alfred.NESWADBA
in reply to: classof

Hi,

 

have you searched/found >>>this thread<<< 😉

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 4
_gile
in reply to: classof

Hi,

 

The DocumentExtension class provides extension methods.

You can have a look to these threads to know a little more about this:

http://msdn.microsoft.com/en-us/library/bb383977%28v=vs.100%29.aspx

http://msdn.microsoft.com/en-us/library/bb384936.aspx



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 4 of 4
classof
in reply to: Alfred.NESWADBA

 Thanks for your reply. 

I just want to know that “DocumentExtension.CloseAndSave(doc, “C:\DocumentTest.dwg”) is correct code. 

And if correct, why the error has occurred?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost