mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Import of CSV-based schedule of rates is now possible
This commit is contained in:
@@ -16,18 +16,13 @@ class Usecase:
|
||||
# TODO: support all applied value select types
|
||||
value = self.file.createIfcMonetaryMeasure(value)
|
||||
elif name == "UnitBasis":
|
||||
self.remove_existing_unit_basis()
|
||||
old_unit_basis = self.settings["cost_value"].UnitBasis
|
||||
if value:
|
||||
value_component = self.file.create_entity(
|
||||
ifcopenshell.util.unit.get_unit_measure_type(value["UnitComponent"].UnitType),
|
||||
ifcopenshell.util.unit.get_unit_measure_class(value["UnitComponent"].UnitType),
|
||||
value["ValueComponent"],
|
||||
)
|
||||
value = self.file.create_entity("IfcMeasureWithUnit", value_component, value["UnitComponent"])
|
||||
if old_unit_basis and len(self.file.get_inverse(old_unit_basis)) == 0:
|
||||
ifcopenshell.util.element.remove_deep(self.file, old_unit_basis)
|
||||
setattr(self.settings["cost_value"], name, value)
|
||||
|
||||
def remove_existing_unit_basis(self):
|
||||
if (
|
||||
self.settings["cost_value"].UnitBasis
|
||||
and len(self.file.get_inverse(self.settings["cost_value"].UnitBasis)) == 1
|
||||
):
|
||||
ifcopenshell.util.element.remove_deep(self.file, self.settings["cost_value"].UnitBasis)
|
||||
|
||||
Reference in New Issue
Block a user