The Revit 2012 API includes a number of important MEP specific enhancements, some completely new APIs have been added which are especially useful in the MEP domain, and last but not least, all of the many significant Revit platform enhancements are useful for MEP as well.
The major Revit MEP enhancements include:
A number of minor enhancements have also been made to the Revit MEP API, e.g. spare and space circuits, cable tray and conduit domain, connector, MEP system and space properties, and disconnection warnings.
Completely new APIs which are applicable to the MEP domain include:
Furthermore, the Revit platform API enhancements include some features which are especially useful in the MEP domain, such as new classes for the analysis of room and space 3D geometry, new geometry functionality, and new support for handling linked files.
Here is a very brief overview of the main product enhancements, followed by a more detailed look at the API features. For more information, please refer to the What's New section in the Revit API help file RevitAPI.chm, which is included in the Revit SDK, available from the Revit Developer Center.
Here are some of the key features of Revit MEP 2012 from a product point of view:
Revit MEP introduces placeholder elements which can be used to indicate a planned layout when the system itself has not been fully sized. You obtain maximum planning flexibility with a minimum of input. The placeholders can be converted into true duct and pipe elements later on. Placeholders can be assigned a size and slope.
In the API, the following new properties identify placeholder ducts and pipes:
These new static methods allow creation of placeholder ducts and pipes:
New utility meds are exposed to convert a set of placeholder ducts and pipes to real 3D entities:
This functionality is demonstrated by the MepPlaceHolder sample in the Revit 2012 API webcast recording and material (see below). It defines two external commands, CreatePlaceholders and ConvertPlaceholders.
In previous versions of Revit, insulation and lining had to be modelled separately in the family definitions, practically tripling the amount of geometry that needed to be defined. In Revit 2012, insulation and lining can be added programmatically instead. In the user interface, insulation can now be added to an entire duct or pipe run in a single command, and lining to an entire duct run in a similar way. Fittings and flexible ducts and pipes can also be selected and processed.
The new API classes DuctInsulation, PipeInsulation, DuctLining and related types support read, write and create access to duct and pipe insulation and lining. In Revit 2012, these objects are now accessible as standalone elements related to their parent duct, pipe, or fitting.
MEP pipe settings are now accessible programmatically. The following new classes provide read and write access to them:
A new feature added to the Revit API that is of special interest in the MEP domain is the detailed energy analysis model API. It enables you to obtain and analyze the contents of a project's detailed energy analysis model, as seen in the Export to gbXML and the Heating and Cooling Loads features. This analysis produces an analytical thermal model from the physical model of a building. The analytical thermal model is composed of spaces, zones and planar surfaces that represent the actual volumetric elements of the building.
The method EnergyAnalysisDetailModel.Create generates the model, which can the be traversed using methods such as GetAnalyticalSpaces, Surfaces, Openings, ShadingSurfaces.
This is demonstrated by the new SDK sample EnergyAnalysisModel:
A second new API deals with energy analysis on conceptual design models. New classes provide access to the elements and objects created by Revit to perform this kind of analysis, and using the Document.Export method with a MassGBXMLExportOptions instance supports export of a gBXML file containing conceptual energy analysis elements (mass elements) only.
A number of small enhancements and changes have been made to the Revit MEP API:
Spare and space circuits: The new property ElectricalSystem.CircuitType identifies the type of an electrical circuit (circuit, spare or space). The method ElectricalSystem.AddToCircuit now throws an exception when the system is a spare or space circuit.
Cable tray and conduit domain: The Autodesk.Revit.DB.Domain enumeration adds a new value to represent cable tray and conduit.
Connector: New read-only properties have been added for the JointType, GenderType and EngagementLength.
MEPSystem: The new property MEPSystem.IsEmpty identifies if the system currently contains no components.
Graphical warnings for disconnects: The new 'show graphical warning' properties on the Application class and the matching setters control whether Revit MEP will highlight disconnects in systems graphically.
Space properties: The new property Space.BaseHeatLoadOn indicates if the value of Space.LatentHeatGainperPerson and Space.SensibleHeatGainperPerson properties is the default value or if it is user-defined.
Fitting methods: The Document methods to create new fittings no longer remove unused or dangling curve connectors.
The material presented here was also discussed in the Revit 2012 API webcast, and before that in somewhat less detail in the DevDays Online presentation. Recordings and sample material for both of these are now available from the ADN webcast recordings archive. Filter for "Revit API" and "Developer Days Online: Revit" respectively, "English", and "Webcast".
Here are direct links to the Revit 2012 API webcast recording and material and the DevDays Online recording and material, respectively.