[BimWindow] Fix SymbolPlan position (#25001)

* [BimWindow] Fix SymbolPlan position

Fix #24903

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
paul
2025-11-04 01:08:56 +08:00
committed by GitHub
parent cd5209f264
commit 2c7e0f044b

View File

@@ -280,15 +280,25 @@ class Arch_Window:
):
if self.Include:
# Window base sketch's placement stay at origin is good if addon exists and self.Include
#
# Put Sketch in 'upright' position to ensure the opening symbol on plan (SymbolPlan enabled) is correct
# - see https://github.com/FreeCAD/FreeCAD/issues/24903#issuecomment-3475455946
# placement = FreeCAD.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(1,0,0),90))
# TODO 2025.11.1 : To improve the algorithm to be more robust to allow the Base Sketch in any orientation but without problem
#
# Window object triggers onChanged() upon setting/changing Window.Sill to move Window's z position
# For Window with SketchArch add-on, attachToHost() is to be run below to set the 'initial' Window's placement prior to triggering onChanged() below,
# so window_sill parameter is not used here at the moment, see 'if self.Include' below.
# FreeCADGui.doCommand("win = Arch.makeWindowPreset('" + WindowPresets[self.Preset] + "' " + wp + ", window_sill=" + str(self.Sill.Value) + ")")
FreeCADGui.doCommand(
"pl90 = FreeCAD.Placement(App.Vector(0,0,0),App.Rotation(App.Vector(1,0,0),90))"
)
FreeCADGui.doCommand(
"win = Arch.makeWindowPreset('"
+ WindowPresets[self.Preset]
+ "' "
+ wp
+ ", placement=pl90"
+ ")"
)
else: