Copy link to clipboard
Copied
Hello everyone. I need your help.
I am currently looking for a script that can automatically group different pieces into one group including small details inside the image. I hope everyone can help me. Any help is highly appreciated. Thank you very much!
Copy link to clipboard
Copied
You can download the reference file here.: https://www.dropbox.com/scl/fi/rhbd07uvcejspaepkxit3/Reference-file.ai?rlkey=2nldgdchqfph3j8lyzebnhj...
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I once tried to write a script that was supposed to select all objects located completely inside any given closed path. It worked pretty well with simple closed paths (like rectangles and simple polygons), but it did not work reliably with more complex closed (and curvy) paths.
Finally I did not pursue the approach anymore because there were just too many exceptional cases.
I also have an action that may work in some situations, but it is not completely reliable as well.
However, based on your sample file I'd suggest to just take the Lasso tool to select the desired objects and group them. That's a fast way that should not take more than half a minute. Of course your sample file shows why it would be useful if Illustrator had a dedicated Polygon Lasso tool.
In recent Illustrator versions, another way that may somewhat work sometimes is to use the encapsulated mode while using the Selection tool.