BIM: Fixed IsActive of BIM commands (#14384)

This commit is contained in:
Yorik van Havre
2024-05-30 22:33:43 +02:00
committed by GitHub
parent ed36928ff9
commit 7a8a25a5b3
16 changed files with 62 additions and 3 deletions

View File

@@ -246,7 +246,8 @@ class BIMWorkbench(Workbench):
t = QT_TRANSLATE_NOOP("BIM_GenericTools", "Generic 3D tools")
return { "MenuText": t, "ToolTip": t, "Icon": "BIM_Box"}
def IsActive(self):
return not FreeCAD.ActiveDocument is None
v = hasattr(FreeCADGui.getMainWindow().getActiveWindow(), "getSceneGraph")
return v
FreeCADGui.addCommand("BIM_GenericTools", BIM_GenericTools(self.generictools))
self.bimtools.append("BIM_GenericTools")
@@ -274,7 +275,8 @@ class BIMWorkbench(Workbench):
}
def IsActive(self):
return not FreeCAD.ActiveDocument is None
v = hasattr(FreeCADGui.getMainWindow().getActiveWindow(), "getSceneGraph")
return v
FreeCADGui.addCommand("Arch_RebarTools", RebarGroupCommand())
self.bimtools[self.bimtools.index("Arch_Rebar")] = "Arch_RebarTools"