Script - Automatically Dimension Elements In Views

I’ve finished a script I’ve been working on over the last few days, and I thought I’d share it and get feedback.

We are starting to document a large project and want to speed up basic tasks. This script automatically adds dimensions to elements based on their Left & Right reference planes. We’re using it to dimension Casework in our Interior Elevations, but it can be applied to other categories and view types.

Script flow:

  • Collects Views, filtered by User’s input of Name (Partial Match) and View Template (for us, isolates Documentation Elevations vs. Working or Design ones)
  • Gets elements in Views, filtered by User’s Category and Family Name selections
  • Gets Left & Right References of Elements, removing duplicates based on those References’ SketchPlanes’ X-Coordinates (this may need to be changed to X AND Y Coordinates for use in Plan Views)
  • User selects Dimension Style from a list (Edit: Used the DataShapes package to create a custom input of Dimension Styles)
  • Gets first element in each view’s Level. Creates a line (in Dynamo) on this Level’s Elevation.
  • User selects height offset from this line to draw their dimension(positive values = above, negative values = below)
  • Dimension.ByReference based on those unique Left & Right References in the filtered View list

Edit: used Element’s Level and a user-selected offset to determine the height of the dimension string

Tested on Revit 2018 and Dynamo 2.0.2
Packages Required:

  • ArchiLab
  • GeniusLoci
  • Springs
  • DataShapes

Annotation - Dimension Elements in Views.dyn (101.9 KB)


Why ? :frowning:

Try to fill in the good (part of) View name and the View template.

After that you have to check the category and Family Name filter at least.
It worked for me.
Great work @steinah6 thanks a lot.