ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

illustrator脚本 018 自动角线-1

2026/9/23 5:43:29 拓冰建站 浏览量
illustrator脚本 018 自动角线-1

这是一个自动加角线的脚本,来源于网络。

运行方式,先选择对象再执行脚本,无对话框。脚本不在好坏,你觉得对你有用最重要。

脚本中部分可修改选项:

//初始化自定义标线的长度,宽度,离岸,出血等参数,可自行修改
lw=0.1*2.834646; //标线宽度 0.1 mm
od=3*2.834646; //中位十字线圆形直径 3 mm
cw=15*2.834646; //智能色标的长度 15mm
ch=10*2.834646; //智能色标的高度 10mm
cspace=3*2.834646; //智能色标间隔 3mm
linelength=10*2.834646; //标注线长度 5 mm
linespace=5*2.834646; //标注线离岸 1 mm
outspace=5*2.834646; //出血 5 mmshuangjiaoxian = true;//判断是否双脚线,属性看下面↓↓↓
rishicaiqie = false;//true开启日式标记 false关闭日式标记doc = activeDocument;
newSpot = doc.spots[doc.spots.length-1]; //获得套版色
regColor = new SpotColor();
regColor.spot = newSpot;theSelect = doc.selection;
lmin=theSelect[0].geometricBounds[0]; //左
tmax=theSelect[0].geometricBounds[1]; //上
lmax=theSelect[0].geometricBounds[2]; //右
tmin=theSelect[0].geometricBounds[3]; //下//计算选择集的四边位置
for (i=1;i<theSelect.length;i++){if (lmin>theSelect[i].geometricBounds[0]){lmin=theSelect[i].geometricBounds[0]}if (tmax<theSelect[i].geometricBounds[1]){tmax=theSelect[i].geometricBounds[1]}if (lmax<theSelect[i].geometricBounds[2]){lmax=theSelect[i].geometricBounds[2]}if (tmin>theSelect[i].geometricBounds[3]){tmin=theSelect[i].geometricBounds[3]}
}//计算所有要画的长度标线位置
w=[];
for (i=0;i<theSelect.length;i++){w.push(theSelect[i].geometricBounds[0]);w.push(theSelect[i].geometricBounds[2]);
}
if(shuangjiaoxian == true){//这里要加入长度标尺双脚线w.push(lmin-outspace);w.push(lmax+outspace);//这里结束长度标尺双脚线
}
//去除重复
ww = [];
for(var i = 0,len = w.length;i < len;i++){! RegExp(w[i],"g").test(ww.join(",")) && (ww.push(w[i]));
}
//构造一个数组进行去重处理
Array.prototype.indexOf = function(val) {for