FEM: some modules, better document handling

This commit is contained in:
Bernd Hahnebach
2020-03-14 21:43:37 +01:00
parent 9d76f458a8
commit 5214c81ed4
3 changed files with 10 additions and 10 deletions

View File

@@ -70,7 +70,7 @@ class _ViewProviderFemMeshGmsh:
def setEdit(self, vobj, mode):
# hide all meshes
for o in FreeCAD.ActiveDocument.Objects:
for o in vobj.Object.Document.Objects:
if o.isDerivedFrom("Fem::FemMeshObject"):
o.ViewObject.hide()
# show the mesh we like to edit
@@ -253,7 +253,7 @@ class _ViewProviderFemMeshGmsh:
objs = self.Object.MeshRegionList
objs.append(incoming_object)
self.Object.MeshRegionList = objs
FreeCAD.ActiveDocument.recompute()
incoming_object.Document.recompute()
class _TaskPanel:
@@ -313,13 +313,13 @@ class _TaskPanel:
def accept(self):
self.set_mesh_params()
FreeCADGui.ActiveDocument.resetEdit()
FreeCAD.ActiveDocument.recompute()
self.mesh_obj.ViewObject.Document.resetEdit()
self.mesh_obj.Document.recompute()
return True
def reject(self):
FreeCADGui.ActiveDocument.resetEdit()
FreeCAD.ActiveDocument.recompute()
self.mesh_obj.ViewObject.Document.resetEdit()
self.mesh_obj.Document.recompute()
return True
def clicked(self, button):