Personal tools
You are here: Home Forum Use define groups using TUI

define groups using TUI

Up to Use

define groups using TUI

Posted by EduardP at October 07. 2012

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

Attachments

Re: define groups using TUI

Posted by SMESH expert at October 08. 2012

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

Re: define groups using TUI

Posted by EduardP at October 08. 2012

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

 

Re: define groups using TUI

Posted by Saint Michael at October 08. 2012

Re: define groups using TUI

Posted by EduardP at October 08. 2012

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

Re: define groups using TUI

Posted by EduardP at October 09. 2012

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

Re: define groups using TUI

Posted by Saint Michael at October 09. 2012

Try this

geompy.UnionList(Shared, Shared_Face_1 + Shared_Face_2)

St.Michael

Re: define groups using TUI

Posted by EduardP at October 09. 2012

Again, just what I need it. Thank you, St. Michael.

With best wishes,

Eduard

Powered by Ploneboard
Document Actions