6 Replies Latest reply on Jun 9, 2015 4:29 AM by Qwertyfly...

# How to know the coordinates of the vertices of the selected line?

How to know the coordinates of the vertices of the selected line?

• ###### 1. Re: How to know the coordinates of the vertices of the selected line?

do you mean the highest point?

or each end?

or intersections?

vertices has different meanings in different situations.

• ###### 2. Re: How to know the coordinates of the vertices of the selected line?

I have a closed line, it consists of 3 or 4 points. I need to know the coordinates of these points

• ###### 3. Re: How to know the coordinates of the vertices of the selected line?

The red highlighted point coordinates I need to know

.

• ###### 4. Re: How to know the coordinates of the vertices of the selected line?

try something like this,

```var doc = app.activeDocument;
var sel = doc.selection;
var points = [], point = [], text = "";
for(var i = 0; i < sel.length; i++){
for(var j = 0; j < sel[i].pathPoints.length; j++){
point = sel[i].pathPoints[j].anchor;
points.push(point);
}
}
for(var i = 0; i < points.length; i++){
text = text + "\n(" + points[i][0] + "," + points[i][1] + ")";
}
```
• ###### 5. Re: How to know the coordinates of the vertices of the selected line?

x1 =(selectedObjs[0].pathPoints[0].anchor[0])  ;

y1 =(selectedObjs[0].pathPoints[0].anchor[1]);

I'm interested in how to take the coordinates in centimeters?

• ###### 6. Re: How to know the coordinates of the vertices of the selected line?
```var ToMM = 2.83466796875;
var ToCM = 0.283466796875;
x1asMM = x1 * ToMM;
x1asCM = x1 * ToCM;

```

all coordinates are global.

if you want them in relation to the artboard then you need to reference the artboardRect