GetDistance Method


Calculates the relative distance along the alignment between two stations based on their alignment distances according to Revit Internal Origin Coordinate Base. The distance may be positive or negative depending on the relative positions of the input stations on the alignment.

Namespace: Autodesk.Revit.DB.Infrastructure
Assembly: Autodesk.CivilAlignments.DBApplication (in Autodesk.CivilAlignments.DBApplication.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2021.1

Syntax

C#
public double GetDistance(
	double fromStation,
	double toStation
)
Visual Basic
Public Function GetDistance ( _
	fromStation As Double, _
	toStation As Double _
) As Double
Visual C++
public:
double GetDistance(
	double fromStation, 
	double toStation
)

Parameters

fromStation
Type: System Double
The displayed alignment station from which 2D length is to be calculated, in Revit internal model units (standard Imperial feet).
toStation
Type: System Double
The displayed alignment station to which 2D length is to be calculated, in Revit internal model units (standard Imperial feet).

Return Value

Distance (positive or negative) along the alignment between two stations. The sign of the distance depends on the relative positions of the input stations on the alignment.

See Also

ArchiLabs Desktop

Put AI to work inside Revit.

Give Desktop your instructions and project files to build Revit families, update model elements, and create views and schedules. Works directly in Revit and AutoCAD.

Explore Desktop →