(Part of the What’s New in the Revit 2010 API series)
As with each release of the Revit API, there are a ton of enhancements to the “Elements” area of the Revit API. Whether it’s new capabilities on existing elements, or new Element classes to make Revit elements more identifiable and understandable – enhancements here are a big deal.
Elements and Materials
One of the features I’m most excited about is the new Element/Material part of the API. In the past, trying to do material take-offs with the API was tough – especially if the designers were using Split Faces (which almost everyone does). You pretty much had to export out to ODBC or schedules to Excel in order to extract what you needed. But no more.
In Revit 2010, every Element has a Materials property to show all the materials associated with an element. Further, you can call Element.GetMaterialArea( Material ) or
to get the area or volume of material for that element. With this, people trying to do material take-offs through the API should be in far better shape!
For a number of releases, Revit has supported the hiding of individual elements on a view-specific basis. While great for designers, it did pose occasional challenges for developers. Now, the API offers up:
Element.CanBeHidden ( View v )
Element.IsHidden( View v )
as well as:
View.Hide( Element e)
View.UnHide( Element e)
This should give developers powers similar to what you can do in Revit interactively (that fairness which every CAD developer yearns for :) ).
There are few enhancements with Family and FamilyInstance elements:
- Family.IsInPlace (this was possible heuristically in previous releases – but it’s always better to make it obvious)
- Family.IsCurtainPanelFamily (because of the special additional properties – it’s good to know this directly)
- FamilyInstance.IsSlantedColumn (another situation where there are special additional properties)
- FamilyInstance.Space (similar to familyInstances knowing which Room they reside in, now they know which space they reside in – very useful for MEP families!)
New Element Classes
The following classes are new in 2010:
- AreaScheme (see below)
- DividedSurface (with an amazing amount of depth!)
- Form (representing all of the Family solid content, and also with a huge amount of depth)
- ImportInstance (used for DWG imports, etc)
- PointOnEdgeEdgeIntersection (I think you might need to have a PhD or be Russian to understand this :) ).
- SpacingRule (structure and grids)
- TopographySurface (with an “AddPoints” method, no less)
There appear to be a few enhancements to Area elements that are of note:
- New AreaScheme element (this typically is set for “Rentable”, “Gross” but also apparently has some new BOMA settings for facilities management people)
- Areas have a link to their scheme
- ViewPlans have a link to the AreaScheme (where appropriate)
Dimensions also seem to have some upgrades in 2010. In particular:
- Dimensions have DimensionSegments
- The “Locked” property (read/write) has been added
Other Miscellaneous Enhancements
A few others that I couldn’t categorize:
- Blends now have access to Profiles, Offsets and VertexConnections.
- CurtainGridLines now have ExistingSegmentCurves
- Grid.ExtendToAllLevels method
- GBXMLParamElement now has an ExportComplexity object associated with it which contains all sorts of things to control how GBXML is exported (including, for example, how to handle Shading Surfaces).
- ModelCurve now exposes:
- Opening exposes IsTransparentIn3D and IsTransparentInElevation.
Two that I’ll be writing about a little later:
- Room.IsPointInRoom (XYZ)
- Space.IsPointInSpace( XYZ )
A few items seem targeted at making it easier to get geometry references and planes:
- Level now exposes a PlaneReference (to make things easier)
- SketchPlane exposes:
Wow. Again – there’s enough in these enhancements, new classes and more to keep us busy for quite some time.