Personal tools
You are here: Home Forum Use mesh.UnRegister() doesn't clear gui

mesh.UnRegister() doesn't clear gui

Up to Use

mesh.UnRegister() doesn't clear gui

Posted by ppeetteerr at May 30. 2018

When I create a mesh in the text user interface (TUI) and attempt to delete it with

Mesh_1.Clear()
Mesh_1.mesh.UnRegister()

The mesh doesn't dissapear from the object panel in the GUI. Clicking on the mesh creates a segfault. Is there another way to delete a mesh using the TUI?

Re: mesh.UnRegister() doesn't clear gui

Posted by Vadim SANDLER at May 31. 2018

Instead

Mesh_1.mesh.UnRegister()

try this code

import salome
b = salome.myStudy.NewBuilder()
so =  salome.ObjectToSObject(Mesh_1.mesh)
b.RemoveObjectWithChildren(so)
salome.sg.updateObjBrowser(True)

Powered by Ploneboard
Document Actions