From 1efa8ca45132a9e7594d4cf320d84da10e6bbb15 Mon Sep 17 00:00:00 2001 From: Roy-043 <70520633+Roy-043@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:05:24 +0200 Subject: [PATCH] Arch: Arch_Structure beam could have wrong length (#13399) A beam created with Arch_Structure would have the wrong length if the 1st point was clicked and the 2nd point was entered in the task panel. Forum topic: https://forum.freecad.org/viewtopic.php?t=86595 Aditionally: simplified rotateLH and rotateLW. Co-authored-by: Yorik van Havre --- src/Mod/Arch/ArchStructure.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Mod/Arch/ArchStructure.py b/src/Mod/Arch/ArchStructure.py index f047aff803..322c9fd5f2 100644 --- a/src/Mod/Arch/ArchStructure.py +++ b/src/Mod/Arch/ArchStructure.py @@ -349,6 +349,9 @@ class _CommandStructure: FreeCAD.ActiveDocument.openTransaction(translate("Arch","Create Structure")) FreeCADGui.addModule("Arch") FreeCADGui.addModule("WorkingPlane") + if self.bmode: + self.Length = point.sub(self.bpoint).Length + params.set_param_arch("StructureHeight",self.Length) if self.Profile is not None: try: # try to update latest precast values - fails if dialog has been destroyed already self.precastvalues = self.precast.getValues() @@ -647,17 +650,17 @@ class _CommandStructure: def rotateLH(self): - h = self.Height - l = self.Length - self.vLength.setText(FreeCAD.Units.Quantity(h,FreeCAD.Units.Length).UserString) - self.vHeight.setText(FreeCAD.Units.Quantity(l,FreeCAD.Units.Length).UserString) + l = self.vLength.text() + h = self.vHeight.text() + self.vLength.setText(h) + self.vHeight.setText(l) def rotateLW(self): - w = self.Width - l = self.Length - self.vLength.setText(FreeCAD.Units.Quantity(w,FreeCAD.Units.Length).UserString) - self.vWidth.setText(FreeCAD.Units.Quantity(l,FreeCAD.Units.Length).UserString) + l = self.vLength.text() + w = self.vWidth.text() + self.vLength.setText(w) + self.vWidth.setText(l) class _Structure(ArchComponent.Component):