- edited description
Manipulation of Arrays
Is there a way to get a sum of a variable amount of values from an array? Or to build upon the value already assigned to a variable?
For example, I am using a Repeat command to place multiple objects at an X distance from a starting point. To calculate the X position of the next set of objects, I need to know how far the existing objects have already been placed. I could do this with something like "X1 = X1+new_spacing" or I have tried to build an array which does something similar. Please see my "Stud Placement" library object, the parameter "xd" is what I'm trying to automate.
Comments (5)
-
reporter -
reporter -
assigned issue to
-
assigned issue to
-
Sure -- what you want is possible. But you need to think recursively. Let's say there are 10 number in an array: X[0], X[1], X[2] ... X[9]. Now you want a new parameter named Pos to be:
- Pos[i] = X[i] , if i == 0
- Pos[i] = X[i] + Pos[i-1], if i > 0
Take a look at Example 1 on the below link for a full example:
https://sites.google.com/a/redeqn.com/paramml-author-s-guide/home/introduction/objects/repeat
Let me know if you have further questions on this.
-
reporter Thank you, I understand how to make this work now!
-
reporter - changed status to resolved
No longer an issue.
- Log in to comment