Hi Mikima,
Indeed! I wrote some quick example code for others to see how to find selected segment points.
The following code draws a circle around any selected segment points:
var selectedPaths = document.getItems({
type: Path,
selected: true
});
for(var i = 0; i < selectedPaths.length; i++) {
var path = selectedPaths[i];
var segments = path.segments;
for(var j = 0; j < segments.length; j++) {
var segment = segments[j];
if(segment.point.selected) {
var circle = new Path.Circle(segment.point, 5);
circle.fillColor = 'red';
}
}
}
The following code selects and deselects the segment points of selected paths in an even / odd manner:
var selectedPaths = document.getItems({
type: Path,
selected: true
});
for(var i = 0; i < selectedPaths.length; i++) {
var path = selectedPaths[i];
var segments = path.segments;
for(var j = 0; j < segments.length; j++) {
var selected = j.isOdd();
var segment = segments[j];
segment.point.selected = selected;
}
}