Personal tools
You are here: Home Forum How to use Salome? Publishing mesh group without the underlying geometry

Publishing mesh group without the underlying geometry

Up to How to use Salome?

Publishing mesh group without the underlying geometry

Posted by Zoltan Csati at January 24. 2021
Hi,
 
 
I have an edge object on which I create an element group using
 
    mesh_on_edge = mesh.GroupOnGeom(edge, typ=SMESH.EDGE)
    mesh_on_edge.SetName('Interface')
 
The problem is that not only the mesh group, called 'Interface', appears in the study, but also the edge (with the automatically created name 'Edge_1') on which it has been created. According to the documentation, I can switch off the automatic publishing with
 
    smesh.SetEnablePublish(False)
 
but then the mesh group is not published either. Currently, my strategy is to remove the automatically published edges from the study using

    from salome.kernel.studyedit import getStudyEditor
    studyEditor = getStudyEditor()
    n_edge = ...  # I know how many edge groups I created
    for i in range(1, n_edge+1):
        edge_to_unpublish = salome.myStudy.FindObject('Edge_'+str(i))
        studyEditor.removeItem(edge_to_unpublish)
 
It took me a long time to find the required functions for it. I find this strategy ugly and brittle (what if 'Edge_2' already exists in the study; which one will be deleted?). Is there a way to
1) either publish a mesh group manually (the equivalent of "geompy.addToStudyInFather", but for mesh not for geometry)
2) or publish a mesh group automatically, but without publishing the underlying geometry?
 
 
Thanks,
Zoltan
Powered by Ploneboard
Document Actions