.NET

Reply
Member
tecnotab
Posts: 3
Registered: ‎04-20-2012
Message 1 of 4 (448 Views)
Accepted Solution

SAving DWG in Autocad 2013

448 Views, 3 Replies
04-20-2012 03:40 AM

I use this code for Autocad 2010 to 2012


{code}

public void MySave()
{
Document doc = Application.....MdiActiveDocument;
object oAcadDoc = doc.AcadDocument;
oAcadDoc.GetType().InvokeMember( "Save",
BindingFlags.InvokeMethod, null, oAcadDoc, null);
}

 

But this not function in Autocad 2013.

 

Can you help me ?

This is OK Dim disegnoAcad As Object = _ Autodesk.AutoCAD.ApplicationServices.DocumentExtension.GetAcadDocument( _ Application.DocumentManager.MdiActiveDocument) disegnoAcad.GetType.InvokeMember( _ "Save", Reflection.BindingFlags.InvokeMethod, _ Nothing, disegnoAcad, Nothing _ )
*Expert Elite*
Alfred.NESWADBA
Posts: 9,573
Registered: ‎06-29-2007
Message 2 of 4 (444 Views)

Re: SAving DWG in Autocad 2013

04-20-2012 04:29 AM in reply to: tecnotab

Hi,

 

>> But this not function in Autocad 2013.

Why? What happens?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Member
tecnotab
Posts: 3
Registered: ‎04-20-2012
Message 3 of 4 (436 Views)

Re: SAving DWG in Autocad 2013

04-20-2012 05:50 AM in reply to: Alfred.NESWADBA

I convert it in :


1>            Dim disegnoAcad As Object = _
2>               Application.DocumentManager.MdiActiveDocument
3>
4>            disegno.GetType.InvokeMember( _
5>                    "Save", Reflection.BindingFlags.InvokeMethod, _
6>                    Nothing, disegnoAcad, Nothing _
7>                    )


But on row 7 recive error :

Metod not find

Autodesk.AutoCAD.ApplicationServices.Document.Save

 

Member
tecnotab
Posts: 3
Registered: ‎04-20-2012
Message 4 of 4 (422 Views)

Re: SAving DWG in Autocad 2013

04-20-2012 07:55 AM in reply to: tecnotab
This is OK Dim disegnoAcad As Object = _ Autodesk.AutoCAD.ApplicationServices.DocumentExtension.GetAcadDocument( _ Application.DocumentManager.MdiActiveDocument) disegnoAcad.GetType.InvokeMember( _ "Save", Reflection.BindingFlags.InvokeMethod, _ Nothing, disegnoAcad, Nothing _ )
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.