Skip to content
This repository was archived by the owner on Jan 29, 2024. It is now read-only.

Commit 5da2280

Browse files
committed
Arch: Added Frame and Offset properties to windows
1 parent fb0fc49 commit 5da2280

2 files changed

Lines changed: 192 additions & 71 deletions

File tree

src/Mod/Arch/ArchComponent.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,10 @@ def setProperties(self,obj):
418418
obj.addProperty("App::PropertyMap","IfcAttributes","Component",QT_TRANSLATE_NOOP("App::Property","Custom IFC properties and attributes"))
419419
if not "Material" in pl:
420420
obj.addProperty("App::PropertyLink","Material","Component",QT_TRANSLATE_NOOP("App::Property","A material for this object"))
421+
if "BaseMaterial" in pl:
422+
obj.Material = obj.BaseMaterial
423+
obj.removeProperty("BaseMaterial")
424+
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" BaseMaterial property to Material\n")
421425
if not "IfcRole" in pl:
422426
obj.addProperty("App::PropertyEnumeration","IfcRole","Component",QT_TRANSLATE_NOOP("App::Property","The role of this object"))
423427
obj.IfcRole = IfcRoles
@@ -426,7 +430,7 @@ def setProperties(self,obj):
426430
obj.removeProperty("Role")
427431
if r in IfcRoles:
428432
obj.IfcRole = r
429-
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" Role property to IfcRole\n")
433+
FreeCAD.Console.PrintMessage("Upgrading "+obj.Label+" Role property to IfcRole\n")
430434
if not "MoveWithHost" in pl:
431435
obj.addProperty("App::PropertyBool","MoveWithHost","Component",QT_TRANSLATE_NOOP("App::Property","Specifies if this object must move together when its host is moved"))
432436
if not "IfcProperties" in pl:
@@ -470,15 +474,6 @@ def __setstate__(self,state):
470474

471475
return None
472476

473-
def onDocumentRestored(self,obj):
474-
475-
if hasattr(obj,"BaseMaterial"):
476-
if not hasattr(obj,"Material"):
477-
obj.addProperty("App::PropertyLink","Material","Arch",QT_TRANSLATE_NOOP("App::Property","A material for this object"))
478-
obj.Material = obj.BaseMaterial
479-
obj.removeProperty("BaseMaterial")
480-
print("Migrated old BaseMaterial property -> Material in ",obj.Label)
481-
482477
def onBeforeChange(self,obj,prop):
483478

484479
if prop == "Placement":

0 commit comments

Comments
 (0)