i have an ifc file with a custom pset for geometries / quantities. unfortunately it is not a quantityset.
i am wondering if there is a way in the cost module to calculate with such a property value instead of a quantity.
thank you
i have an ifc file with a custom pset for geometries / quantities. unfortunately it is not a quantityset.
i am wondering if there is a way in the cost module to calculate with such a property value instead of a quantity.
a bit more info would be helpful but in general you can use custom quantities in your Cost Schedule and Spreadsheet
say you have a custom Qto "MyDimension" with 4.5 value assigned to a wall
you can call it from the drop-down list in the Cost Schedule
steve you are right, there is more info needed.
what i have is structured objects - mostly IfcBuildingElementProxies with different types, which act as classification.
these objects have a given pset/property structure.
one pset ist for geometry:
i created a structured cost item table:
as you see i collected the items by class.
what i want to achieve is to use the "Volumen" property in my structure as quantity in my cost items.
for me the manual creation of quantities to be assigned instead of a value already assigned does not feel right.
thank you peter
as you see i collected the items by class.
what i want to achieve is to use the "Volumen" property in my structure as quantity in my cost items.
for me the manual creation of quantities to be assigned instead of a value already assigned does not feel right.
If Volumen is a custom qto (inside Quantity Sets) you can use the example I posted above , manual calculation is only needed when such info is not available
does it make sense? please advise
EDIT
if your quantities are a custom Pset instead, they do not show in the drop-down menu, in such case I don't know how to move info from Pset to Qto using the user interface, maybe with Python? hopefully someone else will come to the rescue here :)
my quantity is not part of a quantity set.
in my understanding following your advice i had to manually assign values to a new quantity "Volume" in a quantityset "MyQto"
the question is, if there is a way to take the property volume - not being a member of a quantity set - and use it in the cost schedule
I was looking at your images in the previous post, lots of proxy elements there, as far as I understand you need to use a unit compatible with the assigned class, see below from ifcpatch.recipes
stefano, changed the target to NetVolume -> should be available in all qto_sets including Qto_BuildingElementProxyQuantities (according to bs documentation)
analysing the persisting error:
the object (IfcBuildingElementProxy) exists, the relations to the property name exists ("Volumen") in a pset("...Geometrie")
the assignment of NetVolume is valid.
seems debugging is necessary
stefano, i found first typos in the code:
the original code: if value and not has_quantity:
qto_name = self.get_qto_name(product.is_a())
qto = qtos.get(qto_name, ifcopenshell.api.run("pset.add_qto", self.file, product=product, Name=qto_name))
ifcopenshell.api.run(
"pset.edit_qto", self.file, qto=qto, Properties={self.destination_quantity_name: value}
)
the updated one: if value and not has_quantity:
qto_name = self.get_qto_name(product.is_a())
qto = qtos.get(qto_name, ifcopenshell.api.run("pset.add_qto", self.file, product=product, name=qto_name))
ifcopenshell.api.run(
"pset.edit_qto", self.file, qto=qto, properties={self.destination_quantity_name: value}
)
but still not working, there is more code to edit...
@steverugi , i had to add a try / except exception handling to above modifications in the code as i had no quantityset in the model. now he calculation runs very smooth and results are as expected.
thank you for pointing me in the right direction!
here my code snippet: elif definition.is_a("IfcElementQuantity"):
try:
qtos[definition.Name] = definition
for quantity in definition.Quantities:
if quantity.is_a("IfcPhysicalSimpleQuantity") and quantity.Name == self.destination_quantity_name:
has_quantity = True
except Exception as e:
self.logger.info(f"Failed to process IfcElementQuantity for product {product.GlobalId}: {e}")
here my code snippet: elif definition.is_a("IfcElementQuantity"):
try:
qtos[definition.Name] = definition
for quantity in definition.Quantities:
if quantity.is_a("IfcPhysicalSimpleQuantity") and quantity.Name == self.destination_quantity_name:
has_quantity = True
except Exception as e:
self.logger.info(f"Failed to process IfcElementQuantity for product {product.GlobalId}: {e}")
Did you try using the patch from the panel in Bonsai?
Comments
hi @PeterKop
a bit more info would be helpful but in general you can use custom quantities in your Cost Schedule and Spreadsheet
say you have a custom Qto "MyDimension" with 4.5 value assigned to a wall

you can call it from the drop-down list in the Cost Schedule

hope it heps, cheers
steve you are right, there is more info needed.



what i have is structured objects - mostly IfcBuildingElementProxies with different types, which act as classification.
these objects have a given pset/property structure.
one pset ist for geometry:
i created a structured cost item table:
as you see i collected the items by class.
what i want to achieve is to use the "Volumen" property in my structure as quantity in my cost items.
for me the manual creation of quantities to be assigned instead of a value already assigned does not feel right.
thank you peter
@PeterKop
If Volumen is a custom qto (inside Quantity Sets) you can use the example I posted above , manual calculation is only needed when such info is not available
does it make sense? please advise
EDIT
if your quantities are a custom Pset instead, they do not show in the drop-down menu, in such case I don't know how to move info from Pset to Qto using the user interface, maybe with Python? hopefully someone else will come to the rescue here :)
my quantity is not part of a quantity set.
in my understanding following your advice i had to manually assign values to a new quantity "Volume" in a quantityset "MyQto"
the question is, if there is a way to take the property volume - not being a member of a quantity set - and use it in the cost schedule
can you try this?
Steve thanks for the hint, i will test tomorrow morning and report back
stefano, there seems to be something wrong....


here my input
here the error message
will have to examine the ifc data.
I was looking at your images in the previous post, lots of proxy elements there, as far as I understand you need to use a unit compatible with the assigned class, see below from ifcpatch.recipes
stefano, changed the target to NetVolume -> should be available in all qto_sets including Qto_BuildingElementProxyQuantities (according to bs documentation)

analysing the persisting error:
the object (IfcBuildingElementProxy) exists, the relations to the property name exists ("Volumen") in a pset("...Geometrie")
the assignment of NetVolume is valid.
seems debugging is necessary
Hi @PeterKop
please would you post an issue on this link
I did quickly try it yesterday and couldn't get it right either, thanks
stefano, i found first typos in the code:
the original code:
if value and not has_quantity:
qto_name = self.get_qto_name(product.is_a())
qto = qtos.get(qto_name, ifcopenshell.api.run("pset.add_qto", self.file, product=product, Name=qto_name))
ifcopenshell.api.run(
"pset.edit_qto", self.file, qto=qto, Properties={self.destination_quantity_name: value}
)
the updated one:
if value and not has_quantity:
qto_name = self.get_qto_name(product.is_a())
qto = qtos.get(qto_name, ifcopenshell.api.run("pset.add_qto", self.file, product=product, name=qto_name))
ifcopenshell.api.run(
"pset.edit_qto", self.file, qto=qto, properties={self.destination_quantity_name: value}
)
but still not working, there is more code to edit...
@steverugi , i had to add a try / except exception handling to above modifications in the code as i had no quantityset in the model. now he calculation runs very smooth and results are as expected.
thank you for pointing me in the right direction!
here my code snippet:
elif definition.is_a("IfcElementQuantity"):
try:
qtos[definition.Name] = definition
for quantity in definition.Quantities:
if quantity.is_a("IfcPhysicalSimpleQuantity") and quantity.Name == self.destination_quantity_name:
has_quantity = True
except Exception as e:
self.logger.info(f"Failed to process IfcElementQuantity for product {product.GlobalId}: {e}")
Hi @PeterKop
Did you try using the patch from the panel in Bonsai?
hi @steverugi
yes, i used the patch from panel in bonsai with above adoption in code
I meant did you use the patch from the panel entering name of property and quantity?
@steverugi


yes, like this:
after applying my corrections in the code, it worked. data is automatically input in costing module