.NET

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

How to use CloseAndSave in 2013?

247 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: 9,250
Registered: ‎06-29-2007
Message 2 of 4 (219 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,106
Registered: ‎04-29-2006
Message 3 of 4 (208 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 (155 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?

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

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