gui: fix assembly solve command
Fix selection detection, and undo/redo setup
This commit is contained in:
parent
882faf9d53
commit
fb9ad1609d
|
@ -1463,9 +1463,9 @@ class Assembly(AsmGroup):
|
|||
objs.add(sel.Object)
|
||||
continue
|
||||
for subname in sel.SubElementNames:
|
||||
ret = Assembly.find(sel.Object,subname,recursive=True)
|
||||
ret = Assembly.find(sel.Object,subname,keepEmptyChild=True)
|
||||
if ret:
|
||||
objs.add(ret[-1].Assembly)
|
||||
objs.add(ret.Assembly)
|
||||
return tuple(objs)
|
||||
|
||||
@staticmethod
|
||||
|
|
2
gui.py
2
gui.py
|
@ -138,8 +138,10 @@ class AsmCmdSolve(AsmCmdBase):
|
|||
@classmethod
|
||||
def Activated(cls):
|
||||
from . import solver
|
||||
FreeCAD.setActiveTransaction('Assembly solve')
|
||||
logger.report('command "{}" exception'.format(cls.getName()),
|
||||
solver.solve)
|
||||
FreeCAD.closeActiveTransaction()
|
||||
|
||||
|
||||
class AsmCmdMove(AsmCmdBase):
|
||||
|
|
|
@ -155,8 +155,8 @@ def _solve(objs=None,recursive=None,reportFailed=True,
|
|||
raise RuntimeError('No assembly found in selection')
|
||||
else:
|
||||
objs = FreeCAD.ActiveDocument.Objects
|
||||
if recursive is None:
|
||||
recursive = True
|
||||
if recursive is None:
|
||||
recursive = True
|
||||
elif not isinstance(objs,(list,tuple)):
|
||||
objs = [objs]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user