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.
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
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
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
Copy link to clipboard
Copied
exactly what I was looking for. You're fantastic guys.
cheers