ComponentRepeater.RepeatElements
Method
Description:
Repeats a set of adaptive component hosted on one or more repeating references.
Repeats a set of adaptive component hosted on one or more repeating references.
Remarks:
All elements must be adaptive family instances and have no shape handles. At least one placement point must be hosted on a 1D or 2D repeating reference. All other placement points can be hosted on a 0D, 1D or 2D repeating reference, or must be unhosted. Use CanElementBeRepeated(Document, ElementId) to test whether an element meets these conditions.
All elements must be adaptive family instances and have no shape handles. At least one placement point must be hosted on a 1D or 2D repeating reference. All other placement points can be hosted on a 0D, 1D or 2D repeating reference, or must be unhosted. Use CanElementBeRepeated(Document, ElementId) to test whether an element meets these conditions.
Syntax
public static IList<ComponentRepeater> RepeatElements(
Document document,
ICollection<ElementId> elementIds
)
Parameters
Parameter | Type | Description |
---|---|---|
document | Document | The document that contains the elements. |
elementIds | ICollection | The set of adaptive components used as an input pattern for the repeating operation. |
Return Value
Type | Description |
---|---|
IList | One or more component repeater objects representing the result pattern of the repeating operation. |
Exceptions
Exception | Condition |
---|---|
ArgumentException | The document does not allow creation of a component repeater. -or- The given element id set is empty. -or- One or more elements in elementIds do not exist in the document. -or- Not all given elements can be repeated. All elements must be adaptive family instances, have no shape handles, and have at least one placement point hosted on a 1D or 2D repeating reference. The remaining placement points must be either unhosted or hosted on another repeating reference. |
ArgumentNullException | A non-optional argument was null |
ModificationForbiddenException | The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process. |
ModificationOutsideTransactionException | The document has no open transaction. |