示例#1
0
文件: run.py 项目: rdacomp/FreeCAD
 def _checkAnalysis(self, obj):
     if FemUtils.isDerivedFrom(obj, "Fem::FemAnalysis"):
         deltaObjs = self._getAdded(obj)
         if deltaObjs:
             reset = False
             for o in deltaObjs:
                 if self._partOfModel(o):
                     reset = True
             if reset:
                 self._resetAll(obj)
示例#2
0
 def Activated(self):
     s = Gui.Selection.getSelection()
     if len(s) == 1 and FemUtils.isDerivedFrom(s[0], "Fem::FemSolverObject"):
         App.ActiveDocument.openTransaction(
             "Add %s equation to %s"
             % (self.getSpecifier(), s[0].Label))
         Gui.doCommand(
             "App.ActiveDocument.%(obj)s.Proxy.addEquation("
             "App.ActiveDocument.%(obj)s, '%(name)s')"
             % {"obj": s[0].Name, "name": self.getSpecifier()})
         App.ActiveDocument.commitTransaction()
         App.ActiveDocument.recompute()
示例#3
0
 def IsActive(self):
     s = Gui.Selection.getSelection()
     if len(s) == 1 and FemUtils.isDerivedFrom(s[0], "Fem::FemSolverObject"):
         return s[0].Proxy.isSupported(self.getSpecifier())
     return False
示例#4
0
文件: run.py 项目: rdacomp/FreeCAD
 def _partOfModel(self, obj):
     for t in self._WHITELIST:
         if FemUtils.isDerivedFrom(obj, t):
             return True
     return False
示例#5
0
文件: run.py 项目: rdacomp/FreeCAD
 def _checkEquation(self, obj):
     for o in obj.Document.Objects:
         if (FemUtils.isDerivedFrom(o, "Fem::FemSolverObject") and
                 hasattr(o, "Group") and obj in o.Group):
             if o in _machines:
                 _machines[o].reset()