Personal tools
You are here: Home Forum Use use currently study in shaper module

use currently study in shaper module

Up to Use

use currently study in shaper module

Posted by Anirudh Nehra at June 28. 2019

Hi,

I am working extensively with the shaper module to create parametric assemblies. I have created most of the features through GUI and I want to create the rest through python console. I have two questions:

1- How do I use the currently open study to continue adding features to it? I tried using something like this below but it creates a new part rather than continuing from last feature. 

from salome.shaper import model

model.begin()
partSet = model.moduleDocument()
Part_1 = model.addPart(partSet)
Part_1_doc = Part_1.document()  

2- How do I get selection by mouse into python console to create groups of faces? It seems real hard to try to find IDs of individual elements(the name is very long with complex syntax). I just want to box select things and get them in python command argument.

 3- Sometimes there are application errors,when they appear. only option is to kill salome. Is there a way to trackback what is the problem without losing the current session?

 4- How do I box select geometry for groups in such a way that only foreground geometry is selected. The hidden faces should not get selected.

 5- When there are lot of parts to display, the operations such as rotation and zoom are rather slow. However the same geometry when exported and viewed in geometry module rotates and spins without lag.

 Is there a way to automatically update exported geometry in GEOM module and consequent meshes in meshes module? Right now, it seems we need to export the changed geometry each time and create new meshes over it.

 Thanks a lot.

 Anirudh

 

 

Re: use currently study in shaper module

Posted by Christophe Bourcier at June 29. 2019
1. Instead of using addPart, you can get the part and its doc like this:
 

 

from ModelAPI import *

model.begin()
partSet = model.moduleDocument()

aPart = objectToFeature(partSet.object("Features", 0))

aPartResult = modelAPI_ResultPart(aPart.results()[0])

Part_1_doc = aPartResult.partDoc()

 

Then you can add features like this:


Box_1 = model.addBox(Part_1_doc, 10, 10, 10)

 

I got those lines from the SHAPER sources: src/ModelAPI/Test/TestSaveOpen2.py

 

2. Some features accept other feature's result as "all-in-" prefix. For instance:

 

model.selection("COMPOUND", "all-in-Box_1")

 

But it does not work for groups.

 

You can also use the alternative mode of selection by coordinates. See the dump_geo.py file created by the dump feature. In the menu Part/Dump instead of File/Dump study.

 

For instance to select a point by naming:

model.selection("VERTEX", "[Box_4_1/Front][Box_4_1/Right][Box_4_1/Top]")

 

or by its coordinates:

model.selection("VERTEX", (10, 10, 10))

 

3. Sometimes the dialog box with application errors is just behind the Salome window. You can close it.

 

If you find some sigsegv or crashes, please try to send the steps to reproduce them.

 

4. It is not yet possible. Maybe available in next version.

 

5. You can disable some selection modes (Vertices, Edges, Faces) by right-click in the view or in the preferences of SHAPER, in the Viewer tab.

 

6. It is not yet possible. Maybe available in next version.

 

Thank you for the feedback.

 

Christophe

p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }

Re: use currently study in shaper module

Posted by Anirudh Nehra at July 06. 2019

Hello,

Thanks for the reply. There seems to be some issue in sketch update if sketch dimensions are updated with expressions and parameters created by parameter dialog box.

I am attaching the link to a study where there are many parameters in parameters dialog box. Updating monoblock_offset from 0.15 to 0.225 causes study to break down for unknown reason.

https://www.dropbox.com/s/x32sqo44i98xf35/scenerio2_geom_groups.hdf?dl=0

Regards

Anirudh

 

Re: use currently study in shaper module

Posted by Anirudh Nehra at July 06. 2019

Hi,

I think error occurs in updating of 'offset_BC5_Cut_sketch' feature. Also, after error an Application Error window pops up that does not go away and the only option is to kill and restart salome.

 

Thanks

Anirudh

Re: use currently study in shaper module

Posted by Anirudh Nehra at Thursday 11:47

Hi,

I hope you could download the hdf file and spot the error. Please vary the monoblock_offset parameter from 0.15 to 0.225 to reproduce the error.

 

Thanks a lot.

Anirudh

Powered by Ploneboard
Document Actions