Error in Arch Gui Tool "Edit standard code"

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
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Error in Arch Gui Tool "Edit standard code"

Post by bernd »

To be confirmed:

- start FC
- switch to Arch
- add a structure
- double click on the structure
- in edit standard code click on "Edit standard code"

Error:

Code: Select all

08:12:55  Traceback (most recent call last):
08:12:55    File "/home/hugo/Documents/dev/freecad/freecadbhb_dev/build/Mod/Arch/ArchComponent.py", line 2236, in editClass
08:12:55      FreeCADGui.runCommand("BIM_Classification")
08:12:55  Base.FreeCADError: No such command 'BIM_Classification'

OS: Debian GNU/Linux 10 (buster) (KDE//usr/share/xsessions/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23760 (Git)
Build type: Unknown
Branch: femtmp
Hash: e5ded437e397eb52af5776bc589b5b2c0a9704e3
Python version: 3.7.3
Qt version: 5.11.3
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error in Arch Gui Tool "Edit standard code"

Post by bernd »

the button will only be displayed if the command

Code: Select all

import BimClassification
does not return an error. The module BimClassification is part of BIM workbench

On click on the button the following Python command is invoked

Code: Select all

FreeCADGui.runCommand("BIM_Classification")
I did update the BIM workbench but still ...

Code: Select all

>>> 
>>> import BimClassification
>>> FreeCADGui.runCommand("BIM_Classification")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
Base.FreeCADError: No such command 'BIM_Classification'
>>> 
yorik wrote: :bell:
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error in Arch Gui Tool "Edit standard code"

Post by bernd »

Am I the only one with this problem?
User avatar
Roy_043
Veteran
Posts: 8579
Joined: Thu Dec 27, 2018 12:28 pm

Re: Error in Arch Gui Tool "Edit standard code"

Post by Roy_043 »

Confirmed. Switching to the BIM WB solves the problem.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error in Arch Gui Tool "Edit standard code"

Post by bernd »

Roy_043 wrote: Mon Feb 15, 2021 10:46 am Confirmed. Switching to the BIM WB solves the problem.
here too ... even in Python

Code: Select all

import BimClassification
FreeCADGui.runCommand("BIM_Classification")
Gui.activateWorkbench("BIMWorkbench")
import BimClassification
FreeCADGui.runCommand("BIM_Classification")

Code: Select all

>>>
>>> import BimClassification
>>> FreeCADGui.runCommand("BIM_Classification")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
Base.FreeCADError: No such command 'BIM_Classification'
>>> Gui.activateWorkbench("BIMWorkbench")
True
>>> Gui.runCommand('Std_Workbench',4)
>>> import BimClassification
>>> FreeCADGui.runCommand("BIM_Classification")
>>> 
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error in Arch Gui Tool "Edit standard code"

Post by bernd »

on activation of the workbench the command BIM_Classification is added to FreeCADGui

https://github.com/yorikvanhavre/BIM_Wo ... ui.py#L144

just a test ...

Code: Select all

import BimClassification
FreeCADGui.addCommand('BIM_Classification',BimClassification.BIM_Classification())
FreeCADGui.runCommand("BIM_Classification")
thus we need to add the command or activate the BIM workbench here https://github.com/FreeCAD/FreeCAD/blob ... t.py#L1729 before run the command
User avatar
Roy_043
Veteran
Posts: 8579
Joined: Thu Dec 27, 2018 12:28 pm

Re: Error in Arch Gui Tool "Edit standard code"

Post by Roy_043 »

bernd wrote: Mon Feb 15, 2021 1:27 pm thus we need to add the command or activate the BIM workbench here https://github.com/FreeCAD/FreeCAD/blob ... t.py#L1729 before run the command
It would be strange to have a function of the Arch WB depend on the external BIM WB.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error in Arch Gui Tool "Edit standard code"

Post by bernd »

Roy_043 wrote: Mon Feb 15, 2021 2:47 pm
bernd wrote: Mon Feb 15, 2021 1:27 pm thus we need to add the command or activate the BIM workbench here https://github.com/FreeCAD/FreeCAD/blob ... t.py#L1729 before run the command
It would be strange to have a function of the Arch WB depend on the external BIM WB.
I actually relies on the external BIM workbench. The icon is grey if the workbench is not installed. This has been working so far for a long time already.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Error in Arch Gui Tool "Edit standard code"

Post by bernd »

Post Reply