BIM upon FC load fails to find handle - suggest classname error

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
PMac
Posts: 135
Joined: Sat Sep 02, 2017 10:44 pm

BIM upon FC load fails to find handle - suggest classname error

Post by PMac »

Hi,
Upon installing BIM addon via Addon manager, upon opening FC reports the following:

Code: Select all

07:59:54  Init:      Initializing /home/user5/.local/share/FreeCAD/Mod/BIM/./... done
07:59:54  Failed to get handle to BIM -- no icon can be generated, check classname in package.xml
07:59:54  Init:      Initializing /home/user5/.local/share/FreeCAD/Mod/BIM.backup1663099179.6010296(InitGui.py not found)... ignore
Firstly, it appears that BIM adds an unexpected empty backup folder. (see my machine details below re Installed mods below) Why the backup folder?
FC attempts to initialise this backup folder but fails because there's nothing in it.
To test further, I uninstalled BIM, deleted the local folders left in /home/user5/.local/share/FreeCAD/Mod and cleanly re-installed it via the AddOn Manager with similar results.

Secondly, it appears that the definition of <classname> in package.xml ("BIM") does not match the given classname in InitGui.py ("BIMWorkbench").
This difference in <classname> contradicts that as given for package.xml as detailed https://wiki.freecadweb.org/Package_Metadata.
Temporarily changing the <classname> locally in package.xml to "BIMWorkbench" gets rid of this issue.


As always the machine details at the bleeding edge:

Code: Select all

OS: Linux Mint 20.3 (X-Cinnamon/cinnamon2d)
Word size of FreeCAD: 64-bit
Version: 0.21.30362 (Git)
Build type: Release
Branch: master
Hash: 061ec7f7b4b77f26c17e11c4fb0f83d3e0f95fe8
Python 3.8.10, Qt 5.12.8, Coin 4.0.1, Vtk 7.1.1, OCC 7.3.0
Locale: English/New Zealand (en_NZ)
Installed mods: 
  * BIM 2021.12.0
  * BIM.backup1663099179.6010296
Syres
Veteran
Posts: 2899
Joined: Thu Aug 09, 2018 11:14 am

Re: BIM upon FC load fails to find handle - suggest classname error

Post by Syres »

Confirmed:

Code: Select all

OS: Linux Mint 20.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.21.30373 (Git)
Build type: Release
Branch: master
Hash: 8ed0ba5e453f081bab523267fc0d0105ee0e083b
Python 3.8.10, Qt 5.12.8, Coin 4.0.0, Vtk 7.1.1, OCC 7.3.0
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * ExtremeProDark.backup1663146276.8615105
  * A2plus 0.4.59
  * BIM.backup1663169429.278126
  * BIM 2021.12.0
  * Curves 0.5.8
  * ExtremeProDark 1.0.4
  * Plot 2022.4.17
  * fasteners 0.4.6
  * sheetmetal 0.2.57
@chennes I assume you're aware, do all the Wb authors have to update/correct their package.xml files to stop this being reported many times or is this a special case?
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: BIM upon FC load fails to find handle - suggest classname error

Post by chennes »

Two points -

First, BIM isn't making that backup, the Addon Manager is. It's not appropriately deleting the containing directory when it should.

Second, the classname not matching is only relevant for being able to load the icon "live" from the Mod, instead of the one compiled into FreeCAD. It's a minor error that shouldn't matter most of the time.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
PMac
Posts: 135
Joined: Sat Sep 02, 2017 10:44 pm

Re: BIM upon FC load fails to find handle - suggest classname error

Post by PMac »

Syres wrote: Wed Sep 14, 2022 3:36 pm ... or is this a special case?
Syres, thanks for your confirmation.

From my end it would that this package issue could be affecting other Addons. I tried the Help addon yesterday with a similar outcome re the classname and the backup folder.
PMac
Posts: 135
Joined: Sat Sep 02, 2017 10:44 pm

Re: BIM upon FC load fails to find handle - suggest classname error

Post by PMac »

chennes wrote: Wed Sep 14, 2022 6:35 pm Two points -

... Addon Manager is. It's not appropriately deleting the containing directory when it should.

... It's a minor error that shouldn't matter most of the time.
Thanks for your reply.

I suspect that the ./local/share folder does not have the correct rights for the AddOn manager to delete the backup folder.

An aside, I have seen other one-off messages I've ignored and not reported, particularly around Techdraw template changes/updates being unable to be deleted or updated due to read-only access. Often wondered what caused those, you may have exposed a related cause of those issues. Will now watch those failed attempts more closely, especially if there are any .local folders being utilised, when they occur.

BTW - I do not have FC installed as most would at v0.20 but run it directly from the local 0.21 bleeding edge compilation after doing a git pull to get the latest. When addons occur, the .local/share/FreeCAD/Mod folders are in play.

Agree, it appears to be a minor fault but anyway thought I'd better get around to reporting it in case it has any other ramifications.
User avatar
chennes
Veteran
Posts: 3906
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: BIM upon FC load fails to find handle - suggest classname error

Post by chennes »

Thanks for the bug report - I sent @yorik a PR with the fix. https://github.com/yorikvanhavre/BIM_Workbench/pull/96
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
yorik
Founder
Posts: 13660
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: BIM upon FC load fails to find handle - suggest classname error

Post by yorik »

Merged ;) thanks!!
Post Reply