.NET

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

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

353 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,099
Registered: ‎06-29-2007
Message 2 of 5 (230 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 (228 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 (219 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 (168 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)

 

Need installation help?

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