(self)
| 174 | return not FreeCAD.ActiveDocument is None |
| 175 | |
| 176 | def Activated(self): |
| 177 | sel = FreeCADGui.Selection.getSelection() |
| 178 | if sel: |
| 179 | st = Draft.getObjectsOfType(sel, "Structure") |
| 180 | ax = Draft.getObjectsOfType(sel, "Axis") |
| 181 | if ax: |
| 182 | FreeCAD.ActiveDocument.openTransaction( |
| 183 | translate("Arch", "Create Structural System") |
| 184 | ) |
| 185 | FreeCADGui.addModule("Arch") |
| 186 | if st: |
| 187 | FreeCADGui.doCommand( |
| 188 | "obj = Arch.makeStructuralSystem(" |
| 189 | + ArchCommands.getStringList(st) |
| 190 | + ", " |
| 191 | + ArchCommands.getStringList(ax) |
| 192 | + ")" |
| 193 | ) |
| 194 | else: |
| 195 | FreeCADGui.doCommand( |
| 196 | "obj = Arch.makeStructuralSystem(axes = " |
| 197 | + ArchCommands.getStringList(ax) |
| 198 | + ")" |
| 199 | ) |
| 200 | FreeCADGui.addModule("Draft") |
| 201 | FreeCADGui.doCommand("Draft.autogroup(obj)") |
| 202 | FreeCAD.ActiveDocument.commitTransaction() |
| 203 | FreeCAD.ActiveDocument.recompute() |
| 204 | else: |
| 205 | FreeCAD.Console.PrintError( |
| 206 | translate("Arch", "Select at least an axis object") + "\n" |
| 207 | ) |
| 208 | |
| 209 | |
| 210 | class _CommandStructure: |
nothing calls this directly
no test coverage detected