Fix validation errors in IFC2X3 with missing ownership and mandatory attributes

This commit is contained in:
Dion Moult
2021-06-23 10:35:13 +10:00
parent 6ecedaa128
commit 1071ac00d4
3 changed files with 26 additions and 3 deletions
@@ -18,7 +18,12 @@ class Usecase:
return rel.RelatingPropertyDefinition
pset = self.file.create_entity(
"IfcPropertySet", **{"GlobalId": ifcopenshell.guid.new(), "Name": self.settings["name"]}
"IfcPropertySet",
**{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"Name": self.settings["name"],
}
)
self.file.create_entity(
"IfcRelDefinesByProperties",
@@ -36,7 +41,12 @@ class Usecase:
return definition
pset = self.file.create_entity(
"IfcPropertySet", **{"GlobalId": ifcopenshell.guid.new(), "Name": self.settings["name"]}
"IfcPropertySet",
**{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"Name": self.settings["name"],
}
)
has_property_sets = list(self.settings["product"].HasPropertySets or [])
has_property_sets.append(pset)
@@ -19,7 +19,12 @@ class Usecase:
return rel.RelatingPropertyDefinition
qto = self.file.create_entity(
"IfcElementQuantity", **{"GlobalId": ifcopenshell.guid.new(), "Name": self.settings["name"]}
"IfcElementQuantity",
**{
"GlobalId": ifcopenshell.guid.new(),
"OwnerHistory": ifcopenshell.api.run("owner.create_owner_history", self.file),
"Name": self.settings["name"],
}
)
self.file.create_entity(
"IfcRelDefinesByProperties",