FEM: mesh region, on edit hide all meshes and shapes, show the part to mesh

This commit is contained in:
Bernd Hahnebach 2016-12-20 18:11:26 +01:00 committed by Yorik van Havre
parent 6822d09208
commit 862937080e

View File

@ -59,6 +59,15 @@ class _ViewProviderFemMeshRegion:
return
def setEdit(self, vobj, mode=0):
# hide all meshes and shapes, show part to mesh
for o in FreeCAD.ActiveDocument.Objects:
if o.isDerivedFrom("Fem::FemMeshObject") or hasattr(o, "Shape"):
o.ViewObject.hide()
if len(self.Object.InList) == 1:
self.Object.InList[0].Part.ViewObject.show()
else:
FreeCAD.Console.PrintError(self.Object.Name + ' seam to belong to more than one mesh object. This is not supported.\n')
# show task panel
import _TaskPanelFemMeshRegion
taskd = _TaskPanelFemMeshRegion._TaskPanelFemMeshRegion(self.Object)
taskd.obj = vobj.Object