FindShortestPaths Method


For a floor plan view, calculates paths from each start point to its closest destinations. Returns the path, represented by an array of XYZ points.

Namespace: Autodesk.Revit.DB.Analysis
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2021

Syntax

C#
public static IList<IList<XYZ>> FindShortestPaths(
	View DBView,
	IList<XYZ> destinationPoints,
	IList<XYZ> startPoints
)
Visual Basic
Public Shared Function FindShortestPaths ( _
	DBView As View, _
	destinationPoints As IList(Of XYZ), _
	startPoints As IList(Of XYZ) _
) As IList(Of IList(Of XYZ))
Visual C++
public:
static IList<IList<XYZ^>^>^ FindShortestPaths(
	View^ DBView, 
	IList<XYZ^>^ destinationPoints, 
	IList<XYZ^>^ startPoints
)

Parameters

DBView
Type: Autodesk.Revit.DBView
The floor plan view to use when computing the points.
destinationPoints
Type: System.Collections.GenericIListXYZ
Destination points. The input Z coordinates are ignored and set to the view's level elevation.
startPoints
Type: System.Collections.GenericIListXYZ
Start points for which shortest paths are calculated.

Return Value

Array of paths calculated from each start point to its corresponding closest destination. If a path cannot be caculated the corresponsing sub-array is set to an empty array.

Remarks

The calculation is done in a floor plan with one or more destinationPoints and one or more startPoints. The shortest path is calculated from each start point to its closest destination point.

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException View is not a floor plan view.
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was null
Autodesk.Revit.ExceptionsInvalidOperationException The Path of Travel calculation service is not available -or- This functionality is not available in Revit LT.

See Also