Answered
PathItem creation
I'm trying to create a function that checks all the elements of a pathitem and reproduces it, but I'm not able to create the last edge that closes it, be it a straight line or a curve, below I leave an image of the result, could anyone give me some tip?
function RecreateDieCut () {
var doc = app.activeDocument;
var pathItemOriginal = doc.pathItems.getByName("path")
var doc = app.documents.add();
var novoPathItem = doc.pathItems.add();
for (var i = 0; i < pathItemOriginal.pathPoints.length; i++) {
var pathPointOriginal = pathItemOriginal.pathPoints[i];
var pathPointNovo = novoPathItem.pathPoints.add();
pathPointNovo.anchor = pathPointOriginal.anchor;
pathPointNovo.leftDirection = pathPointOriginal.leftDirection;
pathPointNovo.rightDirection = pathPointOriginal.rightDirection;
pathPointNovo.pointType = pathPointOriginal.pointType;
}
}
RecreateDieCut();