Fixes#21364.
`self.Type` should be set in `__init__` and `loads`, and not in `onDocumentRestored`.
Additionally:
fixed mistake in `loads` in ifc_objects.py.
If a window is a variant Link there will be a hidden source object in the document. That hidden object shares properties with the visible Link object. The Hosts property may be one of them, yet the hidden object should never be hosted.
Forum topics:
https://forum.freecad.org/viewtopic.php?p=817743#p817743 (sample file)
https://forum.freecad.org/viewtopic.php?t=96115 (code discussion)
To test the code:
1. Open the mentioned sample file.
2. Change the Hosts property of Window001 to Wall.
3. Recompute.
* [ArchWindow] Improve SubVolume() HoleDepth deduction algorithm
https://github.com/FreeCAD/FreeCAD/issues/19559https://forum.freecad.org/viewtopic.php?t=92360https://forum.freecad.org/viewtopic.php?p=812844#p812844
Current HoldeDepth deduction algorithm is too 'agressive' and may punch holes in adjacent wall segment.
With improved algorithm, ArchComponent pass the Window's host information to ArchWindow getSubVolume() to deduce HoleDepth taking into account of Wall's Width /getWidths for Wall Base is ArchSkech
TODO: For future development - More robust approach
With ArchSketch, on which wall segment an ArchObject is attached to is declared by user and saved.
The extrusion of each wall segment could be done per segment, and punch hole in the exact wall segment before fusing them all. No need to care about each wall segement thickness.
* [ArchWindow] Typo Lint reported
* [ArchWindow] Fix getSubFace(self) raise NotImplementedError
Github comment - https://github.com/FreeCAD/FreeCAD/pull/19774#discussion_r1972052310
* Switched Component code to new Comp=True version of code.
* Made the Placement code in both files identical. This also solves that Rotating a BuildingPart was not propagated to children.
* Arch: Improved ArchComponent.computeAreas function
All non vertical faces get projected now. Changed Part.Wire to DraftGeomUtils.findWires
* Arch: Removed Area property and add AreaCalculationType to Space object
The horizontal area and its perimeter are now calculated in two different ways. Eiter at the centre of mass or as a projection on the XY-plane. The results are filled in the filed horizontal area and perimeter in the Component section.
* BIM: Added property Area for Spaces again