ComponentRepeater Class


An element that contains and manages a set of repeated components.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 2015.0.0.0 (2015.0.0.0)
Since: 2014

Syntax

C#
public class ComponentRepeater : Element, 
	IEnumerable<ComponentRepeaterSlot>
Visual Basic
Public Class ComponentRepeater _
	Inherits Element _
	Implements IEnumerable(Of ComponentRepeaterSlot)
Visual C++
public ref class ComponentRepeater : public Element, 
	IEnumerable<ComponentRepeaterSlot^>

Remarks

Component repeaters can be used to replicate (repeat) elements hosted on repeating references. The result of the repeating operation is a collection of slots. Each slot contains one repeated component. The ComponentRepeater class provides the repeating functionality and access to the slots.

Each repeating reference is capable of hosting one point of an adaptive component. An initial pattern can be created by populating one or more repeating references with such points. Component repeaters can then be used to replicate the pattern to fill the rest of the repeating references in the particular repeating reference source.

The repeating references in repeating reference source are arranged in one or two dimensional arrays, allowing for different kinds of repeating:

  • One dimensional source allows for repeating along a path.
  • Two dimensional source allows for repeating across a grid.
  • It is also possible to host a point on a zero dimensional reference (a point). This point will be shared by all slots. A zero dimensional source allows for repeating around a single point. It should not be used alone, but together with at least one other repeating reference source (typically one dimensional.) The point hosted on the zero dimensional source serves as a central point around which other points can be repeated on their respective repeating reference sources.

Multiple adaptive components may be hosted on one repeating reference source, and different points of one adaptive component may be hosted on different repeating reference sources, effectively allowing different points of an adaptive component to be repeated using different patterns.

Following is a typical component repeater creation workflow:

  1. Get the default repeating reference source from a point element, divided path or divided surface. (See HasRepeatingReferenceSource(Document, ElementId) and GetDefaultRepeatingReferenceSource(Document, ElementId) .)
  2. Query the bounds of the repeating reference source to find a range of valid coordinates. (See DimensionCount and GetBounds .)
  3. Create one or more instances of adaptive families that will be repeated.
  4. Host the individual points of an adaptive component on one or more repeating references. (See GetReference(RepeaterCoordinates) .)
  5. Repeat the set of adaptive components using the RepeatElements() method.

Component repeaters can only be used in Massing families (the conceptual design environment).

Inheritance Hierarchy

System Object
Autodesk.Revit.DB Element
Autodesk.Revit.DB ComponentRepeater

See Also