Hello, basically I am having issues with a parametrised geometry file that I created. I have managed to mesh it and export it but when I go back to the Shaper module in the project browser, it appears blank. All the parameters that I created have disappeared. However there is another ShaperResults tree in the project browser which has some geometry details (even though there are no parameters). I was wondering if I am doing something wrong or if there is an option to recover the parameters?
Hello,
The ShaperResults node in the Object Browser is the way SMESH can have access to SHAPER objects.
But I don’t understand what you mean when you say that when you go back to SHAPER the project is blank?
You mean that you do something like this:
- open SHAPER module
- create a geometry (for example a simple box)
- open SMESH => ShaperResults node appears with Box in it
- activate SHAPER module again (click the SHAPER button in the toolbar)
and here your project is empty?
It should not and you should see the box
I’m guessing this is related to Shaper module data is missing in file but the file you attached is not available anymore.
Dear fred,
Thanks for your reply. I have attached a copy of the file in question. This is the latest version of the work, but this is happening to other earlier revisions of the geometry as well (It seems that all the SHAPER data is missing, even though I am still able to load the mesh). I have a feeling something might be broken with the software itself since I am used to checking all the modules are functional at every iteration.
To better illustrate this problem, I have a copy of the python dump of the earlier revision of the file (the parameters have remained unchanged since then). Pasted here is the shaper module portion of the python script:
from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
### Create Part
Part_1 = model.addPart(partSet)
Part_1_doc = Part_1.document()
model.addParameter(Part_1_doc, "air_height", '100')
model.addParameter(Part_1_doc, "air_width", '300')
model.addParameter(Part_1_doc, "air_thickness", '3')
model.addParameter(Part_1_doc, "water_height", '40')
model.addParameter(Part_1_doc, "water_width", '50')
model.addParameter(Part_1_doc, "water_thickness", '3')
### Create Sketch
Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
and so on...
Now when I create the code dump, I am getting the following:
salome.salome_init()
import salome_notebook
notebook = salome_notebook.NoteBook()
sys.path.insert(0, r'C:/Users/ path to root directoryl')
###
### SHAPER component
###
from salome.shaper import model
model.begin()
partSet = model.moduleDocument()
model.end()
###
### SHAPERSTUDY component
###
model.publishToShaperStudy()
import SHAPERSTUDY
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# Extrusion_1_1, = SHAPERSTUDY.shape("dead01_8:30")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# LinearCopy_1_1, = SHAPERSTUDY.shape("dead02_8:54")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# Shell_1_1, = SHAPERSTUDY.shape("dead03_8:55")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# Extrusion_1_1_1, = SHAPERSTUDY.shape("dead04_8:30")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# LinearCopy_1_1_1, = SHAPERSTUDY.shape("dead05_8:256")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# LinearCopy_1_2, = SHAPERSTUDY.shape("dead06_8:256:1")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# SubShapes_1_1, = SHAPERSTUDY.shape("dead07_8:324")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# LinearCopy_1_2_1, = SHAPERSTUDY.shape("dead08_8:256:1")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# Face_1_1, = SHAPERSTUDY.shape("dead09_8:326")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# Extrusion_1_1_2, = SHAPERSTUDY.shape("dead010_8:30")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# Fuse_1_1, = SHAPERSTUDY.shape("dead011_8:326")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# Extrusion_1_1_3, = SHAPERSTUDY.shape("dead012_8:30")
# This shape does not exist among the SHAPER results; if it is referenced by SMESH, this may cause an error
# LinearCopy_1_2_2, = SHAPERSTUDY.shape("dead013_8:256:1")
###
### GEOM component
I have reattached a copy of the model here:
I opened the HDF and yes there is nothing in SHAPER.
But the geometry used to create the mesh is defined in GEOM.
When I dumped this HDF then I saw that the geometries are in fact imported from XAO.
Did you use the “Export to GEOM” feature in SHAPER?
In fact you should not, and this come to your original question.
“Export to GEOM” was initially created to allow access to geometry created in SHAPER from SMESH. But when you use this feature you break the link with SHAPER.
To have a better interaction the ShaperResults module was added. It is not perfect, but better than “export to Geom”, for example groups and fields are available too. Most important, the link with SHAPER is kept.
So if you update the geometry in SHAPER, you just need to recompute the mesh instead of creating a new one.
Normally you should not mix Shaper and Geom.
The “Export to Geom” feature is kept because in some rare cases it can be useful.
Hi Fred,
Thanks for your insight. Indeed, I did use the Export to Geom option which I picked up while following an unofficial Youtube tutorial .The reason for doing so was to allow the creation of patches for use with OpenFOAM. It seems, based on your comment, that it was not the best of practices.
In any case, I wanted to ask whether there would be a workaround in order to recover the parameters from SHAPER (or SHAPER RESULTS, which still has the geometric features conserved) , or would I have to start the model from scratch?
Unfortunately it seems the SHAPER part is not store in the HDF.
When you dump it there is nothing in the SHAPER section and the ShaperResults lines are all commented because the referenced shapes do not exist anymore.