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:
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user