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]
Override the view’s parameters to set a view template, update the extents of the views, create a masking region, override the inside line weight of the masking region
We now have a functioning plug-in that places our interior elevations, but it would be great to automate some additional tedious tasks like applying our masking region, double-checking the extents, and setting some standard Revit parameters. This week we will look at setting a view template for our interior elevation views.
Interior elevations have a ViewTemplateId that we can simply set after we find the view template we want to use. To find it we can use a FilteredElementCollector. One thing I discovered while putting this together is that although in Revit, the view templates are listed under categories (plan view templates are under a different category drop down then elevations) this has no relationship to anything that I could find in the Revit API, they all seem to be in one large bucket. This is why we filtered by name only. We set the filter to look for view templates that contain “interior” and “elevation” in the name. Depending on what you have named your view templates, you will need to adjust these filters to match the name you chose.
And that’s it. Pretty straight forward to set a view template. This same concept can also be applied to other Revit parameters of the view. If you categorize your views, for example, you can assign the correct category for interior elevations when they are created. Next week, we will update view extents to match the extents of the room and get rid of that pesky problem of having a small crop height on interior elevation views depending on your floors and levels (also discussed on the forums)