ifc4x3 support for adding IfcQuantityCount #4776

In IFC4X3 IfcQuantityCount is now more strict and requires only interger values.
Error for a reference:
TypeError: attribute 'CountValue' for entity 'IFC4X3.IfcQuantityCount' is expecting value of type 'INT', got 'float'.
This commit is contained in:
Andrej730
2024-05-31 16:58:10 +05:00
parent dacb3b101c
commit c05abc4d5b
5 changed files with 105 additions and 4 deletions
@@ -68,7 +68,10 @@ def add_resource_quantity(
quantity = file.create_entity(settings["ifc_class"], Name="Unnamed")
# 3 IfcPhysicalSimpleQuantity Value
quantity[3] = 0.0
if settings["ifc_class"] == "IfcQuantityCount":
quantity[3] = 0
else:
quantity[3] = 0.0
old_quantity = settings["resource"].BaseQuantity
settings["resource"].BaseQuantity = quantity
if old_quantity: