CreateUnbound Method


Creates a new instance of an unbound linear curve.

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

Syntax

C#
public static Line CreateUnbound(
	XYZ origin,
	XYZ direction
)
Visual Basic
Public Shared Function CreateUnbound ( _
	origin As XYZ, _
	direction As XYZ _
) As Line
Visual C++
public:
static Line^ CreateUnbound(
	XYZ^ origin, 
	XYZ^ direction
)

Parameters

origin
Type: Autodesk.Revit.DBXYZ
The origin of the unbound line.
direction
Type: Autodesk.Revit.DBXYZ
The direction of the unbound line.

Return Value

The new unbound line.

Examples

CopyC#
// define start point and direction for unbound line
XYZ startPoint = new XYZ(0, 0, 0);
XYZ directionPt = new XYZ(10, 10, 10);

// create line
Line line = Line.CreateUnbound(startPoint, directionPt);
CopyVB.NET
' define start point and direction for unbound line
Dim startPoint As New XYZ(0, 0, 0)
Dim directionPt As New XYZ(10, 10, 10)

' create line
Dim line__1 As Line = Line.CreateUnbound(startPoint, directionPt)

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentNullException A non-optional argument was NULL
Autodesk.Revit.ExceptionsArgumentOutOfRangeException direction has zero length.
Autodesk.Revit.ExceptionsArgumentsInconsistentException Vector and origin cannot form a proper unbound line.

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 →