realthunder/FreeCAD_assembly3

`SystemError: <built-in function SoType_createInstance> returned a result with an exception set` when trying to do anything in asm3

kevenwyld opened this issue · 3 comments

Full text of error:

11:34:35  124.556615 <asm3.gui> constraint.py(828): constraint "Locked" command exception
SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 677, in report
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 2965, in make
    AsmElementLink.make(AsmElementLink.MakeInfo(cstr,*e))
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 2261, in make
    link.Proxy.setLink(info.Owner,info.Subname)
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 2119, in setLink
    element = AsmElement.make(sel,radius=radius,name='_Element')
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 1237, in make
    element = AsmElement.create(name,elements)
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 1048, in create
    ViewProviderAsmElement(element.ViewObject)
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 1290, in __init__
    super(ViewProviderAsmElement,self).__init__(vobj)
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 304, in __init__
    super(ViewProviderAsmOnTop,self).__init__(vobj)
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 253, in __init__
    self.attach(vobj)
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 1295, in attach
    self.setupAxis()
  File "/home/<username>/snap/freecad-realthunder/common_new/Mod/Assembly3/./freecad/asm3/assembly.py", line 1388, in setupAxis
    node = coin.SoType.fromName('SoFCSelectionRoot').createInstance()
  File "/snap/freecad-realthunder/127/usr/lib/python3/dist-packages/pivy/coin.py", line 491, in createInstance
    return _coin.SoType_createInstance(self)
SystemError: <built-in function SoType_createInstance> returned a result with an exception set

Steps to reproduce:

  1. Create a body, cube for example
  2. Create a new assembly using assembly3
  3. Add body to assembly
  4. Attempt to constrain a face of the cube with the Locked constraint

Freecad version (LinkStable branch) including version of asm3:

OS: Ubuntu Core 22 (sway/sway)
Word size of FreeCAD: 64-bit
Version: 2024.124.0.38947 (Git) Snap 127
Build type: Release
Branch: tag: 20240123stable
Hash: 0c0f69ad4806682096b51f7669d5f1cb83f9c7d7
Python 3.10.12, Qt 5.15.10, Coin 4.0.1rt, Vtk 7.1.1, OCC 7.7.1
Locale: English/United States (en_US)
Installed mods: 
  * Assembly3 0.12.0
  * Curves 0.6.21
  * fasteners 0.4.75

This was working in the previous release of LinkStable but there have been changes to both and since the error is generated by assembly3.py I figured it should go here.

Thanks for continuing development of asm3! It's in my opinion by far the best of the assembly workbenches.

@realthunder I think this needs to be moved over to https://github.com/realthunder/FreeCAD, I can only reproduce it on your fork. I'm not sure how best to do that though. Can you move the issue or should I close and re-open?

So, this seems to have something to do with my user configuration and I can't figure out what it is. I tried a fresh install of the snap by deleting all the snap cruft after removal and didn't reload my configuration and it's working now. But as soon as I import my configuration I get the above error.

Here's my config file

link.user.cfg.txt

Closing, took the time to remake my UI configuration from scratch and now everything works fine.