How you close a AutoCAD single drawing in vb.net?
I would like to keep the AutoCAD editor open but remove the drawing from AutoCAD
Thank you,
I am using VS 2010 with AutoCAD 2013.
Is it possable to close (Save and close) a drawing using VB.net code???
I have spent all week searching the net on this and I have come up with nothing that works.
I have look at CloseAndDiscard or CloseAndSave methods but I can find any good code examples using these methods.
Thank you,
This example took about 2 minutes to find using google. Its in C# which most code for AutoCAD .NET is in. You can easily convert it to VB.NET using one of the readily available online converters.
http://through-the-interface.typepad.com/through_the_interface/2007/03/closing_all_ope.html
Hi,
Below code will be helpful to close all the drawing in AutocAD 2013 -2014
Public Shared Sub CloseAllOpenDrawing() 'close all opened drawing Dim docs As DocumentCollection = Application.DocumentManager For Each doc As Document In docs doc = Application.DocumentManager.MdiActiveDocument 'get dwgtitled variable Dim obj As Object = Application.GetSystemVariable("DWGTITLED") 'get DBMOD variable Dim isMod As Integer = System.Convert.ToInt32(Application.GetSystemVariable("DBMOD")) If doc.IsReadOnly Then DocumentExtension.CloseAndDiscard(doc) ElseIf System.Convert.ToInt16(obj) = 0 Then DocumentExtension.CloseAndDiscard(doc) Else If isMod = 0 Then DocumentExtension.CloseAndDiscard(doc) ElseIf isMod <> 0 Then DocumentExtension.CloseAndSave(doc, doc.Name) End If End If Next End Sub