To recreate:
1. open FreeCAD, open a new file, switch to BIM workbench
2.create a building object, save file and close
3. reopen test file
4. error appears.
I have made the error go away by adding import FreeCADGui to either line 28 or 131 of BimViews.py. I'm not sure which is preferable, whether this might have some undesirable effect elsewhere, or whether the reference to FreeCADGui on line 152 is necessary at all?
Any advice on best solution gratefully received.
Version:
OS: macOS High Sierra (10.13)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21514 (Git)
Build type: Release
Branch: master
Hash: 89ddab33f692a9bd739171689f9ab0eb58d64b35
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: C/Default (C)
Console display:
Python 3.8.3 | packaged by conda-forge | (default, Jun 1 2020, 17:26:49)
[Clang 9.0.1 ] on darwin
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> Gui.runCommand('Std_Workbench',20)
>>> Gui.runCommand('Std_ViewStatusBar',1)
>>> MRU="0"
>>> exec(open('/Applications/FreeCAD.app/Contents/Resources/share/Mod/Start/StartPage/LoadMRU.py').read())
>>> FreeCAD.openDocument('/Users/duncan/test.FCStd')
>>> # App.setActiveDocument("test")
>>> # App.ActiveDocument=App.getDocument("test")
>>> # Gui.ActiveDocument=Gui.getDocument("test")
>>> Gui.runCommand('Std_OrthographicCamera',1)
>>> Gui.runCommand('Std_About',0)
>>>
Traceback (most recent call last):
File "/Users/duncan/Library/Preferences/FreeCAD/Mod/BIM/BimViews.py", line 153, in update
if obj in FreeCADGui.Selection.getSelection():
NameError: name 'FreeCADGui' is not defined