# Pass forward the exact number of faces after split in z/x

Question asked by KennethLinformi-dk-esridist on Jun 4, 2015
Latest reply on Jun 4, 2015 by CWilkins-esristaff

I need some help, I thought this would be straight forward ;-)

I need to know how to pass the number of the faces after a split in the z and x direction. What my end goal should be is to create a recursion that will change the split distance until the number of faces equals a value. I want a grid of 9 faces (to make the test simple) and then I will need it to calculate the split size from that information.

So in case geometry.nFaces or split.total == 9 : do something else : go back and modify the split value + 1 or so.

If I try to print what is going on I can see that if I use nFaces I will get printed 1 nine times. If I use split.total I will get 3 nine times. How can I call the actual face number sum 9? If I report on this I wil get N = 9, Sum 27, Avg = 3.

I must forget something here!

Start-->

split(x) { scope.sx / 3 : split(z) {scope.sz / 3 : splitZ(split.total) }*}*

#split(z) { scope.sz / 8 : splitZ(split.total) }*

splitZ(N)-->

#case Z == 1 : color(1,0,0) else : color(1,0,1)

#case split.total == 2 : print(true) else : print(false)

print(N)

report("Grid", N)

#case Z == 7 : color (1,0,0) else :  color (1,1,0)