define groups using TUI
Hi everyone,
I have a problem and, although I searched the forum or the documentation, I could not solved it. Given the case presented in the attached python file, I mainly need a way to define groups in the GEO part using TUI. So, for example, in Solid_5 from Partition_1, I want to define Wall_int using Solid_5 and cylinders (kind of Common operation), Wall_Ext - Solid_5 and Cyl. The Shared group I think I can manage it by using Get Shared Shapes on Solid_5 and Solid_6.
I hope I was clear enough and any suggestion is welcomed.
Thanks again for you help,
Eduard
Hi Eduard
You can achieve your goal using geompy.GetInPlace().
The principle is following: Wall_int = GetInPlace( Solid_5, group_of_all_faces_of_cylinders )
Corresponding code would be:
group_of_all_faces_of_cylinders = geompy.makeCompound( geompy.SubShapeAll( cylinders, geompy.ShapeType["FACE"])
Wall_int = geompy.GetInPlace( Solid_5, group_of_all_faces_of_cylinders )
Best regards
Edward
Hi Edward,
Thank you so much. It is just perfect and you saved me a lot of work. But still, were could I find all this stuff in the documentation or I did not searched thoroughly enough?
With best wishes,
Eduard
GetInPlace() is documented here:
http://docs.salome-platform.org/salome_6_5_0/gui/GEOM/geompy_doc/group__l4__obtain.html
St.Michael
Thank you, St. Michael!
This part of the documentation I totally ignored using only the TUI scripts from the help. I should study more, but now it is nice I know were to search.
With best wishes,
Eduard
Hi,
Can you please tell me what it is wrong with the piece of code below? I try to get the Shared Faces of Solid_2 with Solid_1 and Solid_3 and create one group. If it is only one face between Solid_2 and Solid_1 or Solid_3 everything is ok. The problem appears when are more than one.
# Shared
Shared = geompy.CreateGroup(Solid_2, geompy.ShapeType["FACE"])
Shared_Face_1 = geompy.CreateGroup(Solid_2, geompy.ShapeType["FACE"])
Shared_Face_2 = geompy.CreateGroup(Solid_2, geompy.ShapeType["FACE"])
Shared_Face_1 = geompy.GetSharedShapesMulti([Solid_1, Solid_2], geompy.ShapeType["FACE"])
Shared_Face_2 = geompy.GetSharedShapesMulti([Solid_2, Solid_3], geompy.ShapeType["FACE"])
geompy.UnionList(Shared, [Shared_Face_1,Shared_Face_2])
Thanks again for any hint.
Cheers,
Eduard
