Skip to content

Broken (but with easy workaround) on the realthunder link branch #8

@VorpalBlade

Description

@VorpalBlade

I have been experimenting with the link/topological naming branch of freecad (https://github.com/realthunder/FreeCAD_assembly3) and found that the ShortCuts mod did not work. On startup I got the following error:

Traceback (most recent call last):
  File "/home/user/.FreeCAD/Mod/ShortCuts/ShortCuts_Gui.py", line 500, in onPreStart
    onStart()
  File "/home/user/.FreeCAD/Mod/ShortCuts/ShortCuts_Gui.py", line 492, in onStart
    onWorkbench()
  File "/home/user/.FreeCAD/Mod/ShortCuts/ShortCuts_Gui.py", line 189, in onWorkbench
    workbench = Gui.activeWorkbench().__class__.__name__
AssertionError: No active workbench

The Accessories menu then never showed up.

While I do not know the cause of this (might be an issue in the branch of FreeCAD I'm using), it was easy to workaround this by the following modification:

def onWorkbench():
    """Update shortcuts on workbench activated."""
    try:
        workbench = Gui.activeWorkbench().__class__.__name__
        update(workbench)
    except AssertionError as e:
        print("Ignoring: %s" % e)

With this change, the rest of ShortCuts seems to work perfectly fine, though a deeper investigation into this issue is probably warranted.

FreeCAD version info:

OS: Ubuntu 18.04.5 LTS (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2020.11.12.22739 +2746 (Git) AppImage
Build type: Release
Branch: LinkStage3
Hash: b8e17ac7497f70d39e551bccc66e4c37f855fd32
Python version: 3.8.6
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions