Free Support Forum - aspose.com

Gurantee of order for shapes.get(i)?

is there a way to return shapes from a slide in a predefined order without using alternative text?

lets say i have two tables and i need to fill out the bottom table last. is there anyway to make sure the bottom table is the very last shape item from shapes.get(i) before i clone the table?

thanks

joon

Order of shape in a Shapes collection is equal to z-order of shape on a slide.
If shape located on the top of other shapes it will be last in the collection.
If you change z-order of a shape then position in the Shapes collection will be changed too.

alex,

thank you for your response but....

i can see how z-ordering could help for shapes that are overlapping but what about shapes that are not overlaping? does this help?

for example: lets say i have two tables. one is on top have of the slide and the second one is on the bottom half of the same slide. and they are not grouped, connected or overlaped. the problem i have is that the bottom table's rows are dynamic and need to clone the slide when the rows are exceeded. the top table is also dynamic but only filled out once. the behavior i am seeing is that since the bottom slide is returned first via shapes.get(i) the top table is empty when cloning. ideally, i like to populate the top table first than populate the bottom table last. i have a work around but like to see if there is more of an eloquent way of doing this. also, there are other placeholders on the slide.

thanks

joon

All shapes are z-ordered. It doesn’t matter overlapped they or not.
Shapes added on a slide later will have higher z-order.

For your situation I’d suggest to find at first all tables on a slide by iterating
all shapes and checking type of object.
After that (if you know exactly one table is on the bottom and one on the top)
you can simply check Y coordinate of 2 tables and find what table is on the top.