.NET

Reply
Valued Contributor
yaqiz
Posts: 86
Registered: ‎07-14-2010
Message 1 of 5 (347 Views)
Accepted Solution

Why my document object haven't got CloseAndDiscard or CloseAndSave methods

347 Views, 4 Replies
12-04-2013 07:01 AM

Hi All,

 

I use AutoCAD 2014, VB.net 2010. I can't see  CloseAndDiscard or CloseAndSave methods under my document object. I would like to close a drawing. What can I do?

 

Thanks 

 

Regards

Add

 

Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension

 

Below is the code to save or close drawing in ACAD 2014

 

Dim doc As Document = Application.DocumentManager.MdiActiveDocument 
CloseAndDiscard(doc) CloseAndSave(doc, doc.Name)

 

*Expert Elite*
Alfred.NESWADBA
Posts: 9,061
Registered: ‎06-29-2007
Message 2 of 5 (224 Views)

Re: Why my document object haven't got CloseAndDiscard or CloseAndSave methods

12-04-2013 09:12 AM in reply to: yaqiz

Hi,

 

have you referenced the AcCoreMgd.dll?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Valued Contributor
yaqiz
Posts: 86
Registered: ‎07-14-2010
Message 3 of 5 (222 Views)

Re: Why my document object haven't got CloseAndDiscard or CloseAndSave methods

12-04-2013 09:21 AM in reply to: Alfred.NESWADBA
Yes.I did I also import
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.ApplicationServices
Imports acApp = Autodesk.AutoCAD.ApplicationServices.Application
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Imports Autodesk.AutoCAD.Geometry

Valued Mentor
jeff
Posts: 330
Registered: ‎05-12-2009
Message 4 of 5 (213 Views)

Re: Why my document object haven't got CloseAndDiscard or CloseAndSave methods

12-04-2013 10:41 AM in reply to: yaqiz

Add

 

Imports Autodesk.AutoCAD.ApplicationServices.DocumentExtension

 

You can also find your answers @ TheSwamp
Mentor
mzakiralam
Posts: 231
Registered: ‎11-09-2012
Message 5 of 5 (162 Views)

Re: Why my document object haven't got CloseAndDiscard or CloseAndSave methods

12-07-2013 10:17 AM in reply to: yaqiz

Below is the code to save or close drawing in ACAD 2014

 

Dim doc As Document = Application.DocumentManager.MdiActiveDocument 
CloseAndDiscard(doc) CloseAndSave(doc, doc.Name)

 

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.