This week we continue on the path to automating interior elevations. As a reminder, I have been building a plug-in that automates various parts of creating interior elevations, and I will continue to develop it. Since this project will evolve as I continue, I have determined to set my primary goal for each stage. With this goal in mind, I will develop a functioning piece of software to meet the goal. Then I will discuss topics that cover key aspects for each step for building the plug-in. At the end of each stage, I will move the plug-in to a public repository on GitHub so you can use it too.
Part 1: filtered element collector [c#]
Part 3: ViewFamilyTypeId
Part 4: ViewPlanId and Levels
Part 5: phases & goal #1 complete [includes GitHub link to the release]
Part 6: view tempaltes
Part 7: resizing CropBoxes
Part 8: creating FilledRegions & Goal #2 Complete [includes GitHub link to release]
Part 9: coordinate system utilities
Rename the interior elevations based on the room name, add a suffix based on the cardinal directions to identify the elevations
Since we set up our utility methods last week we now have a very easy time renaming our elevations. We create a new public method that does not return anything and call it RenameElevation. It uses the document, the interior elevation ViewSection, and the room as parameters. For this plug-in I have decided to rename the elevations starting with the room number, then the room name, and then a suffix based on the direction the interior elevation is looking (utilizing the utility methods GetVectorAngle and Angle2Cardinal discussed in Part 9). I decided to assign the suffix A to North, B to East, and so on, rotating counterclockwise. You can change this to be whatever you like. We do want to use a try-catch statement when concatenating our string because I found that when a room is not placed, sometimes assigning the new name fails. This way our program skips the name assignment so our program doesn’t crash if there are any problems.
Then we just add this method to the Execute method of our plug-in and we are done!
We have created a plug-in that will automate your interior elevations for you,
create the tag at the center of the room, consider multiple levels and phases,
assign a view template to the interior elevations, reset the crop boundary,
set up a masking region, and rename the interior elevation based on the room number
and name. You can access the updated code on my
. There you can also
download the DLL
so you can use the updated plug-in too.
Next week we'll take a short break from plug-ins and discuss BIM strategic planning.
Please note that since we have now added even more filters and hard-coded selections, there are a couple of things you need to use this plug-in as written. Your Revit file needs: