You can now import profile definitions from a library

This commit is contained in:
Dion Moult
2021-08-14 12:05:59 +10:00
parent c2530b7a61
commit 305465a898
2 changed files with 13 additions and 2 deletions
@@ -11,12 +11,15 @@ class Usecase:
def execute(self):
self.added_elements = set()
self.whitelisted_inverse_attributes = {}
if self.settings["element"].is_a("IfcTypeProduct"):
return self.append_type_product()
elif self.settings["element"].is_a("IfcMaterial"):
return self.append_material()
elif self.settings["element"].is_a("IfcCostSchedule"):
return self.append_cost_schedule()
elif self.settings["element"].is_a("IfcProfileDef"):
return self.append_profile_def()
def is_already_appended(self):
try:
@@ -36,6 +39,11 @@ class Usecase:
self.whitelisted_inverse_attributes = {"IfcCostSchedule": ["Controls"], "IfcCostItem": ["IsNestedBy"]}
return self.add_element(self.settings["element"])
def append_profile_def(self):
if [e for e in self.file.by_type("IfcProfileDef") if e.ProfileName == self.settings["element"].ProfileName]:
return
return self.add_element(self.settings["element"])
def append_type_product(self):
if self.is_already_appended():
return