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)
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()
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
def _partOfModel(self, obj): for t in self._WHITELIST: if FemUtils.isDerivedFrom(obj, t): return True return False
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()