Note: This API is now obsolete.
[ObsoleteAttribute("This method is deprecated in Revit 2026 and may be removed in a later version of Revit. Please use RebarContainer.AppendItemFromCurves(RebarStyle style, RebarBarType barType, RebarHookType startHook, RebarHookType endHook, XYZ normal, IList<Curve> curves, RebarTerminationOrientation startHookOrient, RebarTerminationOrientation endHookOrient, bool useExistingShapeIfPossible, bool createNewShape) instead.")]
public RebarContainerItem AppendItemFromCurves(
RebarStyle style,
RebarBarType barType,
RebarHookType startHook,
RebarHookType endHook,
XYZ normal,
IList<Curve> curves,
RebarHookOrientation startHookOrient,
RebarHookOrientation endHookOrient,
bool useExistingShapeIfPossible,
bool createNewShape
)| Exception | Condition |
|---|---|
| ArgumentException | The input curves is empty. -or- The input curves contains at least one curve which is not a bound Line or bound Arc and is not supported for this operation. -or- curves do not form a valid CurveLoop. -or- The input curves contains at least one helical curve and is not supported for this operation. |
| ArgumentNullException | A non-optional argument was null |
| ArgumentOutOfRangeException | normal has zero length. -or- A value passed for an enumeration argument is not a member of that enumeration |
| ArgumentsInconsistentException | Both useExistingShapeIfPossible and createNewShape are false. -or- curves contains non-fillet arcs with radii that are less than the minimum bend radius for the RebarBarType and bar style. |
Private Sub AddItemsToRebarContainer(container As RebarContainer, beam As FamilyInstance, barType As RebarBarType, hookType As RebarHookType) ' Define the rebar geometry information - Line rebar Dim location As LocationCurve = TryCast(beam.Location, LocationCurve) Dim origin As XYZ = location.Curve.GetEndPoint(0) ' create rebar along the length of the beam Dim rebarLineEnd As XYZ = location.Curve.GetEndPoint(1) Dim line__1 As Line = Line.CreateBound(origin, rebarLineEnd) Dim normal As New XYZ(1, 0, 0) Dim rebarLine As Curve = line__1.CreateOffset(0.5, normal) ' Create the line rebar Dim curves As IList(Of Curve) = New List(Of Curve)() curves.Add(rebarLine) Dim item As RebarContainerItem = container.AppendItemFromCurves(RebarStyle.Standard, barType, hookType, hookType, normal, curves, _ RebarTerminationOrientation.Right, RebarTerminationOrientation.Left, True, True) If item IsNot Nothing Then ' set specific layout for new rebar as fixed number, with 10 bars, distribution path length of 1.5' ' with bars of the bar set on the same side of the rebar plane as indicated by normal ' and both first and last bar in the set are shown item.SetLayoutAsFixedNumber(10, 1.5, True, True, True) End If ' Hide the new item in the active view container.SetItemHiddenStatus(container.Document.ActiveView, item.ItemIndex, True) End Sub