Extension tools: Dimensions initially not nested in View

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8552
Joined: Thu Dec 27, 2018 12:28 pm

Extension tools: Dimensions initially not nested in View

Post by Roy_043 »

The dimensions created by the Extension tools are initially not nested in the View. See image. Clicking in the view fixes this. Not a big issue, but confusing none the less.

Code: Select all

OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of FreeCAD: 64-bit
Version: 0.20.27129 (Git)
Build type: Release
Branch: master
Hash: fcaa698be874323ae26b20d7adf92214989c2d38
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: Dutch/Netherlands (nl_NL)
Attachments
td-dims-unnested.png
td-dims-unnested.png (5.94 KiB) Viewed 1309 times
User avatar
wandererfan
Veteran
Posts: 6321
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Extension tools: Dimensions initially not nested in View

Post by wandererfan »

edi wrote:ping
edi
Posts: 482
Joined: Fri Jan 17, 2020 1:32 pm

Re: Extension tools: Dimensions initially not nested in View

Post by edi »

wandererfan wrote: pinged by pinger macro
@wandererfan: The issue can be solved easy, see CommandCreateDims.cpp

Code: Select all

676    //Horrible hack to force Tree update
677    double x = objFeat->X.getValue();
678    objFeat->X.setValue(x);
Is there no better solution ? Shall I make a PR ?
User avatar
wandererfan
Veteran
Posts: 6321
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Extension tools: Dimensions initially not nested in View

Post by wandererfan »

edi wrote: Wed Feb 02, 2022 2:43 pm @wandererfan: The issue can be solved easy, see CommandCreateDims.cpp

Code: Select all

676    //Horrible hack to force Tree update
677    double x = objFeat->X.getValue();
678    objFeat->X.setValue(x);
Is there no better solution ? Shall I make a PR ?
"updateActive()" after "commitCommand()" might do it and would look nicer, but might introduce an extra document level recompute.

The trick is to cause objFeat's view provider to execute claimChildren. There is probably a cleaner way.
edi
Posts: 482
Joined: Fri Jan 17, 2020 1:32 pm

Re: Extension tools: Dimensions initially not nested in View

Post by edi »

wandererfan wrote: Wed Feb 02, 2022 3:38 pm "updateActive()" after "commitCommand()" might do it ...
... sadly, does not cause anything.
Post Reply