System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID

System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID

kmkxperia
Advocate Advocate
879 Views
1 Reply
Message 1 of 2

System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID

kmkxperia
Advocate
Advocate

I am using VS 2022 C# and auto cad 2021 getting elo error any idea?  any what is missing any reference file or anything that needs to e set 

I have added the interop services from the AutoCad 2021 references

kmkxperia_1-1708147881123.png

 

kmkxperia_0-1708145646721.png

 

0 Likes
880 Views
1 Reply
Reply (1)
Message 2 of 2

norman.yuan
Mentor
Mentor

What type of application are you doing? AutoCAD .NET API plugin (the topic of this forum)? or an EXE app that automate AutoCAD via its COM API (because you use AutoCAD COM API here)? If it is former, then why do you need to use ObjectDBX's AxDbDocument?

 

AxDbDocument object cannot be "new"ed. You create an instance of it via an AcadApplication (e.g. a running AutoCAD session), calling its GetInterfaceObject() method. So, you have to post your code showing how/where you have/can obtain an AcadApplication object before you can use it to get an AxDbDocument.

 

When post your code. make sure you use "</>" button in the toolbar of the message window.

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes