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.
This method applies to a Shape Driven Rebar whose definition is RebarShapeDefinitionBySegments, for 3D Path Free Form Rebar and for Morphed Free Form Rebar.
For Morphed Free Form Rebar that targets Spiral or Lapped Circle shapes, split cannot be made.
Namespace: Autodesk.Revit.DB.StructureAssembly: RevitAPI (in RevitAPI.dll) Version: 27.0.4.0 (27.0.4.0)
Syntaxpublic static IList<ElementId> SplitRebar(
Document document,
ElementId rebarToSplit,
ISet<int> barIndices,
bool constrainSplitSets,
bool splitAllSetsInSpliceChain
)
Public Shared Function SplitRebar (
document As Document,
rebarToSplit As ElementId,
barIndices As ISet(Of Integer),
constrainSplitSets As Boolean,
splitAllSetsInSpliceChain As Boolean
) As IList(Of ElementId)
public:
static IList<ElementId^>^ SplitRebar(
Document^ document,
ElementId^ rebarToSplit,
ISet<int>^ barIndices,
bool constrainSplitSets,
bool splitAllSetsInSpliceChain
)
static member SplitRebar :
document : Document *
rebarToSplit : ElementId *
barIndices : ISet<int> *
constrainSplitSets : bool *
splitAllSetsInSpliceChain : bool -> IList<ElementId> Parameters
- document Document
-
The document.
- rebarToSplit ElementId
-
The rebar that will be split
- barIndices ISetInt32
-
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.
This parameter has no effect for 3D Path free form rebars.
- 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.
This parameter has no effect for 3D Path free form rebars.
Return Value
IListElementId
Returns the ids of the rebars that are considerred to be split.
Exceptions| Exception | Condition |
|---|
| ArgumentException |
Free Form Rebars other than 3D Path or Morphed, rebar sets with only one bar included or rebars that are part of a group can't be split.
Morphed Free Form Rebars that targets Spiral or Lapped Circle shapes can't be split.
|
| ArgumentNullException |
A non-optional argument was null
|
| ArgumentOutOfRangeException |
One or more bar indices are invalid. All indices must be within the range of [0, NumberOfBarPositions - 2].
For 3D Path Free Form Rebar, the indices must not be consecutive and each new set created by the split must intersect at least one path edge.
For Morphed Free Form Rebar, the indices must not be consecutive.
|
See Also