Completed
Allow selection of Face/Edge/Vertex (BRep) at the same time
Alberto Bencivenni
Problem:
When I change from "model1.SelectionFilterMode = selectionFilterType.Face" to "model1.SelectionFilterMode = selectionFilterType.Edge" everthing is unselected.
Workaround:
Yes, I created a workaround that works for what I need. i.e. selection based on what is closest to the mouse. Using the viewport.GetItemUnderMouseCursor to firstly find the entity (a custom mesh entity created from Brep data for faces, edges, and vertices) and then based on a distTo vs distMax for the subitems of face, edge and vertex were able to determine which entity subitem type was closest. I used a new implementation of SelectedItem, based on the same properties as the original Eyeshot one, and stored them in a “SelectedItems” collection in the viewport.
6
Comments
Since Eyeshot 2022.2 it is possible to mix Vertex. Edge and Face selection filter modes with the following code.
Is there any plan to have this functionality by default? The values of the selectionFilterType are set to 1, 2, 4, and 8 for Entity, Vertex, Edge and Face respectively, which would imply the intention to use the enum as flags, e.g.:
model1.SelectionFilterMode = selectionFilterType.Vertex | selectionFilterType.Edge | selectionFilterType.Face
but it didn't work when I tried it in practice
Hi Andrew,
No, this is not supported yet. May I ask you why you need to mix these subitems selection modes?
Hi Alberto
No problem. The functionality in several other CAD programs is to select either a vertex, edge of face depending on which one the mouse is closest to and we wanted the same functionality for our application.
FYI, in case it's useful for anyone, we're using a workaround different to the one given above - for each mouse click set the selection filter mode to vertex, then call GetItemUnderMouseCursor. If it's null, set the selection filter to edge and call GetItemUnderMouseCursor again. if that's null, repeat for face. If any of those are not null, we know we've clicked on a vertex/edge/face
Thanks for the explanation and additional workaround Andrew.
If we can select all features(or enabled ones) at same time, it will be great.
We're working on the native mixed filter selection mode (Faces|Edges|Vertices): at the moment, this feature is planned to be in Eyeshot 2022.2
Please sign in to leave a comment.