OSArch Community

Improving ifc5d

  1. W

    I took the liberty of creating this discussion here, in reference to Issue Improving ifc5d #6570, because I would like to talk about this without polluting the conversation there.

    In addition to the list of features that @Massimo and @steverugi exposed I would add:

    1 - Implementation of IfcTypeResource:

    I don't think this was implemented in resource creation (the tests I've done show this, but I could be wrong). If resources were created from type instances it would solve two conditions:

    1.1- Changes in the cost value of the type would be reflected in the children created when they are assigned to tasks (a problem that was mentioned before in another old post that I was unable to recover)

    1.2- It could be assigned to an IfcCostItem, according to the Ifc documentation:

     _"For rate-based costing (specifically for IfcCostScheduleTypeEnum.SCHEDULEOFRATES), a single    
    
      IfcTypeProduct, IfcTypeProcess, or IfcTypeResource subtype can be used to reflect rates for occurrences of 
    
      such types. This enables the possibility of generating a quantity-based cost schedule for occurrences based on 
    
      types with rate-based cost schedules."_

    2 - Implementation of the (10)Components attribute of IfcCostValue for Composition/nesting/calculation of values:

    2.1- In the IFC_4.2 documentation there was an image in Concept usage/Nesting that showed a way to make calculations with rates (something very necessary for SoR). This image no longer appears in the IFC_4.3 documentation, but the attribute remains, so I assume it can still be used for this purpose.

    2.2- Maybe this has already been implemented and I didn't find it because I couldn't make the (9)ArithmeticOperator attribute in the interface work to, for example, multiply 2 IfcCostValue. If anyone has succeeded, please show me how to do it.

    3 - Implementation of a button for resource assign (item 1.2):

    I think the logic could be:

    • click on the button with the IfcTypeResource selected

    • creates an IfcCostItem with the same name as the resource

    • creates a IfcCostValue(root) in the list of the (8)CostValues ​​attribute of the IfcCostItem

    • adds the IfcCostValue of IfcTypeResource to the list of the (10)Components attribute of IfcCostValue(root) to be used for composition (if item 2 is implemented)

    • disables the possibility of editing this IfcCostValue in SoR, to avoid user error it would only allow deletion and would need some warning that editing can only be done in the source resource.

    Maybe this logic makes sense for SoR, but not for other types of cost schedules, so you need to dig deeper into this.

    I would like to know what you think.

    Cheers

  1. M

    @walpa thanks for the hints.

    For n.1 and n.2 of your list, i think it is too much difficult for me to implement atm, so i hope there is somebody else interested to; in the meantime, i can study them btw.

    For n.3, you can assign a resource to a SoR CostItem (in a same way as CostItem BoQ) after this commit (https://github.com/IfcOpenShell/IfcOpenShell/commit/e54acd83f89298f96e87f3695e96bec797bd8239). It is much simpler that what you are proposing, but it could be a start.

    Nice to brainstorming about this topic btw.

  1. S

    thank you @walpa and @Massimo for your precious input, always a plasure to see users/developers coming to the cost/quantity corner.

    I think what @walpa is suggesting is the same process used in work schedule, when a resource is allocated to a task it creates a nested child dependency (same cost value but specifically assigned quantiy -like time, volume, area..., based on manual input, assigned elements' take-off quantities, or time resource' s productivity)

    In a cost schedule I think it can be the same with equal advantage.

    If understood correctly, when a resource is assigned to a cost schedule it goes in as a nested child and works with the quantity of the cost schedule's item, for the cost value it takes it from its parent or other (manual, rate from a Schedule of Rates SOR)

    To the best of my -limited- knowledge it's totally IFC compliant, I can draft a diagram if you like, in the meantime I am looking forward to the implementation of @Massimo 's PR, amazingly useful feature.

    Please quantity/cost people (or anybody else vaguely interest in the topic) come forward, Bonsai needs you!

    thanks

    PS for those who don't have the slightest idea of what the above means: please come forward too, and ask, your contribution is even more valuable to make Bonsai a professional tool ;)

  1. S

    PS2

    there is also this tiny rhomboid next to the resource, it assigns a costruction resource to an element.

    Haven't got the chance to understand its actual implementation in Bonsai

  1. W

    @Massimo said:

    For n.3, you can assign a resource to a SoR CostItem (in a same way as CostItem BoQ) after this commit (https://github.com/IfcOpenShell/IfcOpenShell/commit/e54acd83f89298f96e87f3695e96bec797bd8239). It is much simpler that what you are proposing, but it could be a start.

    Sorry, I was not sure about the image I put in item 3. Now, resource-based costing for BoQ is working according to the IFC documentation.

    Working perfectly! Thank you very much @massino.

    For SoR I think it should not be like this because:

    • the total quantity of the resource is not known "a priori", the unit cost to be transferred from a SoR to a BoQ would be the unit cost of the resource x resource rate/productivity

    • for materials and subcontractors the real usage/productivity rate was not implemented (at least not in the UI)

    But, maybe this was the way:

    1 - implement usage rate/productivity for materials and subcontractors

    2 - If IfcCostScheduleTypeEnum == SCHEDULEOFRATES:

           CostValue = resource unit cost x rate/productivity

    else:

       CostValue =  resource unit cost x quantity

    And it would be easier for users who would not need to access several nested IfcCostValue.

    In the case of importing a CSV file from a SoR, it might be more complex. Thoughts...

    And in the future, a function could be implemented that calculates/updates the quantities of resources associated with a BoQ/SoR item for work schedules calculations. That would be fantastic! Just my rambling! :)

  1. W

    @steverugi said:

    PS2

    there is also this tiny rhomboid next to the resource, it assigns a costruction resource to an element.

    Haven't got the chance to understand its actual implementation in Bonsai

    Creates an IFCRELASSIGNSTORESOURCE relationship between the resource and an element.

    I think it's used when an attribute of an element influences some attribute of a resource.

    From the IfcResource documentation:

    _"Second, if thing attributes are required for the use of IfcResource objects, and they are explicitly modeled as objects, then IfcResource

    instances can be bound to instances of the type of the things being referenced. Things that might be used as resources and that are already

    modeled in the IFC include physical products, people and organizations, and materials. The IfcRelAssignsToResource relationship object is

    provided for this approach."_

    I think of at least 3 use cases:

    • IfcPerson --> IfcLaborResource

    e.g.: foreman

    • IfcElement --> IfcMaterial --> IfcConstructionMaterialResource

    e.g.: Wall layer --> fire protection paint (level of protection) --> IfcConstructionMaterialResource (productivity)

    • IfcElement --> IfcConstructionEquipmentResource

    e.g.: modeled crane

    With creativity you can do a lot with this...

  1. W

    @steverugi said:

    To the best of my -limited- knowledge it's totally IFC compliant, I can draft a diagram if you like, in the meantime I am looking forward to the implementation of @Massimo 's PR, amazingly useful feature.

    In this post presents a diagram that @SigmaDimensions developed when implementing 4d/5d, maybe it can help.

  1. S

    thanks @walpa

    Creates an IFCRELASSIGNSTORESOURCE relationship between the resource and an element.

    I think it's used when an attribute of an element influences some attribute of a resource.

    Yes, I noticed that when I went through the .ifc file itself

    I was wondering if there is any actual use of it in the current version of Bonsai

    thanks again for your help, much appreciated

  1. S

    @walpa

    _"Second, if thing attributes are required for the use of IfcResource objects, and they are explicitly modeled as objects, then IfcResource

    instances can be bound to instances of the type of the things being referenced. Things that might be used as resources and that are already

    modeled in the IFC include physical products, people and organizations, and materials. The IfcRelAssignsToResource relationship object is

    provided for this approach."_

    I think of at least 3 use cases:

    • IfcPerson --> IfcLaborResource

    e.g.: foreman

    • IfcElement --> IfcMaterial --> IfcConstructionMaterialResource

    e.g.: Wall layer --> fire protection paint (level of protection) --> IfcConstructionMaterialResource (productivity)

    • IfcElement --> IfcConstructionEquipmentResource

    e.g.: modeled crane

    With creativity you can do a lot with this...

    that's my problem: creativity

    could you please indicate the usage of your three examples in Bonsai?

    cheers

  1. W

    @steverugi said:

    could you please indicate the usage of your three examples in Bonsai?

    I don't think there is anything implemented in Bonsai, it would depend on scripting.

  1. S

    @walpa said:

    Sorry, I was not sure about the image I put in item 3. Now, resource-based costing for BoQ is working according to the IFC documentation.

    Working perfectly! Thank you very much @massino.

    I'm glad you like it but I don't think there was any change in the recent releases, assigning construction resources to cost items has been there for quite some time I think.

  1. S

    @walpa said:

    @steverugi said:

    could you please indicate the usage of your three examples in Bonsai?

    I don't think there is anything implemented in Bonsai, it would depend on scripting.

    I thought so too

    how about a practical example in real life? an actual process where those uses are part of a workflow IN < process> OUT?

    thanks for your help

  1. R

    Hi, thanks for this post.

    I am using Blender 4.4 and Bonsai 250421, when I export a Cost Schedule and import it again before loading the schedule into MS Excel I get no error code, but when I load the CSV into excel and save the document as a csv it gives me an error. I hope the screenshots helps.

    I tired to link the excel saved csv file and it gave me the same error.

    Thanks in advance for your support.

  1. M

    @Roel thanks for the feedback. Sometimes i also have problems with csv created in Excel, i think that the csv created/modified with excel has something invalid or it needs to be saved with a sort of option enabled (i don't know exactly).

    The error, btw, is about missing mandatory fields in the header, so you could check that. Also, check if columns name follow the newest conventions (Index, Identification, Name, ...) as described here (https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/ifc5d/README.md)

    Anyway, i think that it would be better to file an issue on github in order to track the issue. Could you create one with attached also the files that trigger the error? Thanks

  1. S

    Hi @Roel

    Hi, thanks for this post.

    I am using Blender 4.4 and Bonsai 250421, when I export a Cost Schedule and import it again before loading the schedule into MS Excel I get no error code, but when I load the CSV into excel and save the document as a csv it gives me an error. I hope the screenshots helps.

    I tired to link the excel saved csv file and it gave me the same error.

    Thanks in advance for your support.

    if you use Excel to handle .csv file don't do it! :))

    just kiddin', in Excel use Export as shown in this image

    PS I find Modern CSV a useful app, it's both free and paid but not expensive, also allows dynamic update (MS Excel won't)

  1. R

    Hi @steverugi , thakns for the feedback,

    it is a simpler way to create a csv in excel, but still got the error. Are you getting an error?

  1. R

    @Massimo said:

    @Roel thanks for the feedback. Sometimes i also have problems with csv created in Excel, i think that the csv created/modified with excel has something invalid or it needs to be saved with a sort of option enabled (i don't know exactly).

    The error, btw, is about missing mandatory fields in the header, so you could check that. Also, check if columns name follow the newest conventions (Index, Identification, Name, ...) as described here (https://github.com/IfcOpenShell/IfcOpenShell/blob/v0.8.0/src/ifc5d/README.md)

    Anyway, i think that it would be better to file an issue on github in order to track the issue. Could you create one with attached also the files that trigger the error? Thanks

    Sorry I missed your post, yes I will create an issue on github

  1. S

    @Roel

    looks like your csv is missing something

    let me get back to you shortly

  1. R

    sorry, I can't anymore. :-(

  1. S

    @Roel

    I repeated the steps and got no error

    1. have a cost schedule in Bonsai

    2. export it using Export spreadsheet as .csv (I don't just "save" it)

    1. load the .csv in Excel (the same way you did via data import)

    2. change something inside the .csv from Excel

    3. export .csv from Excel making sure I go via Export file > Change File Type > CSV comma delimited as indicated in my previous post

    4. click on the sync (or refresh) icon to update the cost schedule in Bonsai, no issue

    I also tried to import it back with the "arrow-down" and it's OK

    as @Massimo suggested if the problem persists, kindly submit an issue providing as many details as possible, thanks

  1. S

    @Roel

    can you please contact me directly? I sent you a msg

  1. R

    @steverugi said:

    @Roel

    can you please contact me directly? I sent you a msg

    Thanks for your suport, I got it working my problem was with my Windows settings as per the screenshot

  1. R

    Hi, I exported my cost schedule opened it in excel changed a cell value and then imported it back into Bonsai, this worked but I noticed that the total value was not the same, looking deeper into the import the 2nd and… “General Cost” is lost. Hope the screenshot helps.

  1. D

    Hi all,

    had the same issue long ago and checked on the save as option in excel.

    For me it worked only by using the :

    Save as CSV in Excel

    The option to Save as CSV UTF-8 wasnt valid since the encoding it was saved in was a UTF-8 BOM.

    Use notepad++ to check the encoding of the file and if not UTF-8 the change it accordingly.

    Notepad++ encoding check

    Hope this helps

Login or Register to reply.