lisa-marie mueller

lisa-marie mueller

bullet pont

rename views & goal #3 complete link

December 13, 2019

Laptop with code on screen, film camera, floppydisk, yellow 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.

if you missed it:

Part 1: filtered element collector [c#]

Part 2: finding centroids and considering exceptions

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

primary goal #3

Rename the interior elevations based on the room name, add a suffix based on the cardinal directions to identify the elevations

RenameElevation

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.

add to execute

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 GitHub account . 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:

  • to have all the rooms placed for which you want to create the interior elevations
  • an elevation ViewFamily type with a name that contains “interior”
  • a ViewPlan with a name that contains “interior elevations”
  • a ViewTemplate with a name that contains “interior” and “elevation”
  • a FilledRegionType with the BackgroundPatternColor set to white (RGB 255, 255, 255)
  • a LineStyle with a name that contains “05” and “solid”

resources

If you want to learn to code and don’t know where to start check out my posts about Steps to Learn to Code [for architects and designers] Part 1 and Part 2.

Revit API Docs