Skip to main content
Participant
February 1, 2013
Question

JavaScript: return an array based on selection order

  • February 1, 2013
  • 1 reply
  • 2272 views

Hi everyone,

Is there a method to return an array of paths in the order they were selected, instead of their descending z-index (default behaviour)?

I'm writing a script that "connects" the centers of currently selected objects through a stroked path, and I want it to follow the order in which I select the objects, regardless of the stacking order.

Any help is much appreciated! Thanks.

George

This topic has been closed for replies.

1 reply

CarlosCanto
Community Expert
Community Expert
February 1, 2013

unfortunately no, that's not possible.

Larry G. Schneider
Community Expert
Community Expert
February 1, 2013

Couldn't you make a new array while selecting the objects and reorder them while doing this and then draw the new line from that array?

CarlosCanto
Community Expert
Community Expert
February 1, 2013

I didn't get that Larry, you mean while selecting via scripting? I think he wants to select manually in the order he needs the objects to be.