dialogRunning the Python command 'Draft_ShapeString' failed

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
JackOfDiamonds
Posts: 8
Joined: Fri May 22, 2020 5:12 am

dialogRunning the Python command 'Draft_ShapeString' failed

Post by JackOfDiamonds »

I am trying to model for the first time using text.

I am following YouTube videos which explain how to use ShapeString. However, when I click on ShapeString, I get a python error as below. I am not sure if this is an install/configuration problem with my FreeCAD install, or a bug or something else. How should I go about trying to fix this?

OS: Linux Mint 21 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.10.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)

Code: Select all

dialogRunning the Python command 'Draft_ShapeString' failed:
Traceback (most recent call last):
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_shapestrings.py", line 75, in Activated
    super(ShapeString, self).Activated(name)
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_base_original.py", line 290, in Activated
    super(Creator, self).Activated(name, noplanesetup)
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_base_original.py", line 154, in Activated
    Gui.Snapper.setTrackers()
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_snapper.py", line 1679, in setTrackers
    self.grid = trackers.gridTracker()
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_trackers.py", line 974, in __init__
    pick.style.setValue(coin.SoPickStyle.UNPICKABLE)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3989, in __getattr__
    field = self.getField(name)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3873, in getField
    return _coin.SoFieldContainer_getField(self, name)

<built-in function SoFieldContainer_getField> returned a result with an exception set
Thanks for the help
kradion
Posts: 2
Joined: Mon Feb 06, 2023 9:32 pm

Re: dialogRunning the Python command 'Draft_ShapeString' failed

Post by kradion »

The issue seems to be more widespread. I get the same error when using most commands in the Draft WB (move, rotate, scale, mirror). I report a sample error below. It seems something is wrong with the pivy library.

OS: Ubuntu 22.04.1 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Python version: 3.10.2
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/United States (en_US)

Code: Select all

22:30:34  Running the Python command 'Draft_Scale' failed:
Traceback (most recent call last):
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_scale.py", line 77, in Activated
    super(Scale, self).Activated(name=self.name)
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_base_original.py", line 154, in Activated
    Gui.Snapper.setTrackers()
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_snapper.py", line 1679, in setTrackers
    self.grid = trackers.gridTracker()
  File "/usr/share/freecad/Mod/Draft/draftguitools/gui_trackers.py", line 974, in __init__
    pick.style.setValue(coin.SoPickStyle.UNPICKABLE)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3989, in __getattr__
    field = self.getField(name)
  File "/usr/lib/python3/dist-packages/pivy/coin.py", line 3873, in getField
    return _coin.SoFieldContainer_getField(self, name)

<built-in function SoFieldContainer_getField> returned a result with an exception set
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: dialogRunning the Python command 'Draft_ShapeString' failed

Post by Roy_043 »

Suggest you both upgrade to V0.20.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: dialogRunning the Python command 'Draft_ShapeString' failed

Post by onekk »

Maybe using an AppImage, as from what I know from many forum messages Ubuntu supplied packages are not very reliable.

And There is this warning in:

https://wiki.freecad.org/Installing_on_ ... PA_version
Warning: The FreeCAD PPA is currently unmaintained and looking for volunteers. Please use an alternative (snap, appimage) until the issue is fixed!
Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
mconsidine
Posts: 125
Joined: Wed Jan 18, 2023 10:41 pm
Location: Randolph, VT USA

Re: dialogRunning the Python command 'Draft_ShapeString' failed

Post by mconsidine »

What version of pivy is installed? On my Linuxint install I think v 0.6.5 was the latest in the repository. But a debian version of the latest at 0.6.8 installed and seems to be working fine. I had seen similare errors because I also had versions installed in different paths.
mconsidine
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: dialogRunning the Python command 'Draft_ShapeString' failed

Post by onekk »

mconsidine wrote: Tue Feb 07, 2023 11:54 am What version of pivy is installed? On my Linuxint install I think v 0.6.5 was the latest in the repository. But a debian version of the latest at 0.6.8 installed and seems to be working fine. I had seen similare errors because I also had versions installed in different paths.
mconsidine
The point is that if you install an AppImage as suggested by FreeCAD page it is working as expected, PPA has problems and is not maintained, if you use a distribution supplied version of FC you have to report error to the distribution packager, and not here.

Plus 0.19 is not maintained anymore and even if is buggy it will not receive updates.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
kradion
Posts: 2
Joined: Mon Feb 06, 2023 9:32 pm

Re: dialogRunning the Python command 'Draft_ShapeString' failed

Post by kradion »

I confirm the AppImage of version 0.20.2 solved the problem. All errors are gone. Thanks for the suggestion.

I naively assumed the Ubuntu package was maintained and up to date. My bad. :)
Post Reply