def setEdit(self, vobj, mode):
     for obj in FreeCAD.ActiveDocument.Objects:
         if obj.isDerivedFrom("Part::Feature"):
             obj.ViewObject.hide()
         if obj.isDerivedFrom("Fem::FemMeshObject"):
             obj.ViewObject.show()
     import _TaskPanelCfdMeshGmsh
     taskd = _TaskPanelCfdMeshGmsh._TaskPanelCfdMeshGmsh(self.Object)
     taskd.obj = vobj.Object
     FreeCADGui.Control.showDialog(taskd)
     return True
Esempio n. 2
0
 def createNewMesh(self, mesh_name):
     self.mesh_object = CfdMeshGmsh.makeCfdMeshGmsh(mesh_name)
     doc = FreeCAD.getDocument(self.__class__.__doc_name)
     obj = doc.getObject(mesh_name)
     vobj = obj.ViewObject
     obj.Part = doc.getObject(self.__class__.__part_name)
     if obj.isDerivedFrom("Fem::FemMeshObject"):
         obj.ViewObject.show()
     obj.CharacteristicLengthMax = "80 mm"
     obj.ElementOrder = "1st"
     import _TaskPanelCfdMeshGmsh
     taskd = _TaskPanelCfdMeshGmsh._TaskPanelCfdMeshGmsh(obj)  # Error when ran in FreeCADCmd
     taskd.obj = vobj.Object
     taskd.runMeshProcess()
     taskd.mesh_process.waitForFinished()