Multistory Stairs API
The new class:
allows users to create stairs that span multiple levels. A multistory stairs element may contain multiple stairs whose extents are governed by base and top levels.
This element will contain one or more Stairs elements. Stairs elements are either a reference instance which is copied to each level covered by groups of identical stairs instances which share the same level height, or individual Stairs instances which are not connected to a group with the same level height. By default, when adding new levels to the multistory stair, new stairs will be added to the group.
For groups of duplicate stairs at different levels, the instances can be found as Subelements of the Stairs element.
Stairs in a connected group can be edited together by modifying the associated Stairs instance. For specific floors that need special designs, stairs can be separated from a group by unpinning the element, changes made to this Stairs will not affect other any other instance in the element, or add the stairs back into the group if needed. However, any changes made to the stair will be lost since the stair's properties will be overridden by the group specifications.
The class has the following methods:
- MultistoryStairs.AddStairsByLevelIds() - Adds stairs to the given levels.
- MultistoryStairs.RemoveStairsByLevelIds() - Removes stairs from the given levels. This will regenerate the multistory stairs from the remaining levels.
- MultistoryStairs.CanAddStair() - Checks if the input level id can be used to add stairs into multistory stairs.
- MultistoryStairs.CanRemoveStair() - Checks if the input level id can be used to remove stairs from the multistory stairs.
- MultistoryStairs.GetAllConnectedLevels() - Gets the ids of all levels connected to the multistory stairs.
- MultistoryStairs.GetAllStairsIds() - Gets the ids of all of the stairs in the multistory stairs.
- MultistoryStairs.Create() - Creates a multistory stairs object.
- MultistoryStairs.GetStairsConnectedBaseLevelIds() - Gets the base level ids for the stairs contained in this multi-story stairs element.
- MultistoryStairs.IsPinned() - Checks if a stair is pinned as a propagation group.
- MultistoryStairs.Unpin() - Unpins a story of stairs by giving its base level id.
- MultistoryStairs.Pin() - Pins a unpinned stairs back into a story of a stairs.
The new property:
Stairs.MultistoryStairsId
indicates the id of the MultistoryStairs element to which the Stairs belong to.
Related to StairsPath functionality for multistory stairs, the new functions:
- StairsPath.CanCreateOnMultistoryStairs()
- StairsPath.CreateOnMultistoryStairs()
support creation of new stairs paths in a plan view for stairs instances in a multistory stairs element.
Railings API additions related to MultistoryStairs
The new methods:
- Railing.GetMultistoryStairsPlacementLevels()
- Railing.SetMultistoryStairsPlacementLevels()
- Railing.GetSubelementOnLevel()
provide access to Railing elements which are hosted on members of Multistory stairs.
The method:
- Railing.Create(Document document, ElementId multistoryStairsId, ElementId levelId, ElementId railingTypeId, RailingPlacementPosition placePosition)
Creates new railings on a given level of given multistory stairs - the created railing will be hosted on stairs included in MultistoryStairs element on given level.
The existing method:
- Railing.Create(Document document, ElementId stairsId, ElementId railingTypeId, RailingPlacementPosition placePosition)
now supports MulitstoryStairs elements as input, where the resulting railing will be added on every level of given stairs in multistory stairs.
The existing property:
now supports stairs or stairs components coming from MultistoryStairs elements as well.
Dimension API additions
DimensionEqualityLabelFormating API
The new class:
- DimensionEqualityLabelFormatting
allows users to set dimension equality formulas for continuous linear or angular dimensions.
New methods and properties include:
- DimensionEqualityLabelFormatting.LeadingSpaces
- DimensionEqualityLabelFormatting.LabelType
- DimensionEqualityLabelFormatting.Prefix
- DimensionEqualityLabelFormatting.Suffix
- DimensionEqualityLabelFormatting.GetFormatOptions()
- DimensionEqualityLabelFormatting.SetFormatOptions()
The following new methods in DimensionType allow access to equality formulas:
- DimensionType.GetEqualityFormula()
- DimensionType.SetEqualityFormula()
UnitsFormatOptions in DimensionType
The new functions:
- DimensionType.GetUnitsFormatOptions()
- DimensionType.SetUnitsFormatOptions()
allow users to get or set the FormatOptions for a DimensionType.
OrdinateDimensionSetting
The new class:
allows users to customize ordinate dimensions.
The new enum:
- OrdinateDimensionLineStyle
allows users to choose continuous or segmented line styles for their dimensions.
The new enums:
- OrdinateTextOrientation
- OrdinateTextPosition
allows users to orient text in relation to the dimension lines or witness lines.
The new enum:
allows users to control visibility of their dimensions.
New properties in OrdinateDimensionSetting include:
- OrdinateDimensionSetting.DimLineLength
- OrdinateDimensionSetting.DimLineStyle
- OrdinateDimensionSetting.TextOrientation
- OrdinateDimensionSetting.TextPosition
- OrdinateDimensionSetting.OriginVisibility
- OrdinateDimensionSetting.OriginTickMarkId
The following new methods in DimensionType allow access to the OrdinateDimensionSetting:
- DimensionType.GetOrdinateDimensionSetting()
- DimensionType.SetOrdinateDimensionSetting()
SpatialElementTag API additions
SpatialElementTag is the base element for Room, Area and Space tag classes.
The following new properties have been added:
- SpatialElementTag.HasElbow - Identifies if the tag's leader has an elbow point or not.
- SpatialElementTag.TagText - The text displayed by the tag.
Geometry API additions
Surface and Face API
The new method:
returns a copy of the Face's surface.
In order to correctly leverage this information, the following properties:
- Face.OrientationMatchesSurfaceOrientation
- Surace.OrientationMatchesParametricOrientation
identify whether the face's orientation matches the surface orientation, and whether the surface orientation is the same as or opposite to its parametric orientation.
RevolvedSurface API
The new method:
- RevolvedSurface.GetProfileCurveInWorldCoordinates()
returns a copy of the profile curve expressed in the world coordinate system.
RuledSurface API
The newly added methods:
check if a point was used to define one of the surface profiles.
Level API addition
The new method:
- Level.FindAssociatedPlanViewId()
finds the id of the first available associated floor or structural plan view associated with this level. If there are multiple associated views, Revit will return the first one it finds.
Dockable Frame API Additions
Custom Dockable Panes now support the ability for display of dynamic UI elements, such as web browser controls. This capability should be used in cases where the UI for the pane (layout, buttons etc.) changes dynamically during the lifetime of the Revit session. To use this, implement the new interface:
with a method:
- IFrameworkElementCreator.CreateFrameworkElement()
that constructs and returns the WPF Framework element to embedded in the Revit dockable pane.
The new members:
- DockablePaneProviderData.GetFrameworkElement()
- DockablePaneProviderData.FrameworkElementCreator
provide the ability for the application to deliver a dynamic framework element to the dockable pane.
The property:
- DockablePaneProviderData.FrameworkElement
is now allowed to be null, in situations where the FrameworkElement will be dynamically created.
DirectContext3D for display of externally managed 3D graphics in Revit
DirectContext3D is an API for displaying external graphics in the context of a Revit model. The API provides a more connected experience to users who can benefit from the ability to display graphics based on geometry that is either difficult or costly to fully import into Revit.
An external plugin can use DirectContext3D API to render geometry by encoding it inside pairs of vertex and index buffers. The communication between Revit and the plugin is accomplished with the use of the External Service Framework (ESF). Revit’s rendering pipeline asks registered servers of the DirectContext3D service to provide the geometry for rendering. Revit informs the plugin about certain rendering state, such as the display style and whether the current rendering pass is for transparent objects. The plugin also communicates certain information to Revit, such as the bounding box of the geometry to be rendered.
The following list contains the major added classes and their descriptions:
- DirectContext3D.IDirectContext3DServer - The interface to be implemented by a server of the DirectContext3D external service.
- DirectContext3D.DrawContext - A class that provides drawing functionality for use by DirectContext3D servers.
- DirectContext3D.Vertex - The base class for DirectContext3D vertices.
- DirectContext3D.VertexStream - The base class for DirectContext3D vertex streams, which are used to write vertex data into buffers.
- DirectContext3D.VertexBuffer - A buffer that stores vertex data for rendering.
- DirectContext3D.VertexFormat - A specification of the format of vertex data contained in a piece of geometry.
- DirectContext3D.VertexFormatBits - Vertex format (i.e., the type of data associated with a vertex) represented as a number.
- DirectContext3D.IndexPrimitive - The base class for index buffer primitives.
- DirectContext3D.IndexStream - The base class for DirectContext3D index streams, which are used to write vertex indices into buffers.
- DirectContext3D.IndexBuffer - A buffer that stores vertex indices for rendering.
- DirectContext3D.EffectInstance - An effect instance that controls the appearance of geometry.
- DirectContext3D.PrimitiveType - Type of geometry primitive represented as a number.
- DirectContext3D.ClipPlane - A set of parameters representing a clip plane in DirectContext3D.
- DirectContext3D.ProjectionMethod - The projection method used by a DirectContext3D camera.
- DirectContext3D.Camera - A collection of camera settings for DirectContext3D.
View update for DirectContext3D
The new method:
- UIDocument.UpdateAllOpenViews()
updates all open views in this document after elements have been changed, deleted, selected or de-selected. Graphics in the views are fully redrawn regardless of which elements have changed. This function should only rarely be needed, but might be required when working with graphics drawn from outside of Revit's transactions and elements, for example, when using DirectContext3D.
This function is potentially expensive as many views may be updated at once, including regeneration of view's geometry and redisplay of graphics. Thus for most situations it is recommended that API applications rely on the Revit application framework to update views more deliberately.
Coordination Model elements
Coordination Model elements current can link the graphical contents of Navisworks files and display them in context in the Revit session. These elements leverage the DirectContext3D framework to handle the display of the external graphics, and are the first example of an element which is designated to contain a link to externally managed DirectContext3D graphics (a "DirectContext3D handle" element).
There is no current way to create new Coordination Model or DirectContext3D handle elements via the API. However, you can use the capabilities of the related classes to identify and manipulate these elements. These elements can be accessed from the following new API classes:
- DirectContext3DHandleUtils - provides utilities related to the identification of types and instances which are storing externalized graphics via DirectContext3D
- DirectContext3DHandleSettings - provides access to override settings applied to DirectContext3D handles through the Visibility/Graphics dialog.
- DirectContext3DHandleOverrides - provides access to DirectContext3DHandleSettings that are stored by a given view.
Shared Coordinates API additions
Acquire and Publish coordinates API additions
Two new methods allow users to acquire and publish shared coordinates:
- Document.AcquireCoordinates() - Acquires project coordinates from the specified link instance. This method accepts both Revit links (RevitLinkInstance) and DWG links (ImportInstance).
- Document.PublishCoordinates() - Publishes shared coordinates to the specified ProjectLocation. This method works only on Revit links.
SiteLocation API additions
Two new read-only properties have been added to provide information on the geographic coordinate system of a SiteLocation. The geographic coordinate system is imported from a DWG file from AutoCAD or Civil 3D. If the SiteLocation has geographic coordinate system information, the latitude and longitude of the SiteLocation will be updated automatically
when the model's Survey Point is moved.
- SiteLocation.GeoCoordinateSystemId - Gets a string corresponding to geographic coordinate system ID, such as "AMG-50" or "Beijing1954/a.GK3d-40" for the SiteLocation. The value will be the empty string if there is no coordinate system specified for the SiteLocation. This property is read-only.
- SiteLocation.GeoCoordinateSystemDefinition - Gets an XML string describing the geographic coordinate system. The value will be the empty string if there is no coordinate system specified for the SiteLocation. This property is read-only.
The new method:
- SiteLocation.IsCompatibleWith() - Checks whether the geographic coordinate system of this site is compatible with the given site.
ProjectLocation API additions
The new method:
creates a new ProjectLocation in the document from the given SiteLocation and with the given name.
Revit Link API additions
The new method:
- static RevitLinkInstance.Create(ImportPlacement placement)
creates a new instance of a linked Revit project (RevitLinkType). Instances will be placed origin-to-origin or by shared coordinates according to the input placement type.
Link API additions
External Resource framework additions
IExternalResourceServer can now provide CAD format links, DWF markups, and IFC links. The following new values have been added to ExternalResourceType.BuiltInExternalResourceTypes:
- CADLink
- DWFMarkup
- IFCLink
CADLinkType additions
Several new methods have been added to CADLinkType as part of external resource framework enhancements:
- CADLinkType.Reload() - Reloads a CADLinkType from its current location.
- CADLinkType.Reload(CADLinkOptions options) - Reloads a CADLinkType from its current location, including options to control graphic overrides.
- CADLinkType.LoadFrom(String fileName) - Reloads a CADLinkType from a file on disk.
- CADLinkType.LoadFrom(ExternalResourceReference reference) - Reloads a CADLinkType from an external resource server.
ImportInstance additions
Several new methods have been added to create ImportInstance elements, either from an existing link type or a new link type:
- ImportInstance.Create(DWGImportOptions options, String fileName) - Creates a new DWG or DXF type and instance from a file on disk.
- ImportInstance.Create(DWGImportOptions options, ExternalResourceReference reference) - Creates a new DWG or DXF type and instance from an external resource location.
- ImportInstance.Create(ElementId typeId) - Creates a new DWG or DXF instance from an existing CADLinkType.
Methods have also been added to create DGN, SAT, and SKP links from external resource locations.
IFC Link API additions
The method:
- RevitLinkType.UpdateFromIFC()
now has a new version that allows for an ExternalResourceReference to specify the IFC file name, instead of a string.
Workshared operation progress changed events
Subscribe to the Autodesk.Revit.ApplicationServices.Application.WorksharedOperationProgressChanged event to be notified when progress has changed during Collaboration for Revit's synchronizing.
This event consists of several phases. Different event arguments are used during each phase.
WorksharedOperationProgressChangedEventArgs
The new class:
- Autodesk.Revit.DB.Events.WorksharedOperationProgressChangedEventArgs
provides a base class for event arguments for worksharing-based progress events.
DocumentSaveToLocalProgressChangedEventArgs
The new class:
It has the following properties:
- DocumentSaveToLocalProgressChangedEventArgs.Location - Full path of the central model which is to be synchronized.
- DocumentSaveToLocalProgressChangedEventArgs.Status - Gets the API event status, which reflects the current operation execution status.
- DocumentSaveToLocalProgressChangedEventArgs.BeforeSaveToCentral - True if the "save to local" operation is occurring before "save to central"; false if after.
- DocumentSaveToLocalProgressChangedEventArgs.FinishedStreams - The number of streams finished since the last time this event was raised.
- DocumentSaveToLocalProgressChangedEventArgs.TotalStreams - The total expected number of streams to save to local.
- DocumentSaveToLocalProgressChangedEventArgs.SaveToLocalFinished - Indicates if the current "save to local" operation has finished.
DataTransferProgressChangedEventArgs
The new class:
Autodesk.Revit.DB.Events.DataTransferProgressChangedEventArgs provides information during the data transferring phase of the WorksharedOperationProgressChanged event. Generally, it is not used directly because It is the base class of Autodesk.Revit.DB.Events.DocumentReloadLatestProgressChangedEventArgs, Autodesk.Revit.DB.Events.DocumentSaveToCentralProgressChangedEventArgs and Autodesk.Revit.DB.Events.CreateRelatedFileProgressChangedEventArgs
It has the following properties:
- DataTransferProgressChangedEventArgs .Location - Full path of the central model which is to be synchronized.
- DataTransferProgressChangedEventArgs .Status - Gets the API event status, which reflects the current operation execution status.
- DataTransferProgressChangedEventArgs .TransferMode - Gets the transfer mode of this data transfer progress. It is Undefined or Download or Upload;
- DataTransferProgressChangedEventArgs .Speed - Gets data transfer speed(bytes/second).
- DataTransferProgressChangedEventArgs .FinishedSize - Gets downloaded or uploaded data size, in bytes, since the last time this event was raised.
- DataTransferProgressChangedEventArgs .TotalSize - Total expected data size to download, in bytes.
DocumentReloadLatestProgressChangedEventArgs
The new class:
- Autodesk.Revit.DB.Events.DocumentReloadLatestProgressChangedEventArgs provides information during the reload latest phase of the DocumentSynchronizingWithCentralProgressChanged event.
It has the following properties:
- DocumentReloadLatestProgressChangedEventArgs.Location - The full path of the central model which is to be synchronized.
- DocumentReloadLatestProgressChangedEventArgs.Status - Gets API event status, reflecting the current operation execution status.
- DocumentReloadLatestProgressChangedEventArgs.TransferMode - Returns DataTransferMode.Download.
- DocumentReloadLatestProgressChangedEventArgs.RetryTimes - The number of times Revit has tried to Reload Latest. Its value is '0' at the first time.
- DocumentReloadLatestProgressChangedEventArgs.Speed - Download speed(bytes/second) in this event.
- DocumentReloadLatestProgressChangedEventArgs.FinishedSize - The downloaded data size, in bytes, since the last time this event was raised.
- DocumentReloadLatestProgressChangedEventArgs.TotalSize - Total expected data size to download, in bytes.
- DocumentReloadLatestProgressChangedEventArgs.IsMerging - Indicates if Revit is merging downloaded data.
- DocumentReloadLatestProgressChangedEventArgs.ReloadLatestFinished - Indicates if current 'reload latest' progress is finished or not.
DocumentSaveToCentralProgressChangedEventArgs
The new class:
- Autodesk.Revit.DB.Events.DocumentSaveToCentralProgressChangedEventArgs
provides information during the save to central phase of the DocumentSynchronizingWithCentralProgressChanged event.
It has the following properties:
- DocumentSaveToCentralProgressChangedEventArgs.Location - Full path of the central model which is to be synchronized.
- DocumentSaveToCentralProgressChangedEventArgs.Status - Gets API event status, reflecting the current operation execution status.
- DocumentSaveToCentralProgressChangedEventArgs.TransferMode - Returns DataTransferMode.Upload.
- DocumentSaveToCentralProgressChangedEventArgs.RetryTimes - The number of times Revit has tried to Save to Central." Its value is '0' at the first time.
- DocumentSaveToCentralProgressChangedEventArgs.Speed - Upload speed(bytes/second) of saving to central.
- DocumentSaveToCentralProgressChangedEventArgs.FinishedSize - The uploaded data size, in bytes, since the last time this event was raised.
- DocumentSaveToCentralProgressChangedEventArgs.TotalSize - Total expected uploaded data size to save to central, in bytes.
- DocumentSaveToCentralProgressChangedEventArgs.SaveToCentralFinished - Indicates if current 'save to central' is finished or not.
- DocumentSaveToCentralProgressChangedEventArgs.FailureDueToConflicts - Indicates the 'save to central' failure is caused by submission, that is because another user finished saving to central first.
CreateRelatedFileProgressChangedEventArgs
The new class:
- Autodesk.Revit.DB.Events.CreateRelatedFileProgressChangedEventArgs
provides information about the creation of related files when Collaboration for Revit models are being opened.
It has the following properties:
- CreateRelatedFileProgressChangedEventArgs.Location - Full path of the model which is to be created related file.
- CreateRelatedFileProgressChangedEventArgs.Status - Gets API event status, reflecting the current operation execution status.
- CreateRelatedFileProgressChangedEventArgs.TransferMode - Returns DataTransferMode.Download.
- CreateRelatedFileProgressChangedEventArgs.CreatingCloudSharedLocal - Indicates if it is creating cloud shared local model.
- CreateRelatedFileProgressChangedEventArgs.DownloadFinished - Indicates if all data downloads are finished or not.
- CreateRelatedFileProgressChangedEventArgs.Speed - Download speed(bytes/second) in this event.
- CreateRelatedFileProgressChangedEventArgs.FinishedSize - The downloaded data size, in bytes, since the last time this event was raised.
- CreateRelatedFileProgressChangedEventArgs.TotalSize - Total expected data size to download, in bytes.
- CreateRelatedFileProgressChangedEventArgs.FullDownload - Indicates if download the full data of the document, which will take longer than subsequent downloads.
Events related to linked resources
Subscribe to the events:
- Autodesk.Revit.ApplicationServices.Application.LinkedResourceOpening
- Autodesk.Revit.ApplicationServices.ControlledApplication.LinkedResourceOpening
- Autodesk.Revit.ApplicationServices.Application.LinkedResourceOpened
- Autodesk.Revit.ApplicationServices.ControlledApplication.LinkedResourceOpened
to be notified when Revit is just about to open, or has just opened, a linked resource. This event supports linked resources of the following types : Revit; IFC; CAD (DWG, DXF, DGN, SAT).
This event will not be raised if there are no updates for linked CAD or IFC resources. The linked resource cannot be modified during these events.
LinkedResourceOpeningEventArgs
The new class:
- Autodesk.Revit.DB.Events.LinkedResourceOpeningEventArgs
provides information when Revit is just about to open a linked resource.
It has the following properties:
- LinkedResourceOpeningEventArgs.ResourceType - Linked resource type.
- LinkedResourceOpeningEventArgs.LinkedResourcePathName - The linked resource name to open.
LinkedResourceOpenedEventArgs
The new class:
- Autodesk.Revit.DB.Events.LinkedResourceOpenedEventArgs
provides information when Revit finishes opening a linked resource.
It has the following properties:
- LinkedResourceOpenedEventArgs.ResourceType - Linked resource type.
- LinkedResourceOpenedEventArgs.LinkedResourcePathName - Opened linked resource name.
Events related to parallel View Export
When exporting multiple views to DWF or DWFx format, Revit uses background processes to compute the exported output of several views in parallel. Two events are now available on the Application class to receive progress updates during a parallel export operation:
- Application.ViewExporting - This event is raised when Revit is just about to export a view of the document.
- Application.ViewExported - This event is raised immediately after Revit has finished exporting a view of the document.
These two events are raised only during accelerated export jobs, in which views are exported in parallel using a background process. Accelerated export only occurs when exporting to DWF formats and not combining views into a single file.