...
| ||
The above codes give exactly the same results as below. | ||
To view this example in the library, see (https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&obj=objidywfidyhjvzme5h9q6soyns)
Example:
| |||||
In the example provided, a 3D column object of type line is created and placed within a Repeat loop. The loop, with a starting number of 1, an ending number of 4, and incrementing by one each time, iterates 4 times, resulting in the creation of 4 identical column objects. This process results in the following system as output. | |||||
To view this example in the library, see (https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&folder=Core+Objects&obj=objid77165d5s6l3r54bcc8luz )
The Repeat Object also allows for counting elements in a list and separating them as needed. This can be useful in situations where specific elements within the list need to be grouped or separated based on certain criteria.
Example:
| ||
In the above example, there are two nested repeat objects. In these objects, when it gets i=0 first, the object inside will repeat from j=0 to j=4 5 times and clone the 3D object within 5 of them. Later, when the inside repetitions are completed, i = 1 will be and the inside object will be 5 again and will be created once. Thus, as each i value increases, the j value will increase 5 times. This will continue until the outermost repeat count is completed and the following 3D object will be created. | ||
To view this example in the library, see (https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&folder=Core+Objects&obj=objidr5mrcuyfnw8mxik04obc)
Parameters of Repeat Object
Label | Mandatory | Name and Type Attributes | Default Description and Value Attributes | Other Attributes |
Control Variable | Yes | N="CTRL" | D="Control Variable: The name of the variable that holds the repeat number as the contained objects repeated."V="0" | Role="Input" |
Start | Yes | N="S" | D="Start: Starting repeat number (default 0)" | Role="Input" |
End | Yes | N="E" | D="End: Ending repeat number (default 9)"V="0" | Role="Input" |
Increment (Each Step) | Yes | N="I" | D="Increment: Increment used to go from start to end (default 1)"V="0" | Role="Input" |