Personal tools
You are here: Home Forum Use Using a Second Shape in a Group Edition Script (TUI)

Using a Second Shape in a Group Edition Script (TUI)

Up to Use

Using a Second Shape in a Group Edition Script (TUI)

Posted by William Tougeron at April 18. 2013

Hi,

I would like to know if their is a short way to make in a Python script something similar to enabling the Main Shape Selection Restriction in the GUI group creation/edition dialogue box. I mean using a Second Shape (like in the enclosed screenshot).

I have searched in the documentation but I couldn't find it.

My today solution is to use my own function to detect objects having the same shape comparing their basic properties, mass centers and inertia matrices, but this solution is neither clean nor fast.

Can someone help me do this correctly?

Thank you very much,

Best regards,

William

Attachments

Re: Using a Second Shape in a Group Edition Script (TUI)

Posted by Saint Michael at April 18. 2013

Hi William

"Geometrical parts of the second shape" corresponds to geompy.GetInPlace(self, theShapeWhere, theShapeWhat).

"Only sub-shapes of the second shape" corresponds to geompy.GetSharedShapes(self, theShape1, theShape2, theShapeType)

St.Michael

Re: Using a Second Shape in a Group Edition Script (TUI)

Posted by William Tougeron at April 24. 2013

Hi Saint Michael

Thank you very much and sorry for the last response :)

Best regards,

William

Re: Using a Second Shape in a Group Edition Script (TUI)

Posted by William Tougeron at April 24. 2013

"late" response (not last)...

Re: Using a Second Shape in a Group Edition Script (TUI)

Posted by Richard Drake at August 21. 2015

Hello,

I have a similar problem. I'm using Salome 7.6.0. I want to be able to have two boxes, box1 and box2, and subtract box2 from box1 to form cut. I then want to be able to create a group of the faces on cut that correspond to box2.

Assuming I have a box2Group and a cutGroup, I figured a simple boolean operation would work good.

intersectGroup = geompy.IntersectGroups(cutGroup,box2Group,"intersectGroup")

However, I get an Error message stating "IntersectGroups cannot be performed on groups, built on different main shapes". Alright. I'll use the idea of GetSharedShapes:

geompy.ShapesOp.GetSharedShapes(cut,box2,geompy.ShapeType["FACE"])

The problem is... the list that gets returned is void...

How can I do this? I have attached my input file.

Thanks,

Richard

Attachments

Re: Using a Second Shape in a Group Edition Script (TUI)

Posted by Saint Michael at August 21. 2015

Hi

Use GetInPlace():

intersectGroup = geompy.GetInPlace( cut, box2Group, theName="intersectGroup")

St.Michael

Re: Using a Second Shape in a Group Edition Script (TUI)

Posted by Richard Drake at August 25. 2015

Hello Michael,

Thanks for the reply. It worked like a charm. 

Richard

Powered by Ploneboard
Document Actions