Splits a rebar into multiple sets at specified bar indices.
Given split indices (e.g., {ii, jj}) in barIndices, the function creates three rebar sets: from 0 to ii, ii+1 to jj, and jj+1 to NumberOfBarPositions - 1.
Edge Case: A split at index 0 creates a first set with one bar; a split at the last index does nothing, as no bars follow.
If a split is made at an index where the bar is not included, the split will still occur, and the unincluded bar will remain unchanged in the new set created after the split.
Namespace: Autodesk.Revit.DB.Structure
Assembly: RevitAPI (in RevitAPI.dll) Version: 26.4.0.0 (26.4.0.0)
Syntax
C#
public static IList<ElementId> SplitRebar( Document document, ElementId rebarToSplit, ISet<int> barIndices, bool constrainSplitSets, bool splitAllSetsInSpliceChain )
Parameters
- document Document
- The document.
- rebarToSplit ElementId
- The rebar that will be split
- barIndices ISet<Int32>
- The array storing the indices of the initial bars from the rebar where the splits will occur.
- constrainSplitSets Boolean
- If this is true, Rebar Plane of the split set with index ii in the output array will be constrained to Out of Plane of the set split set with index ii-1 in the output array (or Rebar Plane if the layout is Single). If it is false, it will be no constraint between the resulted sets.
- splitAllSetsInSpliceChain Boolean
- If this is true, all sets in the splice chain will be split and the splice relationships will be maintained. If it is false, only the selected set will be split and no splice relationship will be preserved.
Return Value
IList<ElementId>Returns the ids of the rebars that are considerred to be split.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentException | Free Form Rebars, rebar sets with only one bar included or rebars that are part of a group can't be split. |
| ArgumentNullException | A non-optional argument was null |
| ArgumentOutOfRangeException | Not all values in barIndices are within the valid rebar range (0 to NumberOfBarPositions - 1). |
