cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
nelsonic
Posts: 15
Joined: Thu May 25, 2023 7:37 am
Location: Braga, Portugal
Contact:

cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by nelsonic »

Was happily using FreeCAD Arch Workbench to create a fairly simply model.
But just got the following error:

cannot import name
'_ArchStructureGroupCommand' from 'ArchStructure' (/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchStructure.py)

Image

Image


Log in the report view:

Code: Select all

14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 177, in attach
    self.onChanged(vobj, "Pattern")
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 288, in onChanged
    if path and vobj.RootNode:
<class 'RuntimeError'>: No SWIG wrapped library loaded
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 288, in onChanged
    if path and vobj.RootNode:
<class 'RuntimeError'>: No SWIG wrapped library loaded
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 288, in onChanged
    if path and vobj.RootNode:
<class 'RuntimeError'>: No SWIG wrapped library loaded
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Draft/draftviewproviders/view_base.py", line 288, in onChanged
    if path and vobj.RootNode:
<class 'RuntimeError'>: No SWIG wrapped library loaded
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1600, in attach
    image = Draft.loadTexture(Draft.svgpatterns()['simple'][1], 128)
<class 'KeyError'>: ('simple',)
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1694, in setDisplayMode
    self.fset.coordIndex.deleteValues(0)
<class 'AttributeError'>: '_ViewProviderWall' object has no attribute 'fset'
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1694, in setDisplayMode
    self.fset.coordIndex.deleteValues(0)
<class 'AttributeError'>: '_ViewProviderWall' object has no attribute 'fset'
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1600, in attach
    image = Draft.loadTexture(Draft.svgpatterns()['simple'][1], 128)
<class 'KeyError'>: ('simple',)
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1694, in setDisplayMode
    self.fset.coordIndex.deleteValues(0)
<class 'AttributeError'>: '_ViewProviderWall' object has no attribute 'fset'
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1694, in setDisplayMode
    self.fset.coordIndex.deleteValues(0)
<class 'AttributeError'>: '_ViewProviderWall' object has no attribute 'fset'
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1600, in attach
    image = Draft.loadTexture(Draft.svgpatterns()['simple'][1], 128)
<class 'KeyError'>: ('simple',)
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1694, in setDisplayMode
    self.fset.coordIndex.deleteValues(0)
<class 'AttributeError'>: '_ViewProviderWall' object has no attribute 'fset'
14:06:48  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1694, in setDisplayMode
    self.fset.coordIndex.deleteValues(0)
<class 'AttributeError'>: '_ViewProviderWall' object has no attribute 'fset'
14:07:21  cannot import name '_ArchStructureGroupCommand' from 'ArchStructure' (/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchStructure.py)
14:07:21  Traceback (most recent call last):
  File "<string>", line 57, in Initialize
Tried Googling for this error but only got 2 results neither of which were relevant to FreeCAD ...
Will keep searching but if anyone else has seen this error, please share the solution. Thanks.


Info:

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git)
Build type: Release
Branch: (HEAD detached at 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * BIM 2021.12.0
User avatar
nelsonic
Posts: 15
Joined: Thu May 25, 2023 7:37 am
Location: Braga, Portugal
Contact:

Re: cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by nelsonic »

Heading down the rabbit hole and installing the Weekly Build
https://github.com/FreeCAD/FreeCAD-Bund ... kly-builds

Instaling

Code: Select all

FreeCAD_weekly-builds-33321-2023-05-28-conda-macOS-x86_64-py311.dmg
(v0.21)
Expecting the Arch workbench to work again in this later version. 🤞
User avatar
nelsonic
Posts: 15
Joined: Thu May 25, 2023 7:37 am
Location: Braga, Portugal
Contact:

Re: cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by nelsonic »

Sadly, still getting the same error ...

Image

Code: Select all

OS: macOS 13.3.1
Word size of FreeCAD: 64-bit
Version: 0.21.0.33321 (Git)
Build type: Release
Branch: master
Hash: 1d61ed187c9633702818c6cc5d7a1f07dd052ca8
Python 3.11.3, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.2, OCC 7.7.1
Locale: C/Default (C)
Installed mods: 
  * BIM 2021.12.0
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by Roy_043 »

Why the super high-res screenshots? They do not contain more information than the text you provide, they only cost bandwidth.
User avatar
nelsonic
Posts: 15
Joined: Thu May 25, 2023 7:37 am
Location: Braga, Portugal
Contact:

Re: cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by nelsonic »

Hi @Roy_043, thanks for your reply.

Included screenshots for context. As a software engineer, I've gotten used to always posting a screenshot of the UI/UX for context when filing bugs to help fellow engineers get as much info as possible when triaging the issue.

The screen shots shared in this thread show my toolbar layout and the relative simplicity/complexity of my project
without forcing anyone to waste time downloading and run the project files.
Never occurred to me that it would be an issue. Apologies if it has caused offence. 😞

My understanding was that bandwidth constrained people would always have automatic image loading disabled in their browser and then view images selectively; is that not the case?

For anyone else reading this in the future, the official guidance for asking for help: viewtopic.php?f=3&t=2264
[section 6] states: "and screen captures can also be useful." ... perhaps it should be clarified to "avoid excessively high resolution" ... 💭

The resolution of screenshots is just my default monitor resolution (4k) which is fairly standard for CAD in 2023 ... 🖥️
Not going out of my way to make them super high res.
But will certainly be more mindful of resolution and drag my FreeCAD window to a different (lower res) monitor before taking the screen shots.

Thanks again. 😊
User avatar
nelsonic
Posts: 15
Joined: Thu May 25, 2023 7:37 am
Location: Braga, Portugal
Contact:

Re: cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by nelsonic »

Meanwhile, back to the topic of this thread ...

This is the log from the report view:

Code: Select all

16:45:08  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1714, in setDisplayMode
    self.fset.coordIndex.deleteValues(0)
    ^^^^^^^^^
16:45:08  Traceback (most recent call last):
  File "/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchWall.py", line 1714, in setDisplayMode
    self.fset.coordIndex.deleteValues(0)
    ^^^^^^^^^
16:45:28  Unknown command 'Draft_Hatch'
16:45:28  Unknown command 'Draft_Hatch'
16:46:08  Unknown command 'Arch_Wall'
16:46:08  Unknown command 'Arch_Component'
16:46:08  Unknown command 'Arch_Add'
16:46:08  Unknown command 'Arch_Remove'
16:46:08  Unknown command 'Draft_Array'
16:46:08  Unknown command 'Arch_Wall'
16:46:08  Unknown command 'Arch_Component'
16:46:08  Unknown command 'Arch_Add'
16:46:08  Unknown command 'Arch_Remove'
16:46:08  Unknown command 'Draft_Array'
16:46:08  Unknown command 'Arch_SplitMesh'
16:46:08  Unknown command 'Arch_MeshToShape'
16:46:08  Unknown command 'Arch_SelectNonSolidMeshes'
16:46:08  Unknown command 'Arch_RemoveShape'
16:46:08  Unknown command 'Arch_CloseHoles'
16:46:08  Unknown command 'Arch_MergeWalls'
16:46:08  Unknown command 'Arch_Check'
16:46:08  Unknown command 'Arch_ToggleIfcBrepFlag'
16:46:08  Unknown command 'Arch_ToggleSubs'
16:46:08  Unknown command 'Arch_Survey'
16:49:11  cannot import name '_ArchStructureGroupCommand' from 'ArchStructure' (/Applications/FreeCAD.app/Contents/Resources/Mod/Arch/ArchStructure.py)
16:49:11  Traceback (most recent call last):
  File "<string>", line 57, in Initialize
Version info:

Code: Select all

OS: macOS 13.3.1
Word size of FreeCAD: 64-bit
Version: 0.21.0.33321 (Git)
Build type: Release
Branch: master
Hash: 1d61ed187c9633702818c6cc5d7a1f07dd052ca8
Python 3.11.3, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.2, OCC 7.7.1
Locale: C/Default (C)
Installed mods: 
  * BIM 2021.12.0
Note: this is the weekly build. Downloaded it in the hope that Arch would work. Sadly it doesn't. (for me...)
Going to try switching to a different computer. 🧑‍💻
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by yorik »

This is weird... By your logs there is a whole bunch of your workbenches that are not working, not just ArchStructureGroupCommand...
I suspect coin is not working. Could you try this in the Python console of FreeCAD (menu View -> Panels -> Python console): (make sure you have a document opened)

Code: Select all

from pivy import coin
cube = coin.SoCube()
import FreeCADGui
sg = FreeCADGui.ActiveDocument.ActiveView.getSceneGraph()
sg.addChild(cube)
User avatar
nelsonic
Posts: 15
Joined: Thu May 25, 2023 7:37 am
Location: Braga, Portugal
Contact:

Re: cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by nelsonic »

Hi @yorik, 👋
Thanks for the reply. 👌
Apologies for not getting on this sooner, didn't get a notification for this and only seeing it now. ⏳

Weird indeed. Sometimes I feel like I'm cursed.
But then I remember I'm beta-testing software that isn't quite "1.0" and Free and I calm down and put down the hammer ... 😜

Had to lookup what

Code: Select all

coin
was to make sure nobody had hacked Yorik's account and was instructing me to run a crypto mining op on my machine ... https://github.com/coin3d/coin & https://wiki.freecad.org/Pivy for anyone else wondering. 💭

Anyway, ran the lines of python as instructed:

Image

Doesn’t appear to have any effect. What am I looking for? 🕵️ 🔍 🤷‍♂️

Version info:

Code: Select all

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git)
Build type: Release
Branch: (HEAD detached at 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: C/Default (C)
Installed mods: 
  * BIM 2021.12.0

Please note: I have since upgraded to using 0.21.0.33345 (weekly build) and no longer see this issue.

Code: Select all

OS: macOS 13.4
Word size of FreeCAD: 64-bit
Version: 0.21.0.33345 (Git)
Build type: Release
Branch: master
Hash: a3c4f4bb01f5201daf666852444a8f9c5adbda8d
Python 3.11.3, Qt 5.15.8, Coin 4.0.0, Vtk 9.2.2, OCC 7.7.1
Locale: C/Default (C)
Installed mods: 
  * BIM 2021.12.0
Still very happy to help debug this especially if it helps others overcome a similar issue in the future.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: cannot import name '_ArchStructureGroupCommand' from 'ArchStructure'

Post by yorik »

nelsonic wrote: Wed Jun 07, 2023 5:37 pm Doesn’t appear to have any effect. What am I looking for? 🕵️ 🔍 🤷‍♂️
You should see a small 1mmx1mmx1mm cube on screen... which is probably hidden behind your model. But not having any error appearing in the python console should mean that it works OK.

Ok that's not it then. In your latest screenshot you have all the Arch commands available, while in your logs:

Code: Select all

16:45:28  Unknown command 'Draft_Hatch'
16:45:28  Unknown command 'Draft_Hatch'
16:46:08  Unknown command 'Arch_Wall'
16:46:08  Unknown command 'Arch_Component'
16:46:08  Unknown command 'Arch_Add'
16:46:08  Unknown command 'Arch_Remove'
16:46:08  Unknown command 'Draft_Array'
...
Does it still happen? Or is the problem solved? I don't understand...

If the problem is still happening, can you provide step-by-step instructions of what you did for the error to happen? So we can try the same...
Post Reply