Revit + Dynamo - Apply coordinates to columns - example 17

Picture 1: Overview

0. Intro

A problem that might occur when working with a lot of columns is the creation of a schedule with x,y,z coordinates, Revit doesn’t seem to have a good solution here.  In this post, we will solve it. We do that by finding X, Y, Z coordinates with dynamo, and then transfer it back into every single column placed. 

But before we apply the dynamo script, the column must have some predefined parameters(X, Y, Z), as shown in the picture above. This is implemented using shared parameters. Not going through shared parameters in this post.

1. Input

As always, we start with the input values. Family Types, select the column type you want to apply the X, Y, Z coordinates to, when selecting family types, it will mark all columns that are within this family type.

In some cases, dynamo struggles to find the Z value for the columns. If so, you need to extract some info from each column from the properties menu. The Number 63000 represents the Top Level OK Betong – Brygge level height where the columns have their constraints. 

The String name Top Offset is the distance each column has from the Top Level.

 

Picture 2

2. X, Y coordinates

Element.GetLocation is used to extract the coordinates from each of the selected family types. The coordinates extracted is in local, we need it to be global. Geometry.Transform will get the job done, as shown in the picture above. Separate the coordinates in X and Y, with Point.X and Point.Y.

Picture 3

3. Z coordinates

As mentioned before, and seen above, the Z-value will on some locations not display properly, and we need to get the Z value with some calculations from the input values. It’s a basic formula, a+b (number + string) (Top level + Top Offset), and there we have it!

Picture 4

4.Revit

The last step is to push the newly found coordinates back to the columns in the correct parameter box, in this case, X, Y, Z. Use the node Element.SetParameterByName to do it. in total will 31 columns get coordinates in their properties, further, this information can be used to set up a schedule as shown in the video below.

Mark, if either one of the columns is moved, the script must be run again to update the coordinates.

Picture 3

5.Video demonstration