.NET

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

How to use CloseAndSave in 2013?

231 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,867
Registered: ‎06-29-2007
Message 2 of 4 (203 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,071
Registered: ‎04-29-2006
Message 3 of 4 (192 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 (139 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?

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community