Building Part 'remembering' previous actions!

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
AndrewA
Posts: 67
Joined: Fri Oct 30, 2020 9:38 am
Location: UK

Building Part 'remembering' previous actions!

Post by AndrewA »

Code: Select all

OS: Debian GNU/Linux bullseye/sid (XFCE/xfce)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23756 (Git) AppImage
Build type: Release
Branch: master
Hash: 9c6e9184930a52b165a0b7274e3a45d1006bfe67
Python version: 3.8.6
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)

I have solved the problem, however, wondering if this is a bug that needs reporting

In the file
20210126.FCStd
(99.53 KiB) Downloaded 17 times
I was trying to make a roof with the little change of slope on the last tile and wanted to be able to change it using parameters, as the building sizes are still being played with.

To do this I used two roofs, Roof and Roof001 using sketch external fixes from Roof to define the rectangle for Roof001.
I was then using the wall heights to define the placement.z of the roofs. However I came across the problem that the units of the roof height <<Roof>>.Heights[1] and the wall heights <<MainGE>>.Height + <<MainFE>>.Height are different so I could not add them together [Is there a direct solution to this?]
I undid what I had done on the placements and then used a building part to put them together, which allows me to then control the z placement.
20210126AfterBuildingPart.FCStd
(114.19 KiB) Downloaded 21 times
However, when you do this the Roof rises to 5.5m but Roof001 is still at 0m. It turns out that Roof and BuildingPart both have 5.5m as a z placement. Setting the z placement to 0m on either of them fixes it, however doing it on the Roof leaves the BuildingPart on 5.5m although its position is at 0m. Better is to change the BuildingPart, and that for some reason changes the Roof z placement.
This feels like a bug, but if it isn't could someone please explain what I have missed in this behaviour so I do not make similar mistakes in the future

thanks
AndrewA
Posts: 67
Joined: Fri Oct 30, 2020 9:38 am
Location: UK

Re: Building Part 'remembering' previous actions!

Post by AndrewA »

Further update, turns out it is not solved
202101260846.FCStd
(114.26 KiB) Downloaded 41 times
If you go to BuildingPart and use the up down arrows on the placement z the BuildingPart moves together, which meant that I thought I had solved it, however as soon as it refreshes Roof001 returns to its absolute height set in placement z. So I do need to solve how to add the units, now fixed it with Boolean, which seems to behave as I would expect

thanks
User avatar
Roy_043
Veteran
Posts: 8579
Joined: Thu Dec 27, 2018 12:28 pm

Re: Building Part 'remembering' previous actions!

Post by Roy_043 »

AndrewA wrote: Tue Jan 26, 2021 9:11 am This feels like a bug
The Z of Roof001 is controlled by an expression. This explains the behavior you are seeing. The expression no longer makes sense if you want to nest the roof in a BuildingPart.

To add units to an expression you can do something like this:
<<Roof>>.Heights[1] * 1mm
AndrewA
Posts: 67
Joined: Fri Oct 30, 2020 9:38 am
Location: UK

Re: Building Part 'remembering' previous actions!

Post by AndrewA »

Roy_043 wrote: Tue Jan 26, 2021 2:10 pm
AndrewA wrote: Tue Jan 26, 2021 9:11 am This feels like a bug
The Z of Roof001 is controlled by an expression. This explains the behavior you are seeing. The expression no longer makes sense if you want to nest the roof in a BuildingPart.
I'm struggling to see why an expression (and it does the same thing for just a distance) doesn't make sense. Surely the whole point of a structure (and I believe a floor is the same) is to have parts that you can move around in that structure, then move the whole thing. It would work very well for these roofs for example. It does explain the behaviour, but the behaviour seems very wrong.

Using the boolean only works until you want to add a wall of a gable and then cut it with the roof, now it is a boolean, the roofs work as a normal subtraction would, which is not what you want for a roof, but fair enough. Sadly, it does take me back to the start again.
To add units to an expression you can do something like this:
<<Roof>>.Heights[1] * 1mm
Hmm, bit of a bodge, but works :-)
Hopefully this will allow me to build the roof I need

thanks
User avatar
Roy_043
Veteran
Posts: 8579
Joined: Thu Dec 27, 2018 12:28 pm

Re: Building Part 'remembering' previous actions!

Post by Roy_043 »

AndrewA wrote: Tue Jan 26, 2021 3:42 pm I'm struggling to see why an expression (and it does the same thing for just a distance) doesn't make sense.
You have put an object inside a BuildingPart so that it moves together with other objects. In principle this should work. Move the BP 2m up and the roofs follow. But wait: now the expression tells one of the roofs that it should move back (because the result of the expression has not changed). How do you suppose this should work? Maybe you do not realize the height used in the expression has nothing to do with the Z placement of the roof?
AndrewA
Posts: 67
Joined: Fri Oct 30, 2020 9:38 am
Location: UK

Re: Building Part 'remembering' previous actions!

Post by AndrewA »

Roy_043 wrote: Tue Jan 26, 2021 4:09 pm You have put an object inside a BuildingPart so that it moves together with other objects. In principle this should work. Move the BP 2m up and the roofs follow. But wait: now the expression tells one of the roofs that it should move back (because the result of the expression has not changed). How do you suppose this should work?
Thanks Roy for helping again, yet I think I'm missing something fundamental here, which I probably need to understand to use FreeCADs power!
I can see how the programming has worked, but what you are describing doesn't make sense for the use of BuildingParts, what is the point of building parts if you cannot move them around and move bits around in the BuilingPart. Do the maths you described, in the opposite order and it would work fine and I am sure more logical. What you seem to be suggesting is that if it is zero the BuildingPart Z controls all the components in the building part, but anything else each individual part controls its own Z. The way it you are describing it working makes everything far more complicated than it needs to be.

Maybe you do not realize the height used in the expression has nothing to do with the Z placement of the roof?
I'm not sure what you are getting at here, I need to use the heigh of one roof that changes with Angle to move the z of the roof, surly that is the whole point of a parametric system?
User avatar
Roy_043
Veteran
Posts: 8579
Joined: Thu Dec 27, 2018 12:28 pm

Re: Building Part 'remembering' previous actions!

Post by Roy_043 »

A BuildingPart is different from a Std_Part. The way you have set up your model would have worked fine had you used a Std_Part which has its own local coordinate system. A BuildingPart does not, the elements inside it are still positioned relative to the global coordinate system. When you move a BP the elements inside it that have their 'Move With Host' property set to True are simply moved along. Which means their placement changes as well.
AndrewA
Posts: 67
Joined: Fri Oct 30, 2020 9:38 am
Location: UK

Re: Building Part 'remembering' previous actions!

Post by AndrewA »

Roy_043 wrote: Tue Jan 26, 2021 6:55 pm A BuildingPart does not, the elements inside it are still positioned relative to the global coordinate system. When you move a BP the elements inside it that have their 'Move With Host' property set to True are simply moved along. Which means their placement changes as well.
Maybe Move With Host is the key. I have failed to make Move With Host work for anything, mainly been trying with windows in walls. Read the stuff on the wiki, and looked for help, but nothing seems to work for me. Can you point me at a good example or help explanation anywhere, preferably not video, as I generally find videos harder to follow.

Thanks
Post Reply