.NET

Reply
Contributor
classof
Posts: 14
Registered: ‎06-26-2010
Message 1 of 4 (239 Views)

How to use CloseAndSave in 2013?

239 Views, 3 Replies
04-06-2013 03:28 AM

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

*Expert Elite*
Alfred.NESWADBA
Posts: 8,982
Registered: ‎06-29-2007
Message 2 of 4 (211 Views)

Re: How to use CloseAndSave in 2013?

04-06-2013 11:03 AM in reply to: classof

Hi,

 

have you searched/found >>>this thread<<< :smileywink:

 

HTH, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
*Expert Elite*
_gile
Posts: 2,084
Registered: ‎04-29-2006
Message 3 of 4 (200 Views)

Re : How to use CloseAndSave in 2013?

04-06-2013 04:08 PM 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
Contributor
classof
Posts: 14
Registered: ‎06-26-2010
Message 4 of 4 (147 Views)

Re: How to use CloseAndSave in 2013?

04-10-2013 08:56 AM 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?

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.