[Solved] 'TechDrawGui.MDIViewPage' object has no attribute 'getViewer'

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

[Solved] 'TechDrawGui.MDIViewPage' object has no attribute 'getViewer'

Post by Evgeniy »

This error appears when trying to Export current page to SVG file. What can it be caused by?
'Template001': no Shape, calculate manual bounding box
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "M:\FreeCAD_0.20.25645_Win-LPv12.5.4_vc17.x-x86-64\Mod\Draft\importSVG.py", line 1824, in export
bb.add(Draft.get_bbox(obj))
File "M:\FreeCAD_0.20.25645_Win-LPv12.5.4_vc17.x-x86-64\Mod\Draft\draftutils\gui_utils.py", line 731, in get_bbox
region = view.getViewer().getSoRenderManager().getViewportRegion()
<class 'AttributeError'>: 'TechDrawGui.MDIViewPage' object has no attribute 'getViewer'
OS: Windows 10
Word size of FreeCAD: 64-bit
Version: 0.20.25645 (Git)
Build type: Release
Branch: master
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Last edited by Evgeniy on Sat Sep 18, 2021 7:44 pm, edited 1 time in total.
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: 'TechDrawGui.MDIViewPage' object has no attribute 'getViewer'

Post by wmayer »

The SVG file format from the global Export function is supposed to work for Draft objects only. TechDraw has its own SVG (and DXF) exporter that you can find in the toolbar or in the Tech Draw menu.

Maybe for the future it would be good to make things more flexible and support to export TechDraw objects with the Draft SVG exporter.
User avatar
Evgeniy
Posts: 477
Joined: Thu Jul 15, 2021 6:10 pm

Re: 'TechDrawGui.MDIViewPage' object has no attribute 'getViewer'

Post by Evgeniy »

Export from TechDraw Workbench is works fine.
wmayer wrote: Sat Sep 18, 2021 6:23 am Maybe for the future it would be good to make things more flexible and support to export TechDraw objects with the Draft SVG exporter.
I think, this is certainly not critical yet.
But messagebox recommending the use of export from TechDraw would not hurt.
Post Reply