Sets the offset of the analytical model at end.
Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 22.0.0.0 (22.1.0.0)
Since: 2011
Syntax
C# |
---|
|
Visual Basic |
---|
|
Visual C++ |
---|
|
Parameters
- selector
- Type: Autodesk.Revit.DB.Structure AnalyticalElementSelector
End of analytical model to offset.
- offset
- Type: Autodesk.Revit.DB XYZ
New offset for end of analytical model.
Examples

// extend the analytical model by 1 foot at each end. Direction of offset is parallel to the analytical model curve.
AnalyticalModel model = familyInstance.GetAnalyticalModel();
Curve curve = model.GetCurve();
XYZ tangentDirection0 = curve.ComputeDerivatives(0, true).BasisX.Normalize().Negate();
XYZ tangentDirection1 = curve.ComputeDerivatives(1, true).BasisX.Normalize();
model.SetOffset(AnalyticalElementSelector.StartOrBase, tangentDirection0);
model.SetOffset(AnalyticalElementSelector.EndOrTop, tangentDirection1);

' extend the analytical model by 1 foot at each end. Direction of offset is parallel to the analytical model curve.
Dim model As AnalyticalModel = familyInstance.GetAnalyticalModel()
Dim curve As Curve = model.GetCurve()
Dim tangentDirection0 As XYZ = curve.ComputeDerivatives(0, True).BasisX.Normalize().Negate()
Dim tangentDirection1 As XYZ = curve.ComputeDerivatives(1, True).BasisX.Normalize()
model.SetOffset(AnalyticalElementSelector.StartOrBase, tangentDirection0)
model.SetOffset(AnalyticalElementSelector.EndOrTop, tangentDirection1)
Exceptions
Exception | Condition |
---|---|
Autodesk.Revit.Exceptions ArgumentNullException | A non-optional argument was null |
Autodesk.Revit.Exceptions ArgumentOutOfRangeException | A value passed for an enumeration argument is not a member of that enumeration |
Autodesk.Revit.Exceptions InvalidOperationException | Function only work for curve-based elements. |