Issue #4370. Bug: duplicated window object when using expression with wall width

A forum dedicated to the Draft, Arch and BIM workbenches development.
Post Reply
vocx
Veteran
Posts: 5205
Joined: Thu Oct 18, 2018 9:18 pm

Issue #4370. Bug: duplicated window object when using expression with wall width

Post by vocx »

This is reported as issue #4370.

Code: Select all

OS: Ubuntu 18.04.4 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21375 (Git)
Build type: Unknown
Branch: master
Hash: 11f9c249e764b27c78afd9b0a0de5acb3f05f760
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
1. Click on Arch Wall, and create a wall 3 m, 3 m, and 0.2 m. The wall should be big enough to hold a standard window.
2. Click on Arch Window, Fixed, and place it on the wall.
3. In the tree view click on the Window, go to the property editor, choose "Hole Depth", and click on the rightmost "f(x)" symbol to set an expression (expressions).
4. The expression is just the Wall's width, so enter Wall.Width in the expression field, and click OK.
5. The Window will show the blue mark indicating the need for recomputing, so recompute, F5 (Std_Refresh).
6. The Wall doesn't show a blue mark. Nevertheless, right click on it on the tree view, and then choose "Recompute object".
7. The Window will appear a second time in the tree view. There will be two windows, and both will have the blue checkmark.
Also the following warning appears in the report view.

Code: Select all

856.501 Tree.cpp(293): [ComboView] duplicate child item Unnamed#Wall.Window
The two windows refer to the same Window object. Toggling the visibility (Space bar) turns both on and off. If you delete one, you delete both.

The issue here is the sort of circular dependency that exists between the Wall and the Window. The Window sets its width by looking at the Wall, and the Wall also looks at the Window. Maybe the error is in the Wall code, or somewhere in the tree view code in C++.

This was originally found here, Arch: window creates an extra hole in a different part of the wall in addition to the actual window.
Last edited by vocx on Thu Jun 11, 2020 5:21 pm, edited 1 time in total.
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: 2032
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Bug: duplicated window object when using expression with wall width

Post by carlopav »

Confirmed with current upstream master.
follow my experiments on BIM modelling for architecture design
User avatar
yorik
Founder
Posts: 12802
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Bug: duplicated window object when using expression with wall width

Post by yorik »

Objects can appear many times in the tree view, that's normal.
But the recomputation indeed has something weird, I'll have a better look. In any case, the expression engine works with the dependency tree, so if there was a circular dependency, you'd see it in the dag view, so it's probably not the case
User avatar
Roy_043
Veteran
Posts: 5079
Joined: Thu Dec 27, 2018 12:28 pm

Re: Issue #4370. Bug: duplicated window object when using expression with wall width

Post by Roy_043 »

It seems this has somehow been fixed. I can't reproduce with:

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24219 (Git)
Build type: Release
Branch: master
Hash: 8c26baebab320b8c1c3279bc8eb34a1eb6c7a363
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)
User avatar
Kunda1
Veteran
Posts: 12575
Joined: Thu Jan 05, 2017 9:03 pm

Re: Issue #4370. Bug: duplicated window object when using expression with wall width

Post by Kunda1 »

Bumping for testers (see issue #6074)
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Roy_043
Veteran
Posts: 5079
Joined: Thu Dec 27, 2018 12:28 pm

Re: Issue #4370. Bug: duplicated window object when using expression with wall width

Post by Roy_043 »

I still can't reproduce. IMO the issue can be closed.
See https://github.com/FreeCAD/FreeCAD/issu ... 1117048810
Post Reply