Hi,
Here's what I'm trying to do:
Use .NET to select a Part Reference (Acad Mechanical). For .NET this is simply an entity (or EntityImp to be precise).
Now, I'd like to get more information out of that entity, which (as far as I know with ACADM) is only possible through ARX or VBA.
So, first question: How can I do this? I'm trying to go from the .NET Acad Entity to a Interop MPartReference.
Is it possible through for example selectedEntity.AcadObject ?
Second question: I won't know what kind of entity is selected in advance. I need to know the COM type of the entity. How can I handle that best?
Thanks,
Bert
Solved! Go to Solution.
Solved by caddzone. Go to Solution.
That's one of the unfortunate problems with COM, a COM object can't
tell you what interfaces it supports, you can only ask it if it supports
an interface, and it can say yes or no.
The ObjectName property is the only way you can tell what type of
object it is (the ObjectARX runtime class name).
Just for the sake of completeness, as I think caddzone mentioned, this is possible through the following piece of code:
var dbObject = foo as DBObject;
var typeName = dbObject.GetRXClass().Name;
I believe the OP was referring to a COM object and COM types, not a
managed .NET object wrapper or .NET types. In his case, the objects
he's working with do not have managed .NET wrappers.