Extract the Inventory for a Takeoff Project
This tutorial demonstrates how to extract the inventory items for a takeoff project. This will include:
- Retrieving all the packages
- Retrieving all the takeoff types
- Retrieving all the takeoff items
To learn more about the inventory tool, see the Forma Takeoff Inventory help documentation.
Before You Begin
- Register an app, and select the Forma API.
- Provision your app to acquire access to your Forma hub.
- Acquire a 3-legged OAuth token with the
data:readscope. - Verify that you have access to the relevant Forma project.
Step 1: Retrieve the Packages
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) to retrieve the packages, by calling GET packages.
To find the project ID, see the Retrieve Forma Hub and Project ID tutorial.
Request
Response
The response payload includes the package IDs (results[i].id).
Step 2: Retrieve all Takeoff Types and Items
Part A: Get all the Takeoff Types
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) and package ID (6e330582-ad88-4299-85e6-b749e8dec40d) from the previous step to retrieve the takeoff types, by calling GET takeoff-types.
Request
Response
Part B: Get all the Takeoff Items
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) and package ID (6e330582-ad88-4299-85e6-b749e8dec40d) from the previous step to retrieve the takeoff items, by calling GET takeoff-items.
Request
Response
Retrieve Additional Information (optional)
Below are some examples of how to obtain additional information, relating to a takeoff project, that would allow you to construct an inventory tool, similar to what appears in the UI. For more details, see the Takeoff Inventory help documentation.
Get the Assigned Structures
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) to retrieve the classification structures (trees) assigned to the project, by calling GET assigned-structures.
Request
Response
The response payload includes the assigned structure (tree) IDs. This can be used with the GET trees/{treeId} API to find structure or tree information.
Request
Response
Get the Classifications Nodes for the Structures or Trees
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) and Assigned Structure structure ID (1a07c80a-3892-40b1-8a2f-3d0b05786d70) from the previous step to retrieve the tree nodes, by calling GET trees/{treeId}/versions/tip/nodes.
Request
Response
Deprecated - Get the Classification Systems
This workflow has been deprecated, use the new Assigned Structures and Classifications API to get this data.
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) to retrieve the classification systems, by calling GET classification-systems.
For more details about classification systems, see the Configure Takeoff Settings help documentation.
Request
Response
The response payload includes the classification system IDs (results[i].id).
Deprecated - Get the Classifications for a Classification System
This workflow has been deprecated, use the new Assigned Structures and Classifications API to get this data.
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) and classification system ID (1a07c80a-3892-40b1-8a2f-3d0b05786d70) from the previous step to retrieve the classifications, by calling GET classifications.
Request
Response
Get Sheet or Model Information
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) to retrieve the content views, by calling GET content-views.
A content view is either a 3D BIM model view, or a 2D PDF sheet that a user could use to create takeoffs.
Request
Response
For sheet names, the name is under results[i].view.sheetName where results[i].type is SHEET.
For model names, use results[i].view.lineageUrn where results[i].type is FILE-MODEL, and continue to the next step.
Get the Model Name
Use the project ID (7388a640-3bff-4328-9dc2-aafe62359958) and lineageUrn (urn:adsk.wipprod:dm.lineage:TwJx1922Sq2MsljlLsTYFQ) to retrieve the model name, by calling GET project items.
Request
Response
The model name is under data.attributes.name.
Imported from the Autodesk Platform Services documentation: https://aps.autodesk.com/en/docs/acc/v1/tutorials/takeoff/takeoff-extract-inventory.