31 May 2022

Compare Takeoff and Cost differences between 2 model versions using Model Properties API

Takeoff to cost sample V2

Takeoff to cost enhanced sample

Follow @JohnOnSoftware

Last year, we announced the new ACC Takeoff API around the end of last year. I also created one sample to calculate cost for takeoff items under package, then send the result to ACC Cost Management, you can also refer details at https://forge.autodesk.com/blog/autodesk-takeoff-sample-integrate-cost-management.

But if any document under the takeoff package is updated with a new version, is there an easy way to do quick check what are changed, will it save your money or cost more? With the new Model Properties API released early this year, I enhanced the forge-takeoff2cost sample to use Model Properties API for the following features:

1. List all the changes comparing with the latest version, including what is added, removed, and changed, for demo purpose, only the element types(Wall, Door, Floor, Glass, Window) in the price book are considered, it uses filter as follow:

{
    "query": {
        "$or": [
            { "$eq": ["s.props.p20d8441e", "'Walls'"] },
            { "$eq": ["s.props.p20d8441e", "'Windows'"] },
            { "$eq": ["s.props.p20d8441e", "'Doors'"] },
            { "$eq": ["s.props.p20d8441e", "'Floors'"] },
            { "$eq": ["s.prev.props.p20d8441e", "'Walls'"] },
            { "$eq": ["s.prev.props.p20d8441e", "'Windows'"] },
            { "$eq": ["s.prev.props.p20d8441e", "'Doors'"] },
            { "$eq": ["s.prev.props.p20d8441e", "'Floors'"] }
        ]
    }
}

The field of key p20d8441e represent the category property as follow, 

{
    "key": "p20d8441e",
    "category": "__category__",
    "type": "String",
    "name": "_RC",
    "uom": null
}

You will get the result shown as follow, the implementation is mainly based on https://github.com/Autodesk-Forge/forge-model.properties-versions.difference .

Model Diff

 

2. List the cost changes if there is any new version of the 3D document under the package. It will go through all the changed and removed elements(new added elements will not be considered at this moment since they are not set as takeoff items), and check if the element is specified as a takeoff item under this package, remember, only these elements which are connected to the takeoff items under the package will be taken into consideration to calculate the cost change. You will get the estimated cost changes as the follow for example:

Cost Estimation

If you are interested in the sample, please check all the details at https://github.com/Autodesk-Forge/forge-takeoff2cost-versions.difference.

 

 

 

 

 

Related Article