Draft Edit improvements

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Syres
Veteran
Posts: 2902
Joined: Thu Aug 09, 2018 11:14 am

Re: Draft Edit improvements

Post by Syres »

carlopav wrote: Wed May 27, 2020 6:45 pm this one is dedicated to Draft_edit
Possible bug, when testing @vocx single dimension file https://forum.freecadweb.org/viewtopic.php?f=3&t=46459, on double-clicking the dimension in the tree, I noticed this error. I don't think it's directly related to the crash/error @vocx reported but waited for very recent build to confirm:

Code: Select all

Traceback (most recent call last):
  File "E:\Data\My Downloads\FreeCAD_0.19.21325_x64_LP_12.1.6_PY3QT5-WinVS2015\FreeCAD_0.19.21325_x64_LP_12.1.6_PY3QT5-WinVS2015\Mod\Draft\draftviewproviders\view_dimension.py", line 185, in doubleClicked
    self.setEdit(vobj)
  File "E:\Data\My Downloads\FreeCAD_0.19.21325_x64_LP_12.1.6_PY3QT5-WinVS2015\FreeCAD_0.19.21325_x64_LP_12.1.6_PY3QT5-WinVS2015\Mod\Draft\draftviewproviders\view_draft_annotation.py", line 92, in setEdit
    Gui.runCommand("Draft_Edit")
<class 'Base.FreeCADError'>: No such command 'Draft_Edit'
It's as if the Draft commands are not available unless the Wb is activated but am I correct in thinking this wasn't always the case?

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21325 (Git)
Build type: Release
Branch: master
Hash: 2cb9b147f13419f019f9808ace21d3d2ceae99c5
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Draft Edit improvements

Post by vocx »

Syres wrote: Sat May 30, 2020 4:35 pm ...
It's as if the Draft commands are not available unless the Wb is activated but am I correct in thinking this wasn't always the case?
You are correct. The Draft commands are not available to the system until the workbench is loaded.

A workbench is defined by the Init.py and InitGui.py.

When you switch to a workbench, it runs the InitGui.py, and actually loads the DraftTools.py module which is the one containing all the Draft Gui Commands. This has always been the case that I know of.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Draft Edit improvements

Post by carlopav »

Yes, it should be like this, but do you remember that bug about the Snapper being loaded before Draft was activated?
@Syres, in 0.18 was it possible to edit a Draft Object also if Draft WB was not activated before?
follow my experiments on BIM modelling for architecture design
Syres
Veteran
Posts: 2902
Joined: Thu Aug 09, 2018 11:14 am

Re: Draft Edit improvements

Post by Syres »

carlopav wrote: Sun May 31, 2020 7:46 am @Syres, in 0.18 was it possible to edit a Draft Object also if Draft WB was not activated before?
Definitely, the only way to best prove the point was to create the attached file in 0.17 and then try and edit the dimension in 0.18.4 which I can without activating the Draft Wb as well as the build below so it's a regression IMHO. Even if it wasn't supposed to operate as I describe, then surely there should be a more graceful error message such as 'Please Activate the Draft Workbench'?

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20036 (Git)
Build type: Release
Branch: master
Hash: 953ae1e6e917fa6860564c80fdc1f20950a5c0ac
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Attachments
TestDraftStuff.FCStd
(6.18 KiB) Downloaded 49 times
Post Reply