AnalyticalModel.SetOffset
Description:
Sets the offset of the analytical model at end.
Sets the offset of the analytical model at end.
public void SetOffset(
AnalyticalElementSelector selector,
XYZ offset
)
-
selectorEnd of analytical model to offset.
-
offsetNew offset for end of analytical model.
// 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);
-
A non-optional argument was null
-
A value passed for an enumeration argument is not a member of that enumeration
-
Function only work for curve-based elements.