Creates a new path of travel between two points.

Namespace: Autodesk.Revit.DB.Analysis
Assembly: RevitAPI (in RevitAPI.dll) Version: 21.0.0.0 (21.1.1.109)
Since:  2020

Syntax

C#
public static PathOfTravel Create(
	View DBView,
	XYZ pathStart,
	XYZ pathEnd
)
Visual Basic
Public Shared Function Create ( _
	DBView As View, _
	pathStart As XYZ, _
	pathEnd As XYZ _
) As PathOfTravel
Visual C++
public:
static PathOfTravel^ Create(
	View^ DBView, 
	XYZ^ pathStart, 
	XYZ^ pathEnd
)

Parameters

DBView
Type: Autodesk.Revit.DB..::..View
The floor plan view to use when computing the shortest distance.
pathStart
Type: Autodesk.Revit.DB..::..XYZ
The start point of the path. The input Z coordinates are ignored and set to the view's level elevation.
pathEnd
Type: Autodesk.Revit.DB..::..XYZ
The end point of the path. The input Z coordinates are ignored and set to the view's level elevation.

Return Value

The newly created path of travel element, or nullNothingnullptra null reference (Nothing in Visual Basic) if no path between the two points is found.

Remarks

InvalidOperationException is thrown if PathOfTravel cannot be created for the following conditions:
  • View has crop box active and crop box is split
  • View has crop box active and start or end point lies outside of the crop
  • View model outline area is larger than the current limit (2,000,000 sq.ft.)
  • View export contains too much geometry (more than 200,000 lines)
  • Start and end points are too close

Exceptions

ExceptionCondition
Autodesk.Revit.Exceptions..::..ArgumentException View is not in a family or a document in in-place edit mode. -or- View is not a floor plan view.
Autodesk.Revit.Exceptions..::..ArgumentNullException A non-optional argument was NULL
Autodesk.Revit.Exceptions..::..InvalidOperationException The document containing DBView is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- This operation cannot be performed while the document is in edit mode. -or- The Path of Travel calculation service is not available -or- This functionality is not available in Revit LT.
Autodesk.Revit.Exceptions..::..ModificationForbiddenException The document containing DBView is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document containing DBView is being loaded, or is in the midst of another sensitive process.
Autodesk.Revit.Exceptions..::..ModificationOutsideTransactionException The document containing DBView has no open transaction.

See Also