Script for automatically changing path directions

Community Beginner ,
Nov 24, 2020

Copy link to clipboard

Copied

I need a script for Illustrator that does the following:

  1. First path follows clockwise direction
  2. Second path inside the 1. Path follows a countclockwise direction
  3. Third path inside the 2. path follows clockwise direction .... and this cycle repeats...

To Illustrate what I mean see the picture:

Unbenannt-1.jpg

and this follows, depending on the amount of paths inside each other.

Does anyone knows how to solve this?

Thank you in advance!

TOPICS
Feature request, Scripting, Third party plugins, Tools

Views

131

Likes

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

Script for automatically changing path directions

Community Beginner ,
Nov 24, 2020

Copy link to clipboard

Copied

I need a script for Illustrator that does the following:

  1. First path follows clockwise direction
  2. Second path inside the 1. Path follows a countclockwise direction
  3. Third path inside the 2. path follows clockwise direction .... and this cycle repeats...

To Illustrate what I mean see the picture:

Unbenannt-1.jpg

and this follows, depending on the amount of paths inside each other.

Does anyone knows how to solve this?

Thank you in advance!

TOPICS
Feature request, Scripting, Third party plugins, Tools

Views

132

Likes

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
Nov 24, 2020 0
Adobe Community Professional ,
Nov 24, 2020

Copy link to clipboard

Copied

Is doing it by hand an option?

 

- select all your circles

- grab the Shape Builder Tool

- puch holes with it

- apply PathFinder Unite

- ungroup

- release Compound Paths

 

Carlos

Likes

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
Reply
Loading...
Nov 24, 2020 1
Community Beginner ,
Nov 25, 2020

Copy link to clipboard

Copied

Hey Carlos,

 

doing by hand is not an option because I need to edit hundres of vector data and this would take me a lot of time to do everything manually.

Likes

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
Reply
Loading...
Nov 25, 2020 0
Adobe Community Professional ,
Nov 24, 2020

Copy link to clipboard

Copied

Which version of Illustrator are you using?

 

Also, in cases like this one it is often recommendable to provide at least one meaningful sample Illustrator file (.ai) to demonstrate a representative situation. This way, it is much easier to brood about possible automated ways.

 

Likes

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
Reply
Loading...
Nov 24, 2020 1
Community Beginner ,
Nov 25, 2020

Copy link to clipboard

Copied

I am using the lastest Illustrator version.

 

I need an automated way of doing this since I am not editing one file specifically but figuring out how to edit hundreds of files.

Paths need to be organised this way I've described because it will be used for laser marking and the software for that reads the data this way for correct lasermarking.

Likes

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
Reply
Loading...
Nov 25, 2020 0
Community Beginner ,
Nov 25, 2020

Copy link to clipboard

Copied

Likes

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
Reply
Loading...
Nov 25, 2020 0
Engaged ,
Nov 24, 2020

Copy link to clipboard

Copied

var d1 = prompt("diameter (in points) of outer circle");
var n = prompt("number of circles");
var d = app.activeDocument.artboards[0].artboardRect;
var paths = app.activeDocument.pathItems;
var direction = false;
for (var i = 0; i < n; i++) {
    var d2 = (d1/n) * (n-i) ;
    direction = !direction;
    var circle1 = paths.ellipse(d[3]/2+d2/2, d[2]/2-d2/2, d2, d2, direction);
    circle1.stroked = true;
    circle1.filled = false;
}

Likes

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
Reply
Loading...
Nov 24, 2020 2
Adobe Community Professional ,
Nov 24, 2020

Copy link to clipboard

Copied

Femkeblanco, do you think that your approach is a reliable way without checking a sample file?

 

I'm not sure.

 

Likes

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
Reply
Loading...
Nov 24, 2020 0
Engaged ,
Nov 24, 2020

Copy link to clipboard

Copied

I agree.  It's a shot in the dark. 

Likes

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
Reply
Loading...
Nov 24, 2020 0
Community Beginner ,
Nov 25, 2020

Copy link to clipboard

Copied

Here is an example file 😄

 

https://we.tl/t-DQwWveLHb3

Likes

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
Reply
Loading...
Nov 25, 2020 0
Adobe Community Professional ,
Nov 24, 2020

Copy link to clipboard

Copied

Clint Eastwood had some good shots in the dark some years ago.

 

But he was always careful and clear-sighted.

 

Nonetheless, your snippet is very good.

 

Likes

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
Reply
Loading...
Nov 24, 2020 2
Community Beginner ,
Nov 25, 2020

Copy link to clipboard

Copied

Hi Kurt, Like I said in the previous comments,

 

I will be editing hundreds of different vector files, and I need to be able to follow this "logic" I've described above.

Outer Path must follow clockwise. First inner paths must follow counterwise, and so on and on.

See an example 😄

 

path-example.jpg

 

 

 

Likes

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
Reply
Loading...
Nov 25, 2020 0
Community Beginner ,
Nov 25, 2020

Copy link to clipboard

Copied

https://we.tl/t-DQwWveLHb3v Here is the example file of what I described above

Likes

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
Reply
Loading...
Nov 25, 2020 0
Resources