Select single Face



I`m trying to find out which face is currently selected, or which face the user picked with his mouse using C#.


So I already tried selectSet and MouseEvents, but I could only find out which Part is selected and not which face...


Is there a possibility to find the selected faces with C#?

I hope anyone can help me.



Re: Select single Face

Check out Jason's new SPY:



Matt Johnson
Application Engineer
Ally PLM Solutions

Re: Select single Face

Thank you very much for your quick reply. Spy for Solid Edge is a very useful tool, but I still can´t solve my problem.


My problem with ActiveSelectSet is, that I can get for example a sePart but if I want to get a marked face on my part with SelectSet.Item() I always get a System.InvalidCastException (HRESULT: 0x80004002 (E_NOINTERFACE)).


So is this possible with SelectSet? Or is there another way to make this?

Re: Select single Face

It is possível, but you should start a command and activate face selection. Then you can get the selected face in the mouse event handler.

I think there is an addin sample which shows this.

Re: Select single Face

Like Martin said, the MouseEvents macro shows exactly what you want. You can add the selected face to the highlight set. I dont think that you can work with the selectset.