Curve.CreateOffset Method

Creates a new curve that is an offset of the existing curve.


Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)

Syntax

C#

public Curve CreateOffset(
	double offsetDist,
	XYZ referenceVector
)

Parameters

offsetDist  Double
The signed distance that controls the offset.
referenceVector  XYZ
A reference vector to define the offset direction.

Return Value

Curve
The new curve.

Exceptions

ExceptionCondition
InvalidOperationException Cannot create the offset of the curve.

Remarks

The offset curve is obtained by moving the points of the given curve by a certain distance (not necessarily the input distance) to the right relative to the reference vector. If the distance is negative, then the offset will be actually on the left side. The precise role played by the reference vector depends on the curve type in an inconsistent way, as specified in detail below. We plan to update this function to have a more consistent and understandable behavior.

For Line, HermiteSpline, NurbSpline and Cylindrical Helix, the right direction is along the cross product of the tangent at that point and the reference vector. In other words, the "right" side of the curve at a given point on the curve is defined with the reference vector being thought of as the upward direction and curve tangent being thought of as the forward direction, as if you are walking along the curve with your body aligned to the reference vector.

For Arc and Ellipse, the right direction is defined relative to the axis of the arc or ellipse in conjunction with the reference vector. If the dot product of the reference vector with the axis is positive, then the right direction is along the cross product of the curve tangent the axis. If the dot product is negetive, then it is in the other way. If the dot product is zero, then it is an input error.

More details of the behavior depending on the type of curve:

See Also

Reference

Curve Class
Autodesk.Revit.DB Namespace