Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't create instance of AcadApplication from C#.

1 REPLY 1
Reply
Message 1 of 2
durgesh
1105 Views, 1 Reply

Can't create instance of AcadApplication from C#.

Hello Everyone,

 

I am new to programming AutoCad using .Net. I am trying to create a standalone C#/.Net Application to manipulate the dwg files.

 

While creating an instance of AcadApplication using following code, I am getting a crash which I can't comprehend completely.

 

Type acType = Type.GetTypeFromProgID("AutoCAD.Application.18.1");
AcadApplication acApp = null; acApp = (AcadApplication)Activator.CreateInstance(acType,true);

 I get the followng error message.

 

Unable to cast COM object of type 'Autodesk.AutoCAD.Interop.AcadApplicationMinorVersion1Class' to interface type 'AutoCAD.AcadApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{070AA05D-DFC1-4E64-8379-432269B48B07}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

 


Although, I can see an instance of acad.exe getting started in taskmanager, but value of acApp is still null.

 

Other informations:

Visual Studio Version : VS 2012 Express Edition

AutoCaD Version : AutoCAD 2012 x64 version

OS : Windows 7, x64 version.

 

Thanks in advance,

Durgesh

 

 

1 REPLY 1
Message 2 of 2
braudpat
in reply to: durgesh

 

Hello

 

Welcome to the Autodesk/AutoCAD Forums !

 

For your Topic (DotNET), please post in this forum :

http://forums.autodesk.com/t5/NET/bd-p/152

 

All "programming" forums are here :

http://forums.autodesk.com/t5/AutoCAD-Customization/ct-p/AutoCADTopic1

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost