.NET

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

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

324 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

*Expert Elite*
Alfred.NESWADBA
Posts: 8,867
Registered: ‎06-29-2007
Message 2 of 5 (201 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 (199 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: 321
Registered: ‎05-12-2009
Message 4 of 5 (190 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: 225
Registered: ‎11-09-2012
Message 5 of 5 (139 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)

 

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