[ Fixed ] No such command 'Draft_Edit'

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
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

[ Fixed ] No such command 'Draft_Edit'

Post by Roy_043 »

If the Draft WB has not been loaded and you double-click on a Draft Wire the following error is reported:
16:29:54 Traceback (most recent call last):
File "D:\BKG_Tmp\FreeCAD_0.20_Last\Mod\Draft\draftviewproviders\view_base.py", line 392, in setEdit
Gui.runCommand("Draft_Edit")
<class 'Base.FreeCADError'>: No such command 'Draft_Edit'

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.24986 (Git)
Build type: Release
Branch: master
Hash: ff6845e2f31988cc714027980e0100bb5521843e
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.0
Locale: Dutch/Netherlands (nl_NL)
Last edited by Roy_043 on Fri Sep 24, 2021 4:32 pm, edited 1 time in total.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [ Bug ] No such command 'Draft_Edit'

Post by carlopav »

I think something has changed from previous FC versions. I find current behaviour correct: if Draft WB is not loaded, then the command should not be activated.
I propose to add a warning message to tell the user he has to activate Draft.
https://github.com/carlopav/FreeCAD/com ... 11a2673183
follow my experiments on BIM modelling for architecture design
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] No such command 'Draft_Edit'

Post by Roy_043 »

carlopav wrote: Sat Jun 05, 2021 3:40 pm if Draft WB is not loaded, then the command should not be activated
Although this does makes sense it is not consistent.

If you double-click a Part_Box when the Part WB has not been loaded there is no such message and the appropriate task panel opens.

If you double-click an Arch_Window the BIM WB is loaded (maybe if BIM is not installed the Arch WB is loaded instead?) and again the appropriate task panel opens.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [ Bug ] No such command 'Draft_Edit'

Post by carlopav »

hmmm I do not think those objects are supposed to launch a command of a specific workbench when setEdit() is executed, but just open a task panel (that for Arch is defined and pointed directly from the object)... maybe there could be a difference because of that?
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [ Bug ] No such command 'Draft_Edit'

Post by carlopav »

Roy_043 wrote: Sat Jun 05, 2021 3:58 pm
carlopav wrote: Sat Jun 05, 2021 3:40 pm if Draft WB is not loaded, then the command should not be activated
Although this does makes sense it is not consistent.

If you double-click a Part_Box when the Part WB has not been loaded there is no such message and the appropriate task panel opens.

If you double-click an Arch_Window the BIM WB is loaded (maybe if BIM is not installed the Arch WB is loaded instead?) and again the appropriate task panel opens.
in alternative we could load Draft workbench:

Code: Select all

        if mode == 0 and App.GuiUp: #remove guard after splitting every viewprovider
            import DraftTools
            Gui.runCommand("Draft_Edit")

https://github.com/carlopav/FreeCAD/com ... t-52406529

if it's ok for you you could make the change and create a PR :)
follow my experiments on BIM modelling for architecture design
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] No such command 'Draft_Edit'

Post by Roy_043 »

carlopav wrote: Sun Jun 20, 2021 7:50 am if it's ok for you you could make the change and create a PR
Credit where credit is due, I'll leave this one in your capable hands! But don't worry: It is certainly my intention to try to address some of the other bugs I have reported.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] No such command 'Draft_Edit'

Post by Roy_043 »

https://github.com/FreeCAD/FreeCAD/pull/5058

The new Std_UserEditMode command also required a change to the unsetEdit function.
User avatar
Roy_043
Veteran
Posts: 8450
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Fixed ] No such command 'Draft_Edit'

Post by Roy_043 »

Merged.
Post Reply