Issues rendering Arch labels in TechDraw view

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
psadauskas
Posts: 2
Joined: Thu Jan 20, 2022 8:49 pm

Issues rendering Arch labels in TechDraw view

Post by psadauskas »

I have a Arch plan with TechDraw page with a view of it. I have several Dimension labels, and those render fine. If I try to add a "Text" or "Label", however, it stops rendering the view in the page, and I get errors on the console.

Adding a "Label" gives me:

Code: Select all

16:00:19  DVS::onChanged - ��>j� - SVG for Symbol is not valid. See log.
16:00:19  Error - Could not load Symbol into SVG renderer for ArchView001
Adding a "Text" gives me:

Code: Select all

16:04:51  Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/.mount_FreeCARsKOei/usr/Mod/Arch/ArchSectionPlane.py", line 545, in getSVG
    svg += Draft.get_svg(d,
  File "/tmp/.mount_FreeCARsKOei/usr/Mod/Draft/draftfunctions/svg.py", line 676, in get_svg
    tstroke, fontsize, n,
<class 'UnboundLocalError'>: local variable 'tstroke' referenced before assignment
16:04:51  Recompute failed! Please check report view.
To reproduce, open the file in FreeCAD 0.20, and in the tree view, drag any of the labels to the "New" group. Opening the file in FreeCAD 0.19 and doing the same works as expected.

OS: Fedora 34 (KDE Plasma) (KDE//usr/share/xsessions/plasmax11)
Word size of FreeCAD: 64-bit
Version: 0.20.27078 (Git) AppImage
Build type: Release
Branch: (HEAD detached at bcdd926)
Hash: bcdd926686f2245fe60baface1cce1ab3dff7a5b
Python version: 3.9.9
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: English/United States (en_US)
Attachments
foundation.FCStd
(499.24 KiB) Downloaded 19 times
User avatar
Roy_043
Veteran
Posts: 8537
Joined: Thu Dec 27, 2018 12:28 pm

Re: Issues rendering Arch labels in TechDraw view

Post by Roy_043 »

Confirmed.

This recent commit is the cause I think:
https://github.com/FreeCAD/FreeCAD/comm ... 5659f9ee4a

If you try to add an Arch_Axis object to the "New" group there is an error as well:

Code: Select all

10:23:58  Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\BKG_Tmp\FreeCAD_0.20_Last_Conda\Mod\Arch\ArchSectionPlane.py", line 545, in getSVG
    svg += Draft.get_svg(d,
  File "D:\BKG_Tmp\FreeCAD_0.20_Last_Conda\Mod\Draft\draftfunctions\svg.py", line 699, in get_svg
    tstroke, fontsize, fn,
<class 'UnboundLocalError'>: local variable 'tstroke' referenced before assignment
10:23:58  Recompute failed! Please check report view.
yorik wrote: pinged by pinger macro
Yorik can you have a look?

Code: Select all

OS: Windows 8.1 (6.3)
Word size of FreeCAD: 64-bit
Version: 0.20.26761 (Git)
Build type: Release
Python version: 3.8.12
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: Dutch/Netherlands (nl_NL)
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Issues rendering Arch labels in TechDraw view

Post by yorik »

Indeed there were cases where this tstroke stayed undefined. With git commit e6b7c0e5f9 both errors should be fixed
User avatar
Roy_043
Veteran
Posts: 8537
Joined: Thu Dec 27, 2018 12:28 pm

Re: Issues rendering Arch labels in TechDraw view

Post by Roy_043 »

Thanks.
alexF
Posts: 1
Joined: Tue Feb 22, 2022 5:16 pm

Re: Issues rendering Arch labels in TechDraw view

Post by alexF »

Hello,

First of all, thank you for developping FreeCAD!

I have probably a similar Problem with Draft Label in Techdraw.

Adding a Draft_Label gives me:

Code: Select all

18:09:51  Cette fonction sera obsolète. Veuillez utiliser 'get_svg'.
18:09:51  DVS::onChanged - H�T$L�D$L�L$ SUVW�8 - SVG for Symbol is not valid. See log.
18:09:51  Error - Could not load Symbol into SVG renderer for DraftView
18:09:51  Error - Could not load Symbol into SVG renderer for DraftView
to reproduce the error :

Code: Select all

### Begin command Std_Workbench
Gui.activateWorkbench("BIMWorkbench")
### End command Std_Workbench
Gui.runCommand('Draft_Label',0)
_label_ = Draft.make_label(target_point=FreeCAD.Vector(-1700.9262594208005, -837.9066751926948, 178.25038011410697), placement=FreeCAD.Placement(FreeCAD.Vector(674.7998387378136, 2029.951927218433, 2028.8143436701757), FreeCAD.Rotation(0.44601488682286866, 0.11950894873610823, 0.229574936987557, 0.8567868344100226)), label_type='Custom', direction='Horizontal', distance=-1957.09865195767)
# Gui.Selection.addSelection('Sans_nom','dLabel')
Draft.autogroup(_label_)
FreeCAD.ActiveDocument.recompute()
### Begin command Std_Workbench
Gui.activateWorkbench("TechDrawWorkbench")
### End command Std_Workbench
### Begin command TechDraw_PageDefault
App.activeDocument().addObject('TechDraw::DrawPage','Page')
App.activeDocument().addObject('TechDraw::DrawSVGTemplate','Template')
App.activeDocument().Template.Template = 'C:/Program Files/FreeCAD 0.20/data/Mod/TechDraw/Templates/A4_LandscapeTD.svg'
App.activeDocument().Page.Template = App.activeDocument().Template
App.ActiveDocument.recompute()
### End command TechDraw_PageDefault
### Begin command TechDraw_DraftView
App.activeDocument().addObject('TechDraw::DrawViewDraft','DraftView')
App.activeDocument().DraftView.Source = App.activeDocument().dLabel
App.activeDocument().Page.addView(App.activeDocument().DraftView)
App.activeDocument().DraftView.Direction = FreeCAD.Vector(0.410,-0.709,0.574)
App.ActiveDocument.recompute()
### End command TechDraw_DraftView
# Gui.Selection.clearSelection()
# Gui.Selection.addSelection('Sans_nom','DraftView')
Draft_label_techdraw_problem.FCStd
(22.88 KiB) Downloaded 3 times
OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.20.27422 (Git)
Build type: Release
Branch: master
Hash: d938733eaf2c2ce7cb18d1cbb56147185c473530
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: French/Switzerland (fr_CH)
Coordialement,
Post Reply