Copy link to clipboard
Copied
Is there any way or method to order objects by size? I have a bunch of closed, filled shapes (random circles and squares) and I would like to order them by area. If there isn't a way to do it just in illustrator, could I export them to another program and do it there and then return them to illustrator?
Copy link to clipboard
Copied
Hi Amir,
I am afraid right now there no option to do this in Illustrator apart from doing it manually. You may raise this feature request here: Adobe Illustrator Feedback. This is the best way of communicating with the Engineering and Product Management teams regarding issues and suggestions so they can be implemented in future releases.
Regards,
Srishti
Copy link to clipboard
Copied
Amir,
I believe there is a script for it.
Maybe Carlos or Theunis sees this soon, but in any case you may also ask in the Scripting forum,
Copy link to clipboard
Copied
As Jacob said it could be possible through Scripts, I am moving this discussion to Illustrator Scripting
Copy link to clipboard
Copied
when you say "order", what do you mean? stacking order like in the layers panel? arranged from left to right or top to bottom?
i'll assume the first option, but let me know if i'm wrong. here's some pseudocode. not necessarily the best way. but it is one way.
run script
var items = [selected items or all children of a layer or layers.. basically the items you want to sort by size]
var sortedItems = []; //empty array for storing items sorted by size
var largest;
while items.length
largest = items[0];
for each item, starting at 1
if current item is larger than largest
set largest to current item
sortedItems.push(current item);
splice current item from items array
for each item in sortedItems
current item: bring to front
Copy link to clipboard
Copied
Hi williama,
unfortunately, this scenario will presumably only works with simple closed paths (no compound path or clipped paths or or or …).
Copy link to clipboard
Copied
compoundPathItems, groupItems, textFrames etc all still have width and height properties. In the event of a clipping mask, you just need to isolate the top level path that has clipped = true and then use the dimensions of that path to determine the size of the whole clipping mask.
I'm using this exact same method of sorting objects in production right now.
Copy link to clipboard
Copied
I afraid, the width and height are not of interest.
amirwerth wrote
… and I would like to order them by area.
Copy link to clipboard
Copied
my apologies. i mis-read the post.
Copy link to clipboard
Copied
https://forums.adobe.com/people/pixxxel+schubser wrote
Hi williama,
unfortunately, this scenario will presumably only works with simple closed paths (no compound path or clipped paths or or or …).
yeah but the OP said
"I have a bunch of closed, filled shapes (random circles and squares)"
Copy link to clipboard
Copied
my apologies. i misread the post again. ![]()
Copy link to clipboard
Copied
that was a reply to pixxxel ![]()
Copy link to clipboard
Copied
i know. but i conceded to pixxxel's point because i again didn't read the post properly.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more