[ Fixed ] [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Discussions about the development of the TechDraw workbench
User avatar
Roy_043
Posts: 1382
Joined: Thu Dec 27, 2018 12:28 pm

[ Fixed ] [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by Roy_043 » Mon May 18, 2020 8:23 pm

It seems that TechDraw_DraftView does not recognize Draft objects anymore. Is this a known issue?

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21097 (Git)
Build type: Release
Branch: master
Hash: a5ab09aa0941cc945e59848897b160f8cbfc0831
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
Last edited by Roy_043 on Sun May 31, 2020 10:11 am, edited 1 time in total.

vocx
Posts: 4296
Joined: Thu Oct 18, 2018 9:18 pm

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by vocx » Mon May 18, 2020 11:00 pm

Roy_043 wrote:
Mon May 18, 2020 8:23 pm
It seems that TechDraw_DraftView does not recognize Draft objects anymore. Is this a known issue?
This seems to be the same problem, which was already solved in the master code.

[regression] Draft Dims & Annotation not working with ArchSections + Techdraw

Why do you post here? If you posted in the Draft forum you would get more visibility when it's about Draft problems.

Also, you should always list the steps to reproduce the problem, even if you think they are obvious.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.

User avatar
regis
Posts: 716
Joined: Sun Jul 12, 2015 8:17 am
Contact:

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by regis » Tue May 19, 2020 12:23 am

vocx wrote:
Mon May 18, 2020 11:00 pm
Draft forum
show me where this is because I searched for it, but ended up posting in the "DRAFT, Arch & Bim" forum
My bad if i'm contributing to poor organising of posts and bug reporting

User avatar
Roy_043
Posts: 1382
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by Roy_043 » Tue May 19, 2020 7:20 am

vocx wrote:
Mon May 18, 2020 11:00 pm
[regression] Draft Dims & Annotation not working with ArchSections + Techdraw
No I don't think that is the same issue.

Scenario:
  1. Create a Draft_Rectangle.
  2. Switch to the TechDraw WB.
  3. Create a default page.
  4. Select the rectangle in the tree.
  5. Invoke TechDraw_DraftView.
  6. Result: Alert dialog: "There were no DraftWB objects in the selection".

carlopav
Posts: 1364
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by carlopav » Tue May 19, 2020 7:45 am

Definitely it's not the same issue...
follow my experiments on BIM modelling for architecture design

Syres
Posts: 704
Joined: Thu Aug 09, 2018 11:14 am

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by Syres » Tue May 19, 2020 8:55 am

I can help narrow down when the regression was introduced. The last build when it worked as expected was:

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20839 (Git)
Build type: Release
Branch: master
Hash: 09005766f10539dfe32314c33c2cd3efe9141d0b
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)

and the first build I have when it stopped working is:

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20887 (Git)
Build type: Release
Branch: master
Hash: 42c56d9fef82b484448e3730eb7da69c48fe1374
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)

So sometime end of April/early May is when the regression was introduced. A quick look of the code in src/Mod/TechDraw/Gui/Command.cpp around line 1089, it would appear (I've not done any debugging) that it doesn't recognise the rectangle as DrawGuiUtil::isDraftObject type, has this changed?

Code: Select all

    int draftItemsFound = 0;
    for (std::vector<App::DocumentObject*>::iterator it = objects.begin(); it != objects.end(); ++it) {
        if (DrawGuiUtil::isDraftObject((*it)))  {
            draftItemsFound++;
Edit: Looks like this is the cause, the top Proxy is from build 0.19.20839 and the lower one from 0.19.20887:
DraftProxyDiff.jpg
DraftProxyDiff.jpg (16.52 KiB) Viewed 308 times

Syres
Posts: 704
Joined: Thu Aug 09, 2018 11:14 am

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by Syres » Tue May 19, 2020 10:07 am

Is it as easy as changing line 168 in src/Mod/Techdraw/Gui/DrawGuiUtil.cpp from:

Code: Select all

                        if (ss.str().find("Draft") != std::string::npos) {
to:

Code: Select all

                        if (ss.str().find("draftobjects") != std::string::npos) {
or is that bad?

vocx
Posts: 4296
Joined: Thu Oct 18, 2018 9:18 pm

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by vocx » Tue May 19, 2020 1:17 pm

Syres wrote:
Tue May 19, 2020 10:07 am
Is it as easy as changing line 168 in src/Mod/Techdraw/Gui/DrawGuiUtil.cpp from:

Code: Select all

                        if (ss.str().find("draftobjects") != std::string::npos) {
wandererfan wrote: ping
It seems this one is on TechDraw.
Always add the important information to your posts if you need help.
To support the documentation effort, and code development, your donation is appreciated: paypal.

User avatar
Roy_043
Posts: 1382
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by Roy_043 » Tue May 19, 2020 2:13 pm

vocx wrote:
Tue May 19, 2020 1:17 pm
It seems this one is on TechDraw.
So my topic got moved to the wrong forum! :lol:

chrisb
Posts: 25164
Joined: Tue Mar 17, 2015 9:14 am

Re: [ Bug ] TechDraw_DraftView does not recognize Draft objects anymore

Post by chrisb » Tue May 19, 2020 3:49 pm

Moved it to where I wanted to move it in the first place.

Post Reply