1
# SPDX-License-Identifier: LGPL-2.1-or-later
2
# /**************************************************************************
4
# Copyright (c) 2023 Ondsel <development@ondsel.com> *
6
# This file is part of FreeCAD. *
8
# FreeCAD is free software: you can redistribute it and/or modify it *
9
# under the terms of the GNU Lesser General Public License as *
10
# published by the Free Software Foundation, either version 2.1 of the *
11
# License, or (at your option) any later version. *
13
# FreeCAD is distributed in the hope that it will be useful, but *
14
# WITHOUT ANY WARRANTY; without even the implied warranty of *
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16
# Lesser General Public License for more details. *
18
# You should have received a copy of the GNU Lesser General Public *
19
# License along with FreeCAD. If not, see *
20
# <https://www.gnu.org/licenses/>. *
22
# **************************************************************************/
27
from PySide.QtCore import QT_TRANSLATE_NOOP
30
import FreeCADGui as Gui
31
from PySide import QtCore, QtGui, QtWidgets
36
# translate = App.Qt.translate
38
__title__ = "Assembly Command to Solve Assembly"
40
__url__ = "https://www.freecad.org"
43
class CommandSolveAssembly:
47
def GetResources(self):
50
"Pixmap": "Assembly_SolveAssembly",
51
"MenuText": QT_TRANSLATE_NOOP("Assembly_SolveAssembly", "Solve Assembly"),
55
"Assembly_SolveAssembly",
56
"Solve the currently active assembly.",
63
return UtilsAssembly.isAssemblyCommandActive() and UtilsAssembly.isAssemblyGrounded()
66
assembly = UtilsAssembly.activeAssembly()
70
App.setActiveTransaction("Solve assembly")
72
App.closeActiveTransaction()
76
Gui.addCommand("Assembly_SolveAssembly", CommandSolveAssembly())