Skip navigation
Currently Being Moderated

Iterating over the art tree

Apr 5, 2012 8:56 AM

I am trying to write a 'duplicateLayer' function, and I've read all the related posts on these forums.  It seems most of the responses have only addressed art inside a layer, and not nested layers/groups.  I need to be able to duplicate ALL items in a layer.

 

I can get the sub-layers, but I can't figure out how to preserve order of the items in the new layer.  For example, if my layer looks like this:

 

layer 1

art 1

art 2

sub layer 1

sub art 1

art 3

 

I can call layer.pageItems to get my three art objects and duplicate them, and I can call layer.layers to get my one sub layer and duplicate it.  But how do I preserve the same order of the art objects and sub layers with respect to each other?

 
Replies
  • Currently Being Moderated
    Apr 6, 2012 1:43 AM   in reply to Meate

    I don't use z-order just the indexes…

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 8, 2013 10:42 AM   in reply to Meate

    I'm trying to fix a similar issue.  Did you ever find a solution?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points