Copy link to clipboard
Copied
Dear all,
I need an Illustrator script for distribute a collection of diferent symbols along a path. The symbols should be distributed from the beginning to end of path and separated a proportional space each other. Additionally each symbol should be rotated pointing to a "look at" object.
Please look at the attached image for further info.
Any help will be appreciated. I know that nobody is here for develop scripts for free so let's talk
2 Correct answers
@carlostelemaco
I'm glad.
But "Divide(length)" script works for each segment.
So it is not usable for the purpose that divides the whole path that has different length of segments.
I wrote a script for the process 1 and 2.
Though it is a bit rough implementation for now.
Please try this.
http://shspage.com/aijs/af_distributeOnThePath.zip
@W_J_T, @pixxxel schubser, @CarlosCanto
Thanks. Let's have fun with the scripting!
I think the scripts are available from here
Explore related tutorials & articles
Copy link to clipboard
Copied
The "Dup At Selected Anchors" of Hiroyuki Sato is a great beginning but it only works with an object (duplicate it) and I need an array of symbols instead.
http://shanfan.github.io/Illustrator-Scripts-Archive/
Copy link to clipboard
Copied
I know this is not what you are looking for, but here is what you could use when working with very SIMPLE paths (such as part of regular circle):
- insert your object and its copy
- create intermediate objects using Blend Tool
- draw your path ( in my case this is 3/4 of a regular circle)
- select your regular path and the Blend Assembly, go to Object > Blend > Replace Spin
- the result
hope this helps,
Regards,
Pawel Kuc, ccmutants.com
Copy link to clipboard
Copied
Dear Pawel,
Thanks for your wonderful answer about the "blend" tool, but I need to use "symbols" instead of shapes and as far as I know this option is inpossible with "blend" so I think this issue only can be solved with a script.
Thank you!
Copy link to clipboard
Copied
just to clarify: the Blend Tool works on symbols as well
tested with CS6 and CC...
Regards,
Pawel Kuc, ccmutants.com
Copy link to clipboard
Copied
Dear Pawel, you're right, blend also works with symbols, but reading your fantastic explanation, as far as I know, it only works with two objects (start-end), so can't be used for distribution pourposes with several different ones.
Thank you!
Copy link to clipboard
Copied
It needs these processes.
1. creates an array of symbols sorted from left to right by their positions
2. distributes them on the path
3. rotates them toward the target point
The 2nd part needs so complicated process.
The 3rd part is relatively simple as follows.
// ------------------------------------------------------
function main(){
var sels = activeDocument.selection;
// gets the center of the foreground object.
// the other objects are rotated toward this point.
var point = getCenter( sels[0] );
for(var i = 1; i < sels.length; i++){
var t = getAngle( point, getCenter(sels));
sels.rotate( t - 90, true, true, true, true, Transformation.CENTER );
}
}
function getCenter(p){
return [p.left + p.width / 2, p.top - p.height / 2];
}
function getAngle(p1, p2){
return Math.atan2(p2[1] - p1[1], p2[0] - p1[0]) * 180 / Math.PI;
}
main();
// ------------------------------------------------------
Copy link to clipboard
Copied
Dear Hiroyuki,
I've just test your script and works awesome!
By the moment I'm going to use circles and arcs as paths so I guess the second process can be solved using your script "Divide (length)" to add anchor points to the path as much as symbols in the array of the first process.
Thanks a lot!
Copy link to clipboard
Copied
@carlostelemaco
I'm glad.
But "Divide(length)" script works for each segment.
So it is not usable for the purpose that divides the whole path that has different length of segments.
I wrote a script for the process 1 and 2.
Though it is a bit rough implementation for now.
Please try this.
http://shspage.com/aijs/af_distributeOnThePath.zip
@W_J_T, @pixxxel schubser, @CarlosCanto
Thanks. Let's have fun with the scripting!
Copy link to clipboard
Copied
Dear Hiroyuki, It works perfect! So now I can combine both scripts to place objects and orient it to a point.
Step 1: Apply the "distributeOnThePath" script.
Step 2: Apply the "look at object" script
>>> Adobe should take note of this solution and include it in AI's alignment tools.
Thank you again for this wonderful solution, It will save my life when have to place thousands of objects.
Copy link to clipboard
Copied
@carlostelemaco
Fantastic example! These scripts were written thanks to your idea.
I think it would be better not to integrate the two scripts into one script in this case, for the general versatility and the easiness of use. Because there are multiple objects to be specified. (The path to distribute and the point to look.)
Copy link to clipboard
Copied
In addition, it would be better if these scripts have several options for the practical use.
So I added them. They are on my site.
http://shspage.blogspot.jp/2014/02/rotatetowardpointjsx.html
http://shspage.blogspot.jp/2014/02/distributeonthepathjsx.html
Copy link to clipboard
Copied
Your script seems to be very useful to me, but it seems that your website can't download the script anymore, is there any other way to download it? Thank you very much!
Copy link to clipboard
Copied
I think the scripts are available from here
Copy link to clipboard
Copied
Thank you for your guidance, I just also used grasshopper to achieve this function, there are still some problems, I will try again HiroyukiSato's script
Copy link to clipboard
Copied
HiroyukiSato wrote:
Off Topic: I just wanted to say I am a huge fan of your scripts and talents, keep up the good work and thanks for sharing your efforts with others. Welcome to the forum by the way.
Copy link to clipboard
Copied
W_J_T wrote:
Off Topic: I just wanted to say I am a huge fan of your scripts and talents, keep up the good work and thanks for sharing your efforts with others. Welcome to the forum by the way.
@TO, sorry for
a little bit more Off Topic:
@HiroyukiSato,
I also thank you for your fantastic scripts. It was often my help and inspiration.
And also Welcome to the forum.
Regards
pixxxelschubser
Copy link to clipboard
Copied
+1
I too learned and still learn a lot from Mr Sato scripts,

