Delete an object in TUI (and selecting it by its center of gravity location)


I am re-activating the seemingly old problem of removing (deleting) geometrical objects via TUI.

I found some threads devoted to this on the old forum, and searched through the new forum, but the threads I found indicate that the issue is still (partially) open.

My motivation is the following: I have to create a script which

  1. Generates a parametrised structure in Shaper, made of several faces

  2. Export it to GEOM

3… and delete some of the redundant faces, knowing their location (extend + center of gravity)

The 1. and 2. tasks are feasible - my dumped python script behaves as expected. However, I do not know how to perform the third operation.

I found the following pieces of solution:

  • the example script on the old forum (forum_10/125393444#7275533), with deleteShape method

  • the PDF document “A short introduction to SHAPER” by Raphaël Marc, with a promising example including “model.selection(“FACE”, (5, 5, 5)”, which probably performs the needed selection-by-location

  • the new forum thread Selection of edges, vertex, faces of solid in shaper TUI

with interesting explanations

  • the “stub” of documentation concerning the geomtools, on salome doccumentation platform

It seems, that the required functions are there, but the documentation is almost entirely missing. Will it be provided in some near future?

I will be grateful for help, and I shall share my solution, if I find one.



here you have what you are looking for (from what I understood from your post). (1,2 KB)

Thank you for the very prompt answer.
Indeed, the Repair / Suppress Faces works for my case, although I had to apply a work-around. My structure is made of faces, not solids, and at the first attempt the S.F. function threw an error (“invalid data”). However, once I stitched the faces into a shell, the .S.F. worked fine. I was also capable of modifying your script so that it handles a Shell object instead of a Solid object.