Revit Dynamo Graph to Align Text or Label with Detail Lines
Posted on 3rd August 2017
Categorised as dynamo, revit, training, tutorial
Tagged with Dynamo, Dynamo Studio, Revit

By Tassos, our Revit and Dynamo Expert

Traditionally, when drafting text on technical drawings by hand we would use either letter stencils or write the text directly onto paper. When doing so, we would make an effort to best align the text with existing geometry such as lines, other text etc. We may have even used a ruler to improve the alignment.

Then, we started using software such as AutoCAD, and writing text became a much easier task. We were now able to access spot on accuracy and we could now align the text insertion point with the start point of line geometry. Naturally, this made us obsessed with accuracy!

old-cad-drawings

Years later, Revit appeared on the scene and as it became more popular, people discovered its powerful functionalities. Revit does a lot, but one thing that it does not do is – align text with geometry, although it will align one text element with another when you try to move one.

For example, this could be useful when we create a Title Block for our company or Annotation Symbols and Tags. We create those only once and we use them over and over. It would be nice to position text within their definition spot on accurate.

Therefore, to help resolve this issue I have created a Dynamo Graph that uses a python script to gain access to Revit’s API functions, which you can download from here.

revit-text-align-dynamo

This Dynamo Graph will allow you to select a detail line and a text or a label from your document and align the text with the detail line taking into account the horizontal and vertical alignment properties of the text or label as well as the offset values given in millimetres. So basically, if the horizontal alignment parameter of the text or label is set to ‘Left’ then the graph will align the text with the start point of the line, likewise, if it is set to ‘Center’ it will align with the midpoint of the line, and if it is set to ‘Right’ it will use the end point of the line. Once that point is determined it will then apply the offset values from that.

revit-align-text

Highlighted aligned text with line shown above.

You may now update your own Title Blocks, Annotation Symbols and Tags using this graph and position text and labels exactly where you want them!

Please note that this graph has been developed using Dynamo 1.3.1. If you would like to use these Dynamo and Revit files you can download them from our public Google Drive.

If you have any questions about this tutorial please get in touch at info@bmarq.co.uk. If you are interested in Revit and Dynamo training courses make sure to visit bmarqtraining.co.uk.

© 2023 Benchmarq Ltd | Privacy Policy | Jobs
Benchmarq Ltd - Registered in England No. 05402391 - VAT No. 858 741 874 Registered office c/o Richard Place Dobson, 1-7 Station Road, Crawley, West Sussex RH10 1HT