assembly: disable auto solve when workbench is not active
This commit is contained in:
parent
b1ff90e093
commit
4feccb6fab
|
@ -2788,7 +2788,8 @@ class Assembly(AsmGroup):
|
|||
@classmethod
|
||||
def canAutoSolve(cls):
|
||||
from . import solver
|
||||
return gui.AsmCmdManager.AutoRecompute and \
|
||||
return gui.AsmCmdManager.WorkbenchActivated and \
|
||||
gui.AsmCmdManager.AutoRecompute and \
|
||||
FreeCADGui.ActiveDocument and \
|
||||
not FreeCADGui.ActiveDocument.Transacting and \
|
||||
not FreeCAD.isRestoring() and \
|
||||
|
|
1
gui.py
1
gui.py
|
@ -138,6 +138,7 @@ class AsmCmdManager(ProxyType):
|
|||
Toolbars = OrderedDict()
|
||||
Menus = OrderedDict()
|
||||
_defaultMenuGroupName = '&Assembly3'
|
||||
WorkbenchActivated = False
|
||||
|
||||
@staticmethod
|
||||
def getToolbarParams():
|
||||
|
|
|
@ -29,11 +29,13 @@ class Assembly3Workbench(FreeCADGui.Workbench):
|
|||
|
||||
def Activated(self):
|
||||
from .gui import AsmCmdManager
|
||||
AsmCmdManager.WorkbenchActivated = True
|
||||
for cmd in AsmCmdManager.getInfo().Types:
|
||||
cmd.workbenchActivated()
|
||||
|
||||
def Deactivated(self):
|
||||
from .gui import AsmCmdManager
|
||||
AsmCmdManager.WorkbenchActivated = False
|
||||
for cmd in AsmCmdManager.getInfo().Types:
|
||||
cmd.workbenchDeactivated()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user