What's New in the Revit 2016 API

Here is the online version of the 'What's New' section of the Revit 2016 API help file.

The information provided here is extracted from the document 'Revit Platform API Changes and Additions.docx' provided with the Revit SDK. As said, is also included in the 'What's New' section in the Revit API help file RevitAPI.chm.

This is very important information, even for later reference. The explanation of the changes and enhancements are well worth referring to later on as well, to understand how things work together the way they do.

I am putting it online to ensure that this valuable information is available through web searches.

To look up the introduction of older features, here are links to the previous 'What's New in the API' discussions:

For more detailed information, please refer to the complete API documentation in the SDK and the online Revit API Developers Guide provided within the Revit 2016 Help.

For an introduction and quick overview of the main highlights of the new API functionality and a couple of sample application demonstrating their use, please refer to the Revit 2016 API News and DevDays Online Recording.

Before diving into the API news, a note on RevitLookup:

RevitLookup for Revit 2016 Updated Again

I released the first version of RevitLookup for Revit 2016 two days ago, and am following up with a little fix.

In the post-build event, the previous version was copying the add-in manifest and DLL assembly it produced to the Revit 2015 add-ins folder.

Happily I happened to try to make use of it in Revit 2015 and thus noticed quite soon, because obviously the 2016 version did not work there.

The new updated version with that rectified is provided in release 2016.0.0.7

In general, you can simply grab the latest version from the RevitLookup GitHub repository.

If you need a version for Revit 2015, the latest available one for that is release 2015.0.0.8.

Major changes and renovations to the Revit API

This document consists of two main sections, on API changes and additions:

API changes

TextNote and Leader API behavior and interface changes

The Revit API classes related to TextNotes and Leaders have been significantly renovated.

TextElement class

New methods and properties

TextNote class

New methods and properties

Leaders

The LeaderArray class has been deprecated, thus members which referred to it have been replaced:

The Leader class now includes new members:

DatumPlane API (Levels, Grids, Reference Planes) changes

DatumPlane

The new class:

is now a base class for element types that represent a datum surface (level, grid or reference plane)

This base classes offers many new methods and properties:

Level

Some members related to levels have been obsoleted and replaced:

Grid

Some members related to grids have been added, or obsoleted and replaced:

ReferencePlane

Some members related to levels have been obsoleted and replaced:

Structural API changes

ContFooting and ContFootingType class and members renamed

The ContFooting and ContFootingType classes have been replaced by new classes:

The following members have been modified or added to WallFoundation:

AnalyticalModel

AnalyticalModelSweptProfile class renamed and relocated

The class:

has been renamed and moved to become:

All members of the class stay the same.

Two members have been transferred from the AnalyticalModel class to the FamilyInstance class:

Loads

The Revit API classes related to Loads have been significantly renovated.

The new class

has been introduced as a new base class for PointLoad, LineLoad and AreaLoad. Properties of this class affect properties of all 3 types of loads:

In the subclasses of LoadBase, there are some new members, and many members have been deprecated and replaced, as shown in the following table.

Load cases and load combinations

The Revit API classes related to Load Cases and Load Combinations have been significantly renovated. This has introduced new members to the LoadCombnation, LoadCase, LoadNature and LoadUsage class, and resulted in several previously existing member being marked deprecated and replaced, as shown in this table:

LoadComponent

The new class:

is responsible for association of LoadCase or LoadCombination ids as factors in the load combination.

BoundaryConditions

In the BoundaryConditions class, there are some new members, and some members have been deprecated and replaced, as shown in the following table.

RebarShapeDefinition

New validation has been introduced to confirm that the name of a shared parameter to be added was notalready used by another shared parameter on the element. This new validation was added to methods:

and this situation will now trigger an exception.

Geometry API behavior and interface changes

PlanarFace

The properties:

have been obsoleted.

The replacement properties are:

Note that PlanarFace.FaceNormal will return a vector consistently pointing out of the solid that this face is a boundary for (if it is a part of a solid) (unlike PlanarFace.Normal which it replaced).

Curve.MakeBound() and Curve.MakeUnbound()

These previously threw an exception if the Curve was marked read-only (IsReadOnly). These methods now will succeed, but cause the read-only Curve handle to automatically contain a copy of the original curve which is disconnected from its source. It is still not possible to modify a read-only geometry object directly through manipulation of its geometry.

CurveLoop iteration

When iterating Curves contained in a CurveLoop, a copy is now received instead of a reference to the original CurveLoop Curve. This is to prevent possible instability due to attempting to modify the CurveLoop's Curves directly, or if the CurveLoop is collected by the garbage collector while a Curve is still in use.

CurveLoop.CreateViaThicken()

This method now enforces that the thickness value parameter will result in a curve which exceed Revit's short curve tolerance (Application.ShortCurveTolerance).

Point creation

New methods to create a Point object had been added.

The methods replace the deprecated:

TessellatedShapeBuilderOutcome

The enumerated value SolidOrSheet has been removed from this outcome, and replaced by separate values Solid and Sheet. That allows the TessellatedShapeBuilder caller to detect if the builder was able to create a true solid or an open manifold ("sheet")..

Energy Analysis and gbXML API changes

EnergyAnalysisDetailModel creation from building elements and volumes

The function:

now offers the ability to create energy model based on analysis of building element boundaries and volumes (set EnergyAnalysisDetailModelOptions.EnergyModelType to BuildingElement). This option matches the default energy model creation used by Revit's user interface. The generated energy model is affected by settings in EnergyDataSettings, including the option to use the new enumerated value:

This option sets the generation of the EnergyAnalysisDetailModel to use the combination of conceptual masses and building elements.

EnergyAnalysisDetailModelOptions

The new property:

indicates whether the energy model is based on rooms/spaces or building elements.. Options are:

Lifecycle of EnergyAnalysisDetailModel elements

Users and API application are now able to create a persistent energy model which can be activated in displays and views. As a result,

now requires a transaction to be active so the new elements can be created in the associated document.

The new function:

returns the main EnergyAnalysisDetailModel contained in the given document – this is the model that may be displayed in associated views.

As a result of this behavioral change, the class EnergyAnalysisDetailModel and the sub-objects EnergyAnalysisSpace, EnergyAnalysisSurface, and EnergyAnalysisOpening are now subclasses of Element. These elements can be found by element filtering and other Revit API tools.

Because the energy model is now an element, the function:

has been obsoleted in favor of using Document.Delete() on the EnergyAnalysisDetailModel instead to remove the model and all associated elements.

It is recommended that applications call Document.Delete() on the EnergyAnalysisDetailModel elements that they create, but any energy models created after the main energy model will be deleted automatically before document saving or synchronization.

EnergyAnalysisSpace API changes

The property:

has been renamed from EnergyAnalysisSpace.Name. This change was necessary due to the inherited Name property on the new parent class, Element.

EnergyAnalysisSurface API changes

The properties:

have been renamed from EnergyAnalysisSurface.Name and EnergyAnalysisSurface.Id. These changes were necessary due to the inherited Name and Id properties on the new parent class, Element.

EnergyAnalysisOpening API changes

The properties:

have been renamed from EnergyAnalysisOpening.Name and EnergyAnalysisOpening.Id. These changes were necessary due to the inherited Name and Id properties on the new parent class, Element.

Export to gbXML behavioral changes

The method:

no longer generates the energy model. It is now required that there be a main energy model stored in the document before this export is invoked. If no energy model of the designated type exists prior to the call to export, this method will throw an exception.

RevisionSettings API changes

Enhanced RevisionSettings provide greater control over Revision numbering.

Alphanumeric revision settings

Alphanumeric revision settings replace the Alphabetic setting available prior to 2016.

The new class AlphanumericRevisionSettings offers the following members:

The enumerated value:

replaces the now removed RevisionNumberType.Alphabetic.

In the RevisionSettings class, new members were introduced to provide access to the AlphanumericRevisionSettings:

Numeric revision settings

The new class NumericRevisionSettings offers the following members:

The numeric revision settings can be accessed from:

ExternalDefinitionCreationOptions

The class:

has been renamed from ExternalDefinitonCreationOptions to correct a spelling error.

MirrorElements

The new overload:

allows mirroring with or without copying the elements first. The previously existing overload has been obsoleted in favor of this new method.

ReferenceIntersector

The behavior of ReferenceIntersector with the flag:

set to true has been improved. Previously, an applied filter was ignored when returning elements encountered in Revit links, and any element encountered would be returned. Now the filter will be evaluated for the elements found in the links, and those elements returned only if they pass the filter. Note that results may not be as expected if the filter applied is geometric (such as a BoundingBox filter or ElementIntersects filter). This is because the filter will be evaluated for linked elements in the coordinates of the linked model, which may not match the coordinates of the elements as they appear in the host model. Also, ElementFilters that accept a Document and/or ElementId as input during their instantiation will not correctly pass elements that appear in the link, because the filter will not be able to match link elements to the filter's criteria.

As before, if a list of target ElementIds is set, references in links will be returned only if the ElementId matches the id of the intersected RevitLinkInstance, and the ids will not be compared with the target list.

BaseImportOptions

The new property:

replaces the BaseImportOptions.SetRefPoint() and BaseImportOptions.GetRefPoint() methods.

BoundarySegment

As a cleanup, the unused duplicate classes Autodesk.Revit.DB.Architecture.BoundarySegment and Autodesk.Revit.DB.Mechanical.BoundarySegment have been removed from the API. The API interfaces already used Autodesk.Revit.DB.BoundarySegment instead.

The following changes were made to the BoundarySegment class:

ParameterType enum change

The enumerated value ParameterType.Image has been reordered internally in the ParameterType enumeration. Be sure to rebuild all API clients that use ParameterType and to only compare ParameterType values to each other and not to their internal integer values.

Schedule view rotation behavior

Some improvements have been made to API behavior for ScheduleSheetInstance if the instance is currently pinned (Element.Pinned is true):

Creating HostedSweeps (Fascia, Gutter, SlabEdge)

The validation of the input edges for:

has been relaxed, and should allow edges that are also allowed by the Revit UI.

DirectShape API and behavioral changes

DirectShapes in families

DirectShape elements can now be added directly to families and their geometry will be reflected in instances of that family placed in a host document.

DirectShape category

DirectShape elements may now only be assigned to top-level Model categories.

WireframeBuilder and DirectShape support for curves and points

The new class:

supports input of curves and points to form a geometry representation. This representation can be assigned to or appended to the geometry shown by a DirectShape or DirectShapeType element.

Curves and points can also now be directly passed to DirectShapes and DirectShapeType via SetShape(ShapeBuilder) or AppendShape(ShapeBuilder).

ViewShapeBuilder

The methods:

have been deprecated. Their replacements are DirectShape.SetShape(ShapeBuilder) and DirectShapeType.SetShape(ShapeBuilder).

DirectShape options

The new class:

offers options that the API developer can use to control the behavior of created DirectShape elements. Options can be set on either DirectShape or DirectShapeType.

Referencing option

DirectShape elements now support by default element references, including dimensions, alignments, and face hosting, as well as snapping.

The property:

supports options related to the referenceablility of the DirectShape or DirectShapeType – if set to NotReferenceable, the geometry may not be used for dimensioning, snapping, alignment, or face-hosting. The element may still be selected by the user for operations which do not reference individual geometry objects.

RoomBounding option

DirectShape elements now supports the ability to participate in room boundary calculations, if they are of an appropriate category for room boundary calculations, and if the associated "Room Bounding" parameter is set to true.

The property:

identifies whether the DirectShape supports an option for the "Room Bounding" parameter to permit participation in room boundary calculations. The default value is NotApplicable, but this will be changed automatically to SetByParameter for applicable DirectShapes.

Wire API behavioral changes

Several methods offer modified behavior from Revit 2015, so that they work in a manner more consistent with the Revit UI.

BrowserOrganization enum namespace change

The enumerated type BrowserOrganizationType has been moved to the Autodesk.Revit.DB namespace.

AdaptivePointOrientationType enumerated items renamed

All items of this enumerated type were renamed to better align the names with the corresponding text in the Revit UI. The numeric values of the items weren't modified, allowing existing applications to work. However, to be able to rebuild an application, all point orientations need to be changed to their respective new names.

CompoundStructure.SetLayers() behavioral change

The method:

now unsets the structural material layer index automatically.. Code that needs this property to be set after changing layers will need to set it explicitly.

API events – behavioral change

Although the Revit API has never officially supported such a work-flow it is now enforced that registering to and unregistering from events must happen while executing on the main thread. An exception will be thrown if an external application attempts to register to (or unregister from) events from outside of valid API context.

Collections removed from API

The following unused Revit API collection types have been removed from the API in 2016:

Methods and properties removed from API

The following previously deprecated methods and properties have been removed from the API:

Classes removed from API

The following previously deprecated classes have been removed from the API:

API additions

Worksharing API additions

Workset creation

The new static method:

creates a new Workset.

WorksetTable operations

New static methods:

The new method:

sets the active Workset.

Parameter API additions

Elements that store a reference to a parameter

The new class:

is an Element that stores information about a particular user-defined parameter in the document. This parameter's id is used when referencing that user-defined parameter. The ParameterElement class exposes:

The new class:

is an Element that stores the definition of a shared parameter which is loaded into the document. This class is a child of ParameterElement, and exposes the following additional members:

Geometry API additions

Create loft

The new method:

creates a solid or open shell geometry by lofting between a sequence of curve loops.

Solid – copy

The new method:

creates a new Solid which is a copy of the input Solid.

Solid – create transformed

The new method:

creates a new Solid which is the transformation of the input Solid.

Solid – cut with half-space

The new methods:

produce a solid which is the intersection of the input Solid with the half-space on the positive side of the given Plane. The positive side of the plane is the side to which Plane.Normal points. The first function creates a new Solid with the results, while the second modifies the existing solid (which must be a solid created by the application instead of one obtained from a Revit element).

Curve – set graphics style

The new method:

Sets the graphics style id for the curve. Many methods in the Revit API will not use the graphics style associated to this curve. For example, curves used as portions of the sketch of an element will not read this property. Newly created curve elements will not use this value either, as they inherit their graphical properties from their associated category.

CurveLoop – transform

The new methods:

allow transformation of an existing CurveLoop. The former transforms the curves contained within the CurveLoop (modifying itself), while the latter creates a copy of the original curve loop containing the transformed curves. In both cases, the new/modified CurveLoop is guaranteed to be valid with all consituent curves contiguous (assuming that the curves were contiguous in the input curve loop).

FaceSecondDerivatives

The new class:

contains second partial derivatives of a face at a specified point.

Face.ComputeSecondDerivatives

The new method:

allows users to access second coordinate derivatives of a face.

Custom Export API improvements

The API allowing custom export of 3D views and their contents has been extended to allow for more data in the output.

IExportContext

IExportContext is now a base class for two other interfaces that support different contents on export. This base class contains methods that are common to both the leaf interfaces. Although it is still possible to use classes deriving directly from this base interface (for backward compatibility), future applications should implement the new leaf interfaces only.

IPhotoRenderContext

This new leaf interface should be used for processing elements in the view in the same manner that Revit's Render command does. This is equivalent to what IExportContext allowed in Revit 2015 and earlier.

IModelExportContext

This new interface should be used for processing elements in the view in the same manner that Revit's processes them in 3D views. This context supports additional contents including model curves and text as shown in the 3D views. The new interface methods are:

The methods of this interface use the following new classes:

ModelCurveNodeA base class of output nodes that represent various model curves.
CurveNodeAn output node that represents a model curve.
PolylineNode An output node that represents a 3D polyline.
PointNode An output node that represents a 3D point
LineSegmentAn output node that represents a tessellated line segment
PolylineSegmentAn output node that represents a tessellated polyline segments.
TextNodeAn output node representing a text annotation object.
FormatedTextRunA structure that defines a single run of a formatted text.
LinePropertiesA structure that provides access to pen properties of exported lines/curves

Export API additions

DWFExportOptions

The new property:

sets an option indicating whether to export textures from Revit to 3D DWF files.

BaseExportOptions

The new property:

sets an option indicating whether the export process to DWG, DXF or DGN preserves coincident lines during export.

There is a newly supported string value for:

The value "DGN7" can be used only for DGN export.

Dimension API additions

Dimension class

The following new members have been added to support adjustment of the text location and corresponding leaders of a given single dimension:

DimensionSegment

The following new members have been added to support adjustment of the text location and corresponding leaders of a given dimension segment in a multi-segment dimension:

Reinforcement API additions

RebarContainer

The new element RebarContainer represents an aggregation of multiple Rebar sets. At this time it can only be created via the API. The advantages of using a RebarContainer are:

A RebarContainer element contains a collection of RebarContainerItem objects. RebarContainerItem is a new class offering an API similar to that of the Rebar element. RebarContainerItems can be created directly or duplicated from the properties of an existing Rebar element. RebarContainer has support for iteration of the items directly from the RebarContainer object.

RebarContainer API

RebarContainer offers several collections of APIs similar to those offered by Rebar for management of rounding settings, presentation in a given view, and host. In addition, it offers the following members for management of the container and its items:

RebarContainerItem API

RebarContainerItem offers many of the same APIs that Rebar offers, along with a few new members that allow management of the item within its parent container:

RebarContainerType API

The new class:

represents the type element used in the generation of a RebarContainer.

RebarContainer parameters management

The new class:

allows an application to manage and apply parameter overrides to a RebarContainer parameter. Normally parameters of the RebarContainer are derived from the parameters of the individual items it contains (if the parameter exists and has the same value in all items, it will exist and have the same value in the RebarContainer, while if the parameters are different in the individual items, the parameter will display without a value). Overrides allow an application to set a different value for a given parameter, or to add new shared parameters directly to the individual RebarContainer element.

The method:

returns an object used to manage parameters of the RebarContainer.

The following methods are provided by the RebarContainerParameterManager class:

Bent Fabric Sheets

It is possible using the Revit 2016 API to create a fabric sheet bent along bending curves. This is not possible in the Revit user interface.

It is not possible to convert a Fabric Sheet between flat and bent.

The following members allow creation and modification of bend fabric sheets:

PathReinforcement additions

The new static method:

New methods:

New properties:

Reinforcement Settings API additions

The new methods:

provide access to the settings related to tagging abbreviations for area or path reinforcement.

Reinforcement rounding API additions

The new members:

provide access to the rounding method applied to different values found in reinforcement lengths. The new property:

specifies the rounding method used to for specific format options. This property is currently only supported for Rebar parameters. FormatOptions objects used in other contexts must contain the default rounding method (Nearest).

Structural Analytical Model API additions

Member Forces for Analytical Model

The new class:

defines the internal forces and moments applied to the start or end of an AnalyticalModelStick element. Access these forces through the new methods:

AnalyticalModelStick

New Methods:

AnalyticalModelSurface

New Method:

Change in the SurfaceElementProjectionZ enumeration:

The enumerated value SurfaceElementProjectionZ.Center has been replaced by SurfaceElementProjectionZ.CenterOfElement.

MEP Fabrication API

The new MEP Fabrication API allows users to connect various FabricationConfigurations to Revit. With a FabricationConfiguration, they can create and use FabricationParts in their project, and define connectors to those parts.

FabricationConfiguration

The new class FabricationConfiguration contains information about the fabrication configuration settings used by the project. Using this class, users can get and set the fabrication configuration settings for the document. They can also load and unload services, reload the fabrication configuration, get loaded services, get fabrication specifications, get material and insulation information from the configuration, and get connector information.

The new static method:

gets the fabrication configuration element in the document.

Some new methods include:

FabricationService

The new class FabricationService is part of the fabrication configuration and defines what FabricationServiceButtons can be used.

Some new properties include:

Some new methods include:

FabricationPart

The new class FabricationPart represents a fabrication component in the Autodesk Revit MEP product. Using this class, users can create, place, move and align fabrication parts in a Revit model. Users can also get or set the dimensions of the fabrication part, and get the fabrication hosted information and rod information.

Some new methods include:

FabricationServiceButton

The new class FabricationServiceButton defines a button used in a FabricationService. A fabrication service button defines what items to use for different conditions.

Some new methods include:

Other Fabrication Classes

The following fabrication-based classes are also added to Revit:

Other Fabrication API related changes

Connector API

Several new members were added to the Connector class:

In addition, the new static method:

checks if the given connector is a valid piping connector.

View3D additions

Several new methods provide support for switching camera targets and for switching between perspective and isometric for a 3D view:

ScheduleDefinition

New Properties:

StairsType API changes

The properties:

are now correctly allowed to be set when the left or right string style is set to Closed.

ElectricalSetting API additions

The following new properties have been exposed:

PanelScheduleView

New Methods

FamilyInstance additions

The new method:

New properties and methods introduced for reading the information about spatial calculation point(s) directly from family instances:

Category API additions

The new static methods:

act as a shortcut to lookup and return a Category object.

Family API additions

Family.GetFamilyTypeParameterValues method

Returns all applicable values for a FamilyType parameter of a family.

The values are Element Ids of all family types that match the category specified by the definition of the given parameter. The elements are either of class ElementType or NestedFamilyTypeReference. The second variant is for the types that are nested in families and thus are not accessible otherwise.

NestedFamilyTypeReference class

A class representing a proxy element for a nested family type.

In Revit, this element represents a value of a FamilyType parameter of a loaded family. Each such element corresponds to a nested FamilyType element in the original family document where the family was defined. This element stores only basic information about the nested FamilyType, such as the name of the Type, name of the Family, and a Category.

It is possible to obtain a set of applicable elements of this class for a particular FamilyType parameter of a family by calling Family.GetFamilyTypeParameterValues.

Creation of adaptive component instances

The new constructor:

creates an instance of a class wrapping the arguments used to place adaptive components. This may be more efficient than placing individual adaptive components one-by-one.

ComponentRepeater additions

New Methods

Point cloud API additions

The new method:

gets the path of the link source from which the points are loaded.

The new property:

gets the root path for point cloud files. This root path is used by Revit to calculate relative paths to point cloud files.

Application additions

Application.BackgroundColor

The new property:

allows read and write of the background color to use for model views in this session.

Application.OptimizePerformanceDuringRedraw

The new property:

enables or disables the option to allow view manipulation during redraw.

Application.IsLoggedIn

The new static property:

checks if the user is logged in from this session to their Autodesk account.

Application.LoginUserId

The new property:

returns the user id of the user currently logged in. This is an internal id used by Autodesk to represent the logged in user. This user id is in human unrecognizable form. In conjunction with the Autodesk Exchange Store Entitlement REST API, a publisher of an Autodesk Exchange Store application can verify if the current user has purchased their app from the store. For more information about the Exchange Store, please refer to www.autodesk.com/developapps.

Application.IsSubscriptionUpdate

The new property:

checks if the running Revit is a subscription update.

Application.ShowGraphicalWarningHangerDisconnects

The new property

indicates whether or not to show the graphical warnings for Fabrication Hanger disconnects.

Thin lines options

A utility class ThinLinesOptions is added that contains the setting related to the Thin Lines options which affects the display in the UI.

The static property:

defines if the 'Thin Lines' setting is on or off in this session.

3D view API additions

ViewNavigationToolSettings

The new class

carries settings related to the View Cube and other view navigation tools. There is one element carrying these settings in each document. Use:

to obtain it.

The methods:

HomeCamera

The new class HomeCamera contains information about the camera and view for the Home view orientation stored in the model.

New properties:

UI API additions

UIDocument.SaveAs

The new class:

offers options for UIDocument.SaveAs method as below.

The new overload method:

takes a UISaveAsOptions parameter to allow the dialog prompting the user to overwrite existing files to be shown or suppressed.

TableViewUIUtils.TestCellAndPromptToEditTypeParameter

The new static method:

involves the Revit UI and operate on schedule views or MEP electrical panel schedules, and prompts the end-user to control whether a type parameter contained in the specified table cell should be allowed edited,

It replaced the method:

which has been removed completely in Revit 2016.

SetupEnergySimulationDialog

The new class:

represents the Revit dialog which typically precedes invocation of an Energy Simulation run on the Green Building Studio server to get user selection of project and run info.

New methods and properties:

AddInUtility API additions

RevitProduct.IsSubscriptionUpdate

The new property:

allows users to check if a particular Revit is a subscription update.