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:
- Placeholder ducts and pipes
- Duct and pipe insulation and lining
- Read and write access to MEP pipe settings and sizes
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:
- Detailed energy analysis model API
- Conceptual energy analysis API
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.
Revit MEP 2012 Product Features
Here are some of the key features of Revit MEP 2012 from a product point of view:
- Placeholder elements
- Insulation and lining
- Parallel pipe and conduit runs
- Sloped piping enhancements: settings, tooltips, connection
- System browser enhancements: filtering, hovering and selection
- System enhancements: graphic overrides and warnings, disconnect markers, materials, calculation control, connector labels
Placeholder Ducts and Pipes
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:
- Duct.IsPlaceholder
- Pipe.IsPlaceholder
These new static methods allow creation of placeholder ducts and pipes:
- Duct.CreatePlaceholder
- Pipe.CreatePlaceholder
New utility meds are exposed to convert a set of placeholder ducts and pipes to real 3D entities:
- MechanicalUtils.ConvertDuctPlaceholders
- PlumbingUtils.ConvertPipePlaceholders
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.
Insulation and Lining
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.
Pipe Settings and Sizes
MEP pipe settings are now accessible programmatically. The following new classes provide read and write access to them:
- PipeSettings – The pipe settings. There is one object of this type in a document accessible through the static method GetPipeSettings.
- PipeSizeSettings – The main class to access pipe sizes. There is one object of this type in a document accessible through the static method GetPipeSizeSettings. Stores PipeConnections for each pipe material, using the id of the pipe material element as key to access.
- PipeSizeSettingIterator – An iterator to a set of items from PipeSizeSettings. Each item is a KeyValuePair
. - PipeConnections – Represents a set of pipe connection types. Stores PipeSchedules per each pipe connection type, using the id of the pipe connection type as key to access.
- PipeConnectionIterator – An iterator to a set of items from PipeConnections. Each item is a KeyValuePair
. - PipeSchedules – Represents a set of pipe schedules. Stores PipeSizes per each pipe schedule type, using the id of the pipe schedule type as key to access.
- PipeScheduleIterator – An iterator to a set of items from PipeSchedules. Each item is a KeyValuePair
. - PipeSizes – Stores a set of pipe sizes, with the ability to add and remove from the set as needed.
- PipeSizeIterator – An iterator to a set of MEP pipe sizes from PipeSizes.
- MEPSize – Stores the basic size information for an MEP duct, pipe, cable tray, or conduit.
Detailed Energy Analysis Model API
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:
Conceptual Energy Analysis API
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.
Small Enhancements and Changes
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.
Revit 2012 API Webcast Recording
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.