• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Need a developer for script: Distribute symbols on a path and rotate

Community Beginner ,
Feb 06, 2014 Feb 06, 2014

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.

path.jpg

Any help will be appreciated. I know that nobody is here for develop scripts for free so let's talk

TOPICS
Scripting

Views

2.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Explorer , Feb 07, 2014 Feb 07, 2014

@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!

adobeforum_distribute.png.jpg

Votes

Translate

Translate
Guide , May 09, 2023 May 09, 2023

I think the scripts are available from here 

Votes

Translate

Translate
Adobe
Community Beginner ,
Feb 07, 2014 Feb 07, 2014

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/

aics_script_dup_at.gif

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 07, 2014 Feb 07, 2014

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

2014-02-07_10h48_02.png

  • create intermediate objects using Blend Tool

2014-02-07_10h48_17.png

2014-02-07_10h48_27.png

  • draw your path ( in my case this is 3/4 of a regular circle)

2014-02-07_10h48_39.png

  • select your regular path and the Blend Assembly, go to Object > Blend > Replace Spin

2014-02-07_10h48_53.png

2014-02-07_10h49_08.png

  • the result

2014-02-07_11h01_09.png

hope this helps,

Regards,

Pawel Kuc, ccmutants.com


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2014 Feb 07, 2014

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 09, 2014 Feb 09, 2014

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 10, 2014 Feb 10, 2014

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2014 Feb 07, 2014

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();

// ------------------------------------------------------

adobeforum_rotate.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2014 Feb 07, 2014

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2014 Feb 07, 2014

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!

adobeforum_distribute.png.jpg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 07, 2014 Feb 07, 2014

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.

snap1.jpg

Step 1: Apply the "distributeOnThePath" script.

snap2.jpg

Step 2: Apply the "look at object" script

snap3.jpg

>>> 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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2014 Feb 08, 2014

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.)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 14, 2014 Feb 14, 2014

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 09, 2023 May 09, 2023

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
May 09, 2023 May 09, 2023

Copy link to clipboard

Copied

I think the scripts are available from here 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 10, 2023 May 10, 2023

Copy link to clipboard

Copied

LATEST

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

dengz84974801_0-1683702907334.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Feb 07, 2014 Feb 07, 2014

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2014 Feb 07, 2014

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2014 Feb 07, 2014

Copy link to clipboard

Copied

+1

I too learned and still learn a lot from Mr Sato scripts,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines