CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Mesh Generation & Pre-Processing (https://www.cfd-online.com/Forums/mesh-generation/)
-   -   Salome Shaper: TUI Recover Operation (https://www.cfd-online.com/Forums/mesh-generation/226823-salome-shaper-tui-recover-operation.html)

carl_r May 8, 2020 18:34

Salome Shaper: TUI Recover Operation
 
5 Attachment(s)
Hi,
I am trying to use the TUI to script some automated geometry creation in Shaper.

I have imported two cubes (.step), then drawn some cylinders on one surface of the cube. We'll call this the "internal geometry". This geometry is then placed inside a large cube. I then do a cut operation to subtract the internal geometry from the large cube. The cut process consumes the internal geometry.

In order to recover the internal geometry I use the Recover feature (model.addRecover) however I can't get it to work. It executes with no error, but does not recover the part. When i view the result in the GUI i see the action listed in the object tree, but is i select edit, i find that the geometry to recover check boxes are not checked.

Am I using the wrong geometry definition?
Has anyone else managed to successfully use the recover command with the TUI.

I've attached my script and files which should be relatively easy to follow.
Note the .TXT needs removing from the .py and .STEP files.

I'm struggling to find any help in the documentation. Also I can't seem to gain access to the Salome Forum, as I've not had a response to my email requesting an user name.

otaolafr December 7, 2020 09:20

Quote:

Originally Posted by carl_r (Post 769529)
Hi,
I am trying to use the TUI to script some automated geometry creation in Shaper.

I have imported two cubes (.step), then drawn some cylinders on one surface of the cube. We'll call this the "internal geometry". This geometry is then placed inside a large cube. I then do a cut operation to subtract the internal geometry from the large cube. The cut process consumes the internal geometry.

In order to recover the internal geometry I use the Recover feature (model.addRecover) however I can't get it to work. It executes with no error, but does not recover the part. When i view the result in the GUI i see the action listed in the object tree, but is i select edit, i find that the geometry to recover check boxes are not checked.

Am I using the wrong geometry definition?
Has anyone else managed to successfully use the recover command with the TUI.

I've attached my script and files which should be relatively easy to follow.
Note the .TXT needs removing from the .py and .STEP files.

I'm struggling to find any help in the documentation. Also I can't seem to gain access to the Salome Forum, as I've not had a response to my email requesting an user name.

hello carl_r,
sorry to bother you,
I was an GEOMETRY user, and I was trying to learn SHAPER, I work only in TUI but I am having a lot of problems with SHAPER TUI, I feel like I am missing documentation, as even after a read everything i could I still dont figure some things.
I though that you might be able to help me as I can imagine that as an OF user you found yourself with the same issues.
I was trying to create groups automatically that are in a precise location.
3 in total:
the two first groups are faces that are placed in a two different planes and the third is all the other faces.

in GEOMETRY I was doing this without problem using:
Code:

Plane_1 = geompy.MakePlane(Vertex_0B, OZ, D*10)
geomObj_1 = geompy.GetInPlace(fluid, Plane_1, True)
Plane_2 = geompy.MakePlane(Vertex_0A, OZ, D*10)
geomObj_2 = geompy.GetInPlace(fluid, Plane_2, True)
geomObj_3 = geompy.SubShapeAll(fluid, geompy.ShapeType["FACE"])
Group_1 = geompy.CreateGroup(fluid, geompy.ShapeType["FACE"])
geompy.UnionList(Group_1, [geomObj_1])
Group_2 = geompy.CreateGroup(fluid, geompy.ShapeType["FACE"])
geompy.UnionList(Group_2, [geomObj_2])
Group_3 = geompy.CreateGroup(fluid, geompy.ShapeType["FACE"])
geompy.UnionList(Group_3, geomObj_3)
geompy.DifferenceList(Group_3, [geomObj_1, geomObj_2])

but in SHAPER I can not get the "filters" to work:
Code:

filt_2=                model.addFilter(name = "OnPlane", args = [Plane_4.result()]);
filt_1=                model.addFilter(name = "BelongsTo", args = [Cylinder_1.result()]);
faces=                model.filters(Part_1_doc, [filt_1, filt_2])
model.do()
Group_1 =        model.addGroup(Part_1_doc, "Faces",  [faces])

I have a problem with the model.filters function, as it is like it is not being executed, as when i load the script in salome, It shows the group_1 with a problem and when I enter there is nothing selected but when I click in select by filters, the filters that I wanted are already created and I need to click in "select" and then apply x2 (without changing anything else) and the group is created correctly.
best regards,

Juanca02 September 27, 2023 11:08

Hello Franco.
Sorry to bother you, I'm struggling with the same problem with shaper. Could you solved it?


Best regards


All times are GMT -4. The time now is 14:13.