Skip to content
Get on GitHub Autodesk App Store - coming soon

Take quantities out to Excel

Goal: count items and total a quantity for each category, and save the result as an .xlsx file.

Before you start

  • Open a model in Navisworks and the CamelGraph editor.
  • Know the tab and property to read, for example Element ▸ Category and Element ▸ Volume in a Revit-sourced model (find the names). Use the names your model shows.
  • Excel does not have to be installed. CamelGraph writes .xlsx itself.

Download the graph

Steps

  1. Add a Number node (Input). Double-click its title and rename it Minimum volume. Leave the value at 0.
  2. Add Search.ByProperty (Navisworks ▸ Search). Type Element into categoryName, Volume into propertyName and choose > in the mode drop-down. Wire the Number into value. It finds every item whose volume is above the minimum.
  3. Add Properties.ToTable (Navisworks ▸ Properties). Wire items from the search into its items.
  4. Its properties input is a list of column names and has no box. Add a String node (Input), rename it Columns to read and type @Name,Element.Category,Element.Volume. Add a String.Split (String) with the separator ,, wire the String into its text and its list into properties. @Name is the item name; the others are Category.Property.
  5. Add a Watch Table (Display), rename it Rows read, and wire the table output into it. Press F5 and check the rows. An empty cell means the item does not carry that property.
  6. Add Table.GroupBy (Table). Wire the table into table and type Element.Category into by.
  7. The aggregations input has no box either. Add a second String, rename it Totals to work out and type count,sum:Element.Volume as Volume. Add a second String.Split with the separator , and wire its list into aggregations. The result has one row for each category with the columns Element.Category, count and Volume.
  8. Add Table.Sort (Table). Wire the table in, type Volume into columns and tick descending. The largest total comes first.
  9. Add Table.ToExcelFile (Table). Wire the sorted table in. Type a full path into path, for example C:\Reports\qto.xlsx, and Quantities into sheet.
  10. Press F5.
A Watch Table close up: a grouped table with one row for each category, a count and totals. A Watch Table close up: a grouped table with one row for each category, a count and totals.
A Watch Table close up: a grouped table with one row for each category, a count and totals.
The quantity take-off graph: Search.ByProperty, Properties.ToTable, Table.GroupBy, Table.Sort and Table.ToExcelFile. The quantity take-off graph: Search.ByProperty, Properties.ToTable, Table.GroupBy, Table.Sort and Table.ToExcelFile.
The quantity take-off graph: Search.ByProperty, Properties.ToTable, Table.GroupBy, Table.Sort and Table.ToExcelFile.

What you get

A workbook with one worksheet named Quantities. The first row holds the column names and each row below it is one category.

Where the workbook goes

A relative path such as Quantities.xlsx goes next to the graph file (or into Documents\CamelGraph if the graph has not been saved). A full path always works. Quotes that Explorer's Copy as path adds around a pasted path are removed.

Other aggregations

Table.GroupBy also works out average, min, max, median, first, last, list and distinct. Add as Name to name a result, as step 7 does.

If it does not work

Next