BIM: fix setting of self.Type

Fixes #21364.

`self.Type` should be set in `__init__` and `loads`, and not in `onDocumentRestored`.

Additionally:
fixed mistake in `loads` in ifc_objects.py.
This commit is contained in:
Roy-043
2025-06-26 13:58:12 +02:00
committed by Chris Hennes
parent 8add557e2f
commit 90a6bb7ea4
27 changed files with 109 additions and 60 deletions

View File

@@ -275,6 +275,7 @@ class _Building(ArchFloor._Floor):
def __init__(self,obj):
ArchFloor._Floor.__init__(self,obj)
self.Type = "Building"
self.setProperties(obj)
obj.IfcType = "Building"
@@ -285,13 +286,16 @@ class _Building(ArchFloor._Floor):
obj.addProperty("App::PropertyEnumeration","BuildingType","Arch",QT_TRANSLATE_NOOP("App::Property","The type of this building"), locked=True)
obj.BuildingType = BuildingTypes
obj.setEditorMode('Height',2)
self.Type = "Building"
def onDocumentRestored(self,obj):
ArchFloor._Floor.onDocumentRestored(self,obj)
self.setProperties(obj)
def loads(self,state):
self.Type = "Building"
class _ViewProviderBuilding(ArchFloor._ViewProviderFloor):