Merge pull request #15 from APEbbers/Develop

Added a try-catch to avoid errors due disabled workbenches
This commit is contained in:
Paul Ebbers 2025-01-11 14:21:04 +01:00 committed by GitHub
commit d1d5f96d8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -64,7 +64,11 @@ def subToolAction(nfo):
else: else:
for workbench in act["workbenches"]: for workbench in act["workbenches"]:
print("Activating workbench " + workbench + " to access tool " + toolPath) print("Activating workbench " + workbench + " to access tool " + toolPath)
FreeCADGui.activateWorkbench(workbench) try:
FreeCADGui.activateWorkbench(workbench)
except Exception:
print("SearchBar: Workbench not present! Was it disabled?")
return
if runTool(): if runTool():
return return
print( print(

View File

@ -5,7 +5,7 @@
<description>Adds a search bar widget for tools, document objects, and preferences</description> <description>Adds a search bar widget for tools, document objects, and preferences</description>
<version>1.3.1.1</version> <version>1.3.1.2</version>
<date>2022-06-01</date> <date>2022-06-01</date>