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:
@@ -61,6 +61,7 @@ class _ArchPipe(ArchComponent.Component):
|
||||
def __init__(self,obj):
|
||||
|
||||
ArchComponent.Component.__init__(self,obj)
|
||||
self.Type = "Pipe"
|
||||
self.setProperties(obj)
|
||||
# IfcPipeSegment is new in IFC4
|
||||
from ArchIFC import IfcTypes
|
||||
@@ -94,13 +95,16 @@ class _ArchPipe(ArchComponent.Component):
|
||||
if not "ProfileType" in pl:
|
||||
obj.addProperty("App::PropertyEnumeration", "ProfileType", "Pipe", QT_TRANSLATE_NOOP("App::Property","If not based on a profile, this controls the profile of this pipe"), locked=True)
|
||||
obj.ProfileType = ["Circle", "Square", "Rectangle"]
|
||||
self.Type = "Pipe"
|
||||
|
||||
def onDocumentRestored(self,obj):
|
||||
|
||||
ArchComponent.Component.onDocumentRestored(self,obj)
|
||||
self.setProperties(obj)
|
||||
|
||||
def loads(self,state):
|
||||
|
||||
self.Type = "Pipe"
|
||||
|
||||
def onChanged(self, obj, prop):
|
||||
if prop == "IfcType":
|
||||
root = ArchIFC.IfcProduct()
|
||||
|
||||
Reference in New Issue
Block a user