adding each element from two differrent arrays

Skip to first unread message

Jeff McFall

Mar 28, 2013, 10:26:07 AM3/28/13
Hi all,
Anyone have an elegant tip for how I could take each element of Array A with n elements and add those to each element in Array B with n elements, storing all into a single array?
So that if Array A had 2 elements and Array B had 4 elements the new array size would be 8

As an example Array A contains (1,2) and Array B contains (1,2,3,4) so the result I am looking for is an array with (2,3,4,5,3,4,5,6). I need the overall size of the output array to be based on the size of the two input arrays, it is not fixed.
Hope that is clear enough. I suspect this is probably pretty simple but I can't figure out how to iterate through the multiple elements of the arrays add them and combine them into the new one. I have only been able to add the first element of Array A to all the elements in Array B and combine with the original array.

What I am trying to accomplish is to filter through the same set of points on copied geometry (via ICE Create copies from Mesh) by identifying the ID's I want on the source and then adding the total point count of the original to generate the ID's of the same point locations on the duplicated geometry. Maybe there is a better way to do this as well but it is the path I am following at the moment...

Many thanks


Vincent Ullmann

Mar 28, 2013, 11:36:36 AM3/28/13

try this:
(See Attatch)

There might be a "cooler" Solution using the good old "Generate Sample
Set"-Trick, but i think this one might be quite stable

Jeff McFall

Mar 28, 2013, 12:52:40 PM3/28/13
Thank you so much, I would never have arrived at this on my own

Reply all
Reply to author
0 new messages