C# COM reference for Inventor

C# COM reference for Inventor

Joshua_claytonWV5WP
Enthusiast Enthusiast
875 Views
3 Replies
Message 1 of 4

C# COM reference for Inventor

Joshua_claytonWV5WP
Enthusiast
Enthusiast

Joshua_clayt_0-1673975645890.png

I have inherited a C# project that has a COM reference to Inventor, but I'm not sure what I need to do to get that installed / available.

I installed Inventor Professional 2021 but it doesn't show up in the COM references and I can't locate a DLL simply called "Inventor".

 

Any ideas what this is pointing to?

 

0 Likes
Accepted solutions (1)
876 Views
3 Replies
Replies (3)
Message 2 of 4

jjstr8
Collaborator
Collaborator
Accepted solution

I can't see what your reference is pointing to, but the correct reference is the interop assembly "Autodesk.Inventor.Interop".  It's a dll located in "C:\Program Files\Autodesk\Inventor 20xx\Bin\Public Assemblies\" where xx is your version.  This is installed with Inventor, so you don't have to worry about it for deployment.

Message 3 of 4

JelteDeJong
Mentor
Mentor

Just another point that will save you some bugs later on. By default the property “Embeding Interop Types” of the referenced Inventor Interop is set to True. You need to set this to False. (link)

JelteDeJong_1-1673987251568.png

 

 

 

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 4 of 4

Michael.Navara
Advisor
Advisor

I agree with @JelteDeJong and @jjstr8 . I advise you not to use this COM reference, but direct reference to Autodesk.Inventor.Interop.dll. Also I recommend you to make a copy of this dll to your project and make reference to this copy. It is much safer for future maintainers/developers because they get a right version of Inventor API.

The COM reference depends on which version is currently registered in system (last run version).

 

 

Just a note: If you need older version of Autodesk.Inventor.Interop.dll you can get it from GAC. Here i all previous versions of Inventor API.

C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Autodesk.Inventor.Interop\