Skip to content

Commit b50ac86

Browse files
committed
Arch: Fixed bug in precasts + addressing recursive wall length issue
1 parent 96ee6fb commit b50ac86

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Mod/Arch/ArchPrecast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def setProperties(self,obj):
7474
def onDocumentRestored(self,obj):
7575

7676
ArchComponent.Component.onDocumentRestored(self,obj)
77-
_Precast.onDocumentRestored(self,obj)
77+
_Precast.setProperties(self,obj)
7878

7979
def execute(self,obj):
8080

src/Mod/Arch/ArchWall.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,17 @@ def execute(self,obj):
732732
l = obj.Base.Shape.Length
733733
if obj.Length.Value != l:
734734
obj.Length = l
735+
self.oldLength = None # delete the stored value to prevent triggering base change below
736+
737+
def onBeforeChange(self,obj,prop):
738+
739+
if prop == "Length":
740+
self.oldLength = obj.Length.Value
735741

736742
def onChanged(self,obj,prop):
737743

738744
if prop == "Length":
739-
if obj.Base and obj.Length.Value:
745+
if obj.Base and obj.Length.Value and hasattr(self,"oldLength") and (self.oldLength != None) and (self.oldLength != obj.Length.Value):
740746
if obj.Base.isDerivedFrom("Part::Feature"):
741747
if len(obj.Base.Shape.Edges) == 1:
742748
import DraftGeomUtils

0 commit comments

Comments
 (0)