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

Filled area on left or right side of path – make path clockwise - reverse path

New Here ,
Feb 20, 2014 Feb 20, 2014

Copy link to clipboard

Copied

Hello,

for a script I'm writing, which will select path points at specific angles (all angles with less than 180°) I need to know, if the inner part of my shape (namely the filled area) is to the left or to the right regarding the direction the path is running.

Bildschirmfoto 2014-02-20 um 19.46.46.png

In Illustrator I'm able to create shapes by drawing clockwise or counterclockwise. This is a problem, because the filled area sometimes is to the left and sometimes to the right. I know a script out there, which makes the path running the reverse direction. But it doesn't care if the path is already running clockwise or counterclockwise.

I'm looking for a script which allows me to destinctivly make a path running clockwise when it is counterclockwise so that the filled area is to the right of the path or leave it as it is.

I've been searching on google for ages already but could'nt find any script which handled this before.

thank you for any help

Benny

TOPICS
Scripting

Views

739

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
Adobe
Engaged ,
Feb 20, 2014 Feb 20, 2014

Copy link to clipboard

Copied

if (PolarityValues == POSITIVE){

     PolarityValues=NEGITIVE;

}

Something like that. PolarityValues is what you are looking for.

Page 249 in the CS6 Scripting Reference

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 20, 2014 Feb 20, 2014

Copy link to clipboard

Copied

select a path before running

var idoc = app.activeDocument;

var sel = idoc.selection[0];

if (sel.polarity == 'PolarityValues.NEGATIVE')

    sel.polarity = PolarityValues.POSITIVE;

edit:

yeah, same as what elDudereno said

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 ,
Feb 21, 2014 Feb 21, 2014

Copy link to clipboard

Copied

LATEST

exactly what I was looking for. You're fantastic guys.

cheers

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