Revit Dynamo - Apply coordinates to columns
Managing a multitude of columns can pose a challenge, primarily in establishing an efficient system for defining their coordinates and creating an organized schedule. Unfortunately, Revit lacks a robust solution for this issue.
In this article, we will address this problem using Dynamo, following a three-step approach:
- Retrieve essential column data from Revit.
- Structure and manage the data within Dynamo.
- Update Revit with the organized data by populating the predefined column parameters.
Step 1: Data extraction
We start with the data extraction and the input values. The node Family Types is selected; 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 and with the node, all elements of family type load all the data to Dynamo regarding this column type.
However, it’s worth noting that Dynamo cannot directly acquire the z-coordinate, necessitating an alternative approach. The node Levels in pairs with the level elevation will provide the z-coordinate. To pinpoint the correct level, it is essential to cross-reference the levels to which the columns are connected within the Revit environment.
Step 2: Data organization
The String name Top Offset is the distance each column has from the Top Level, selected in step 1. The calculated value is the top z-coordinate for each column.
Element.GetLocation is used to extract the coordinates from each of the selected family types. The coordinates extracted are local; we need them to be global. Geometry.Transform will get the job done. Select the correct coordinate system which in our case is Survey.point. Be aware that for this to work, it is crucial that the survey point is at 0.0.0 in the Revit environment.
Separate the coordinates in x and y, with Point.X and Point.Y.
Step 3: Report back to Revit
The final step involves updating the columns with the newly organized coordinates within the appropriate parameter fields, specifically the x, y, and z values. This can be accomplished using the Element.SetParameterByName node. In this process, a total of 31 columns will have their coordinates integrated into their properties. Furthermore, this data can be utilized to generate a schedule, as demonstrated in the accompanying video.
It’s important to note that if any of the columns are moved, it is imperative to re-run the script to ensure that the coordinates are kept up-to-date.