Arch: Fixed bug in precasts + addressing recursive wall length issue

This commit is contained in:
Yorik van Havre
2019-05-15 10:49:24 -03:00
parent 3a22758051
commit 2a4012872e
2 changed files with 8 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ class _Precast(ArchComponent.Component):
def onDocumentRestored(self,obj):
ArchComponent.Component.onDocumentRestored(self,obj)
_Precast.onDocumentRestored(self,obj)
_Precast.setProperties(self,obj)
def execute(self,obj):

View File

@@ -732,11 +732,17 @@ class _Wall(ArchComponent.Component):
l = obj.Base.Shape.Length
if obj.Length.Value != l:
obj.Length = l
self.oldLength = None # delete the stored value to prevent triggering base change below
def onBeforeChange(self,obj,prop):
if prop == "Length":
self.oldLength = obj.Length.Value
def onChanged(self,obj,prop):
if prop == "Length":
if obj.Base and obj.Length.Value:
if obj.Base and obj.Length.Value and hasattr(self,"oldLength") and (self.oldLength != None) and (self.oldLength != obj.Length.Value):
if obj.Base.isDerivedFrom("Part::Feature"):
if len(obj.Base.Shape.Edges) == 1:
import DraftGeomUtils