Get object type when using “Embed Interop Types” False

There is a blog post on why it's better to have Embed Interop Types of the autodesk.inventor.interop assembly set to False

However, in this case some properties might not show up when typing your code, but they can still be accessed if you are using late binding – in case of C# you can do that by declaring a variable as dynamic

Also, GetType() will not provide the exact com type, but just a generic __ComObject

Having the Type property should be enough to identify the type of the object, but if you really need the actual COM name of it, then you can use the Microsoft.VisualBasic assembly for that.

ComType


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading