FEM: Python constraints, hide meshes while constraint task panel is opened
This commit is contained in:
@@ -26,7 +26,7 @@ __author__ = "Markus Hovorka, Bernd Hahnebach"
|
||||
__url__ = "http://www.freecadweb.org"
|
||||
|
||||
|
||||
import FreeCAD as App
|
||||
import FreeCAD
|
||||
import femtools.femutils as FemUtils
|
||||
from . import ViewProviderFemConstraint
|
||||
from FreeCAD import Units
|
||||
@@ -41,6 +41,11 @@ class ViewProxy(ViewProviderFemConstraint.ViewProxy):
|
||||
return ":/icons/fem-constraint-electrostatic-potential.svg"
|
||||
|
||||
def setEdit(self, vobj, mode=0):
|
||||
# hide all meshes
|
||||
for o in FreeCAD.ActiveDocument.Objects:
|
||||
if o.isDerivedFrom("Fem::FemMeshObject"):
|
||||
o.ViewObject.hide()
|
||||
# show task panel
|
||||
task = _TaskPanel(vobj.Object)
|
||||
Gui.Control.showDialog(task)
|
||||
|
||||
@@ -61,7 +66,7 @@ class _TaskPanel(object):
|
||||
self._refWidget = FemSelectionWidgets.BoundarySelector()
|
||||
self._refWidget.setReferences(obj.References)
|
||||
self._paramWidget = Gui.PySideUic.loadUi(
|
||||
App.getHomePath() + "Mod/Fem/Resources/ui/ElectrostaticPotential.ui")
|
||||
FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/ElectrostaticPotential.ui")
|
||||
self._initParamWidget()
|
||||
self.form = [self._refWidget, self._paramWidget]
|
||||
analysis = FemUtils.findAnalysisOfMember(obj)
|
||||
|
||||
Reference in New Issue
Block a user