[SMESH] Applying a filter to a Group in TUI

Hi,

I want to apply a filter to a group of my mesh. I can do that in the GUI with “edit as standalone” on the group, “set filter” then selecting “current dialog” as a source. But when I dump the study, I just have the list of deleted IDs with no way to reproduce that.

The documentation Grouping Elements — Mesh 9.11.0 documentation show how to do that by applying the filter to the whole mesh which would takes days instead of the nearly half an hour if I applying the filter only on the groups.

I try to that with the RemovePredicate method of the group and GetPredicate method of the filter but that had not worked either.

Do you know how to reproduce in the TUI the GUI behaviour ?

Thank you,

Regards,

Jonas

1 Like

I was looking for something else and your search popped up. If you can mention what your filter criteria are I might have some Python code that could help you. I think you can do what you want generally if, in Python, you get the ID of the element you want to act on through the group.GetIds() or very similarly-named method (e.g. capitalizations might be different). Then you can work through that element list using the various element information methods of the mesh which will return the element property (whatever you want to filter on) by ID. Also, see if you can find what you need in the old forum. - Kirk

Thank you for your answer. My filter is Lying on Geom (SMESH.FT_LyingOnGeom) which may be the most demanding filter (especially as my geometry is a 3D helyx). I did not manage to apply the filter only to the elements that were in the group in the TUI.

Best,
Jonas