Select single Face

Experimenter
Experimenter

Hi,

 

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.

Thanks!

4 REPLIES

Re: Select single Face

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

Check out Jason's new SPY: http://community.plm.automation.siemens.com/t5/Solid-Edge-Developer-Forum/Spy-for-Solid-Edge-Early-a...

 

http://screencast.com/t/eD1wXvDlwgk

 

 

Matt Johnson
Application Engineer
Ally PLM Solutions
matt.johnson@allyplm.com
http://allyplm.com/

Re: Select single Face

Experimenter
Experimenter

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

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

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

Pioneer
Pioneer

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.