OSArch Community

use property value for quantity schedule

  1. P

    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

  2. S

    hi @PeterKop

    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

    hope it heps, cheers

  3. P

    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

  4. S

    @PeterKop

    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 :)

  5. P

    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

  6. S

    can you try this?

  7. P

    Steve thanks for the hint, i will test tomorrow morning and report back

  8. P

    stefano, there seems to be something wrong....

    here my input

    here the error message

    will have to examine the ifc data.

  9. S

    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

  10. P

    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

  11. S

    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

  12. P

    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...

  13. P

    @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}")_
  14. S

    Hi @PeterKop

    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?

  15. P

    hi @steverugi

    yes, i used the patch from panel in bonsai with above adoption in code

  16. S

    @PeterKop said:

    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?

  17. P

    @steverugi

    yes, like this:

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

Login or Register to reply.