Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • S (start)

  • E (end)

  • I (increment)

  • CTRL (control parameter)

Example

Code Block
languagexml
<O N="Replicate" T="Project" Category="Core Objects">
    <!-- created by ParamML Examples on 26.01.2023 -->
    <O N="Recap" T="Repeat" S="0" E="3" I="1" CTRL="j" j="0">
        <P N="Result" V="3^j" />
    </O>
    <O T="Design Code">
        <P N="RecapObjectList" V="Recap" />
        <P N="RecapResult0" V="Recap[0].Result" />
        <P N="RecapResult1" V="Recap[1].Result" />
        <P N="RecapResult2" V="Recap[2].Result" />
        <P N="RecapResult3" V="Recap[3].Result" />
        <!-- -l- -->
        <P N="Result0" V="3^0" />
        <P N="Result1" V="3^1" />
        <P N="Result2" V="3^2" />
        <P N="Result3" V="3^3" />
    </O>
</O>

The above codes give exactly the same results as below.

...

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:

Code Block
languagexml
<O N="Repeat-_in-_repeat _Object" T="Project">
    <!-- created by ParamML Examples on 26.01.2023 -->
    <O N="Recap1" T="Repeat" S="0" E="3" I="1" CTRL="i" i="0">
        <O N="Recap" T="Repeat" S="0" E="4" I="1" CTRL="j" j="0">
            <O N="Circle" T="Volume" Y="20*i" X="20*j">
                <O T="Circle" Radius="10" Z="0" />
                <O T="Circle" Radius="10" Z="10" />
            </O>
        </O>
    </O>
</O>

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.

...