Selected Object Type

Selected Object Type

Anonymous
Not applicable
1,114 Views
4 Replies
Message 1 of 5

Selected Object Type

Anonymous
Not applicable

Working from the Selection (Simple) sample, how do you figure out the object type from the selected object array (oSelectedEnts)?

 

I've implemented the same selection mechanism in C#, but I just get an array of Objects back and have no way of determining what they are since they are returned as generic "System.__ComObject" types.

 

 

0 Likes
Accepted solutions (1)
1,115 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable

I am not sure of the syntacs in C#, but in vb.net I do something like

 

If typeof JustSelectedEntity(1) is some_type then

0 Likes
Message 3 of 5

Anonymous
Not applicable

I was hoping for an easier way, but if this is the case my problem is I don't even know what objects to try a cast to.  I'm trying to select a client feature with client graphics, so how would I know what object type that would return?  So far I've tried ClientFeature and ClientFeatureDefinition and neither have worked.  I would hate to have to do this kind of guess work every time I implement selection for a different object type.

 

Any help with this would be appreciated.

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

The easiest way I have found is to set up a simple selection test in VBA and with a watch you will be able to see what type of object it is.

0 Likes
Message 5 of 5

Anonymous
Not applicable
Accepted solution

In C#, the watch reports a COM object type so that doesn't help.

I ended up writing my own selection mechanism and using the mouse listeners to  run it.  I needed more custom selection features for the client graphics regardless.

 

Thanks for the input though.

0 Likes