illustrator插件--常用功能开发--画刀版2--js脚本开发--AI插件
作者:互联网
illustrator是矢量编辑软件,画板是绘制处理的重要容器,在印刷方面的一个重要功能就是画刀版2,开发一个画刀版2功能,以下功能仅用于学习交流,请勿用于非法用途和商业用途,源代码如下所示:
var docRef = app.activeDocument;
var pointTomm = 2.834645;
var pw = 0;
var ph = 0;
var x = 0;
var y = 0;
var sl = false;
var aiver = app.version;
var fileNameLocation = 0;
var pageNumberLocation = 0;
var regColorIndex = 1;
var myDialog = new Window("dialog", "增加盒型线对话框窗口");
with(myDialog) {
alignChildren = "fill";
var myGuideTypesPanel = add("panel", undefined, "增加一组复选框");
with(myGuideTypesPanel) {
orientation = "column";
alignChildren = "left";
margins = [15, 8, 12, 3];
spacing = 5;
myDialog.myOneRadioButton = add("radiobutton", undefined, "直线盒");
myDialog.myOneRadioButton.value = true;
myDialog.myTwoRadioButton = add("radiobutton", undefined, "锁底盒");
myDialog.myTwoRadioButton.value = false;
myDialog.myThereRadioButton = add("radiobutton", undefined, "飞机盒");
myDialog.myThereRadioButton.value = false;
myDialog.myFourRadioButton = add("radiobutton", undefined, "上盖盒");
myDialog.myFourRadioButton.value = false;
myDialog.myFiveRadioButton = add("radiobutton", undefined, "同向盖");
myDialog.myFiveRadioButton.value = false;
myDialog.mySixRadioButton = add("radiobutton", undefined, "粘底盒");
myDialog.mySixRadioButton.value = false;
myDialog.mySevenRadioButton = add("radiobutton", undefined, "挂耳盒");
myDialog.mySevenRadioButton.value = false;
myDialog.myEightRadioButton = add("radiobutton", undefined, "手提盒");
myDialog.myEightRadioButton.value = false;
myDialog.myNineRadioButton = add("radiobutton", undefined, "纸箱");
myDialog.myNineRadioButton.value = false;
myDialog.myTineRadioButton = add("radiobutton", undefined, "其它");
myDialog.myTineRadioButton.value = false;
myDialog.useCropmarkCheckbox = add("checkbox", undefined, "添加图层");
myDialog.useCropmarkCheckbox.value = true;
}
var myBorderPanel = add("panel", undefined, "规格参数:");
with(myBorderPanel) {
with(add("group")) {
orientation = "row";
alignChildren = "center";
margins = [12, 3, 12, 0];
spacing = 1;
with(add("group")) {
orientation = "column";
alignChildren = "right";
spacing = 13;
var myXsetLabel = add("statictext", undefined, "长度:");
var myYsetLabel = add("statictext", undefined, "宽度:");
var myHsetLabel = add("statictext", undefined, "高度:");
var myPsetLabel = add("statictext", undefined, "缩位:");
var myZsetLabel = add("statictext", undefined, "插舌高度:");
var mySxsetLabel = add("statictext", undefined, "粘口宽度:");
}
with(add("group")) {
orientation = "column";
alignChildren = "left";
characters = 40;
myDialog.myXsetEdittext = add("edittext", [2, 0, 45, 16], "60");
myDialog.myYsetEdittext = add("edittext", [2, 0, 45, 16], "50");
myDialog.myHsetEdittext = add("edittext", [2, 0, 45, 16], "80");
myDialog.myPsetEdittext = add("edittext", [2, 0, 45, 16], "0.5");
myDialog.myZsetEdittext = add("edittext", [2, 0, 45, 16], "12");
myDialog.mySxsetEdittext = add("edittext", [2, 0, 45, 16], "11");
}
with(add("group")) {
orientation = "column";
alignChildren = "left";
spacing = 13;
add("statictext", undefined, "mm");
add("statictext", undefined, "mm");
add("statictext", undefined, "mm");
add("statictext", undefined, "mm");
add("statictext", undefined, "mm");
add("statictext", undefined, "mm");
}
}
}
with(add("group")) {
orientation = "row";
alignChildren = "center";
margins = [8, 0, 8, 0];
add("statictext", undefined, "ajz");
}
with(add("group")) {
orientation = "row";
alignment = "center";
myDialog.myCloseButton = add("button", undefined, "取消", {
name: "cancel"
});
myDialog.myCloseButton.onClick = function() {
myDialog.close();
};
myDialog.myOKButton = add("button", undefined, "确定", {
name: "ok"
});
}
}
var myReturn = myDialog.show();
if (myReturn == true) {
if (app.documents.length <= 0) {
alert("请先建立一个新文件", "错误");
} else {
var sw = 0.1 * pointTomm;
var colorBarStroke = 0.1 * pointTomm;
var creatCropMarkLayer = myDialog.useCropmarkCheckbox.value;
var oneBox = myDialog.myOneRadioButton.value;
var twoBox = myDialog.myTwoRadioButton.value;
var thereBox = myDialog.myThereRadioButton.value;
var fourBox = myDialog.myFourRadioButton.value;
var fiveBox = myDialog.myFiveRadioButton.value;
var sixBox = myDialog.mySixRadioButton.value;
var sevenBox = myDialog.mySevenRadioButton.value;
var eightBox = myDialog.myEightRadioButton.value;
var nineBox = myDialog.myNineRadioButton.value;
var tineBox = myDialog.myTineRadioButton.value;
var l = myDialog.myXsetEdittext.text * pointTomm;
var w = myDialog.myYsetEdittext.text * pointTomm;
var h = myDialog.myHsetEdittext.text * pointTomm;
var p = myDialog.myPsetEdittext.text * pointTomm;
var z = myDialog.myZsetEdittext.text * pointTomm;
var sx = myDialog.mySxsetEdittext.text * pointTomm;
if (creatCropMarkLayer == true) {
docRef.layers.add();
activeDocument.layers[0].name = "模切";
var zeroX = x;
var zeroY = y;
} else {
var zeroX = docRef.cropBox[0];
var zeroY = docRef.cropBox[3];
}
if (oneBox == true) {
lineOneBox();
}
if (twoBox == true) {
lineTwoBox();
}
if (thereBox == true) {
lineThereBox();
}
if (fourBox == true) {
lineFourBox();
}
if (fiveBox == true) {
lineFiveBox();
}
if (sixBox == true) {
lineSixBox();
}
if (sevenBox == true) {
lineSevenBox();
}
if (eightBox == true) {
lineEightBox();
}
if (nineBox == true) {
lineNineBox();
}
if (tineBox == true) {
lineTineBox();
}
function lineOneBox() {
var sx1 = 7 * pointTomm;
var sx2 = 3 * pointTomm;
var sx3 = 2 * pointTomm;
var sy1 = 5 * pointTomm;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.5 * sy1;
}
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 1.5 * sx2;
sx3 = 1.5 * sx3;
sy1 = 1.2 * sy1;
}
var lineGroup = docRef.groupItems.add();
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(0, h + p), Array(l, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[l + w, 0 - p],
[(2 * l) + w, 0 - p]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
line5.filled = false;
line5.stroked = true;
line5.strokeWidth = sw;
line5.strokeColor = docRef.swatches[4].color;
line5.setEntirePath([
[sx1, h + w],
[l - sx1, h + w]
]);
line6.filled = false;
line6.stroked = true;
line6.strokeWidth = sw;
line6.strokeColor = docRef.swatches[4].color;
line6.setEntirePath([
[l + w + sx1, 0 - w],
[((2 * l) + w) - sx1, 0 - w]
]);
var myLine = lineGroup2.pathItems.add();
myLine.filled = false;
myLine.stroked = true;
myLine.strokeWidth = sw;
var newPoint1 = myLine.pathPoints.add();
newPoint1.anchor = [p, h + w + p];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine.pathPoints.add();
newPoint2.anchor = [p + z, h + w + p + z];
newPoint2.leftDirection = [p, h + w + p + z];
newPoint2.rightDirection = newPoint2.anchor;
newPoint2.pointType = PointType.CORNER;
var newPoint3 = myLine.pathPoints.add();
newPoint3.anchor = [(l - z) - p, h + w + z + p];
newPoint3.leftDirection = newPoint3.anchor;
newPoint3.rightDirection = [l - p, h + w + p + z];
newPoint3.pointType = PointType.CORNER;
var newPoint4 = myLine.pathPoints.add();
newPoint4.anchor = [l - p, h + w + p];
newPoint4.leftDirection = newPoint4.anchor;
newPoint4.rightDirection = newPoint4.anchor;
newPoint4.pointType = PointType.CORNER;
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[0, h],
[0, h + w + p],
[sx1, h + w + p],
[sx1, (h + w) - (2 * p)]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l, h],
[l + sx2, h + sx2],
[l + (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - (2.5 * sx2), h + ((w + z + p) / 2)],
[((l + w) - p) - sx3, h + sy1 + sx3],
[(l + w) - p, h + sy1],
[(l + w) - p, h]
]);
line23.filled = false;
line23.stroked = true;
line23.strokeWidth = sw;
line23.setEntirePath([
[l, h],
[l, h + w + p],
[l - sx1, h + w + p],
[l - sx1, (h + w) - (2 * p)]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w + p, h],
[(2 * l) + w + p, h + sy1],
[(2 * l) + w + p + sx3, h + sy1 + sx3],
[(2 * l) + w + (2.5 * sx2), h + ((w + z + p) / 2)],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), h + ((w + z + p) / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2],
[(2 * (l + w)) - p, h]
]);
line25 = line21.duplicate();
line25.rotate(180);
line25.top = 0;
line25.left = (((2 * l) + w) - sx1) - (sw / 2);
line26 = line22.duplicate();
line26.rotate(180);
line26.top = 0;
line26.left = (l + p) - (sw / 2);
line27 = line23.duplicate();
line27.rotate(180);
line27.top = 0;
line27.left = (l + w) - (sw / 2);
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[(2 * l) + w, 0],
[(2 * l) + w + sx2, -sx2],
[(2 * l) + w + (2 * sx2), -(w + z + p) / 2],
[(2 * (l + w)) - (2.5 * sx2), -(w + z + p) / 2],
[((2 * (l + w)) - p) - sx3, -sy1 - sx3],
[(2 * (l + w)) - p, -sy1],
[(2 * (l + w)) - p, 0]
]);
line29 = myLine.duplicate();
line29.rotate(180);
line29.top = -p - w;
line29.left = (l + w + p) - (sw / 2);
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[0, 0],
[l, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((l + w) - p, h), Array((2 * l) + w + p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
}
function lineTwoBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
if (l > w) {
var sx1 = 7 * pointTomm;
var sx2 = 3 * pointTomm;
var sx3 = 2 * pointTomm;
var sx4 = 6 * pointTomm;
var sy1 = 5 * pointTomm;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2.5 * sx2;
sx3 = 2.5 * sx3;
sy1 = 1.5 * sy1;
} else {
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.2 * sy1;
}
}
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(0, h + p), Array(l, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[sx1, h + w],
[l - sx1, h + w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[l + w, 0],
[(2 * l) + w, 0]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[0, 0],
[l, 0]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
var myLine = lineGroup2.pathItems.add();
myLine.filled = false;
myLine.stroked = true;
myLine.strokeWidth = sw;
var newPoint1 = myLine.pathPoints.add();
newPoint1.anchor = [p, h + w + p];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine.pathPoints.add();
newPoint2.anchor = [p + z, h + w + p + z];
newPoint2.leftDirection = [p, h + w + p + z];
newPoint2.rightDirection = newPoint2.anchor;
newPoint2.pointType = PointType.CORNER;
var newPoint3 = myLine.pathPoints.add();
newPoint3.anchor = [(l - z) - p, h + w + z + p];
newPoint3.leftDirection = newPoint3.anchor;
newPoint3.rightDirection = [l - p, h + w + p + z];
newPoint3.pointType = PointType.CORNER;
var newPoint4 = myLine.pathPoints.add();
newPoint4.anchor = [l - p, h + w + p];
newPoint4.leftDirection = newPoint4.anchor;
newPoint4.rightDirection = newPoint4.anchor;
newPoint4.pointType = PointType.CORNER;
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
var myLine1 = lineGroup2.pathItems.add();
myLine1.filled = false;
myLine1.stroked = true;
myLine1.strokeWidth = sw;
var newPoint1 = myLine1.pathPoints.add();
newPoint1.anchor = [l + (w / 2), (sx3 + sx4) - ((3 * w) / 4)];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine1.pathPoints.add();
newPoint2.anchor = [l + (w / 2) + sx4, sx3 - ((3 * w) / 4)];
newPoint2.leftDirection = [l + (w / 2), sx3 - ((3 * w) / 4)];
newPoint2.rightDirection = newPoint1.anchor;
newPoint2.pointType = PointType.CORNER;
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[0, h],
[0, h + w + p],
[sx1, h + w + p],
[sx1, (h + w) - (2 * p)]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l, h],
[l + sx2, h + sx2],
[l + (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - (2.5 * sx2), h + ((w + z + p) / 2)],
[((l + w) - p) - sx3, h + sy1 + sx3],
[(l + w) - p, h + sy1],
[(l + w) - p, h]
]);
line23.filled = false;
line23.stroked = true;
line23.strokeWidth = sw;
line23.setEntirePath([
[l, h],
[l, h + w + p],
[l - sx1, h + w + p],
[l - sx1, (h + w) - (2 * p)]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w + p, h],
[(2 * l) + w + p, h + sy1],
[(2 * l) + w + p + sx3, h + sy1 + sx3],
[(2 * l) + w + (2.5 * sx2), h + ((w + z + p) / 2)],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), h + ((w + z + p) / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2],
[(2 * (l + w)) - p, h]
]);
line25.filled = false;
line25.stroked = true;
line25.strokeWidth = sw;
line25.setEntirePath([
[l + w, 0],
[l + ((3 * w) / 2), -w / 2],
[l + ((3 * w) / 2), (-3 * w) / 4],
[(2 * l) + (w / 2), (-3 * w) / 4],
[(2 * l) + (w / 2), -w / 2],
[(2 * l) + w, 0]
]);
line27.filled = false;
line27.stroked = true;
line27.strokeWidth = sw;
line27.setEntirePath([
[(2 * (l + w)) - p, 0],
[(2 * l) + ((3 * w) / 2), -w / 2],
[(2 * l) + ((3 * w) / 2), (sx3 - ((3 * w) / 4)) + sx4]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath([
[((2 * l) + ((3 * w) / 2)) - sx4, ((-3 * w) / 4) + sx3],
[(2 * l) + w, ((-3 * w) / 4) + sx3],
[(2 * l) + w, 0]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath1 = lineGroup2.pathItems.add();
newPath1 = myLine1.duplicate();
newPath1.rotate(90);
newPath1.top = (sx3 + sx4) - ((3 * w) / 4);
newPath1.left = ((2 * l) + ((3 * w) / 2)) - sx4;
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[l, 0],
[l + (w / 2), -w / 2],
[l + (w / 2), (sx3 - ((3 * w) / 4)) + sx4]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath([
[l + (w / 2) + sx4, ((-3 * w) / 4) + sx3],
[l + w, ((-3 * w) / 4) + sx3],
[l + w, 0]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
line29.filled = false;
line29.stroked = true;
line29.strokeWidth = sw;
line29.setEntirePath([
[0, 0],
[0, (-3 * w) / 4],
[w / 2, (-3 * w) / 4],
[w / 2, -w / 2],
[l - (w / 2), -w / 2],
[l - (w / 2), (-3 * w) / 4],
[l, (-3 * w) / 4],
[l, 0]
]);
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[0, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((l + w) - p, h), Array((2 * l) + w + p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
} else {
alert("输入的长度必须大于宽度!自动调整长与宽", "错误");
a = l;
l = w;
w = a;
lineTwoBox();
}
}
function lineThereBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
var sx1 = 7 * pointTomm;
var sx2 = 3 * pointTomm;
var sx3 = 2 * pointTomm;
var sy1 = 5 * pointTomm;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2.5 * sx2;
sx3 = 2.5 * sx3;
sy1 = 1.5 * sy1;
} else {
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.2 * sy1;
}
}
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(0, h + p), Array(l, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[sx1, h + w],
[l - sx1, h + w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[sx1, 0 - w],
[l - sx1, 0 - w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[0, 0 - p],
[l, 0 - p]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
var myLine = lineGroup2.pathItems.add();
myLine.filled = false;
myLine.stroked = true;
myLine.strokeWidth = sw;
var newPoint1 = myLine.pathPoints.add();
newPoint1.anchor = [p, h + w + p];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine.pathPoints.add();
newPoint2.anchor = [p + z, h + w + p + z];
newPoint2.leftDirection = [p, h + w + p + z];
newPoint2.rightDirection = newPoint2.anchor;
newPoint2.pointType = PointType.CORNER;
var newPoint3 = myLine.pathPoints.add();
newPoint3.anchor = [(l - z) - p, h + w + z + p];
newPoint3.leftDirection = newPoint3.anchor;
newPoint3.rightDirection = [l - p, h + w + p + z];
newPoint3.pointType = PointType.CORNER;
var newPoint4 = myLine.pathPoints.add();
newPoint4.anchor = [l - p, h + w + p];
newPoint4.leftDirection = newPoint4.anchor;
newPoint4.rightDirection = newPoint4.anchor;
newPoint4.pointType = PointType.CORNER;
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[0, h],
[0, h + w + p],
[sx1, h + w + p],
[sx1, (h + w) - (2 * p)]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l, h],
[l + sx2, h + sx2],
[l + (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - (2.5 * sx2), h + ((w + z + p) / 2)],
[((l + w) - p) - sx3, h + sy1 + sx3],
[(l + w) - p, h + sy1],
[(l + w) - p, h]
]);
line23.filled = false;
line23.stroked = true;
line23.strokeWidth = sw;
line23.setEntirePath([
[l, h],
[l, h + w + p],
[l - sx1, h + w + p],
[l - sx1, (h + w) - (2 * p)]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w + p, h],
[(2 * l) + w + p, h + sy1],
[(2 * l) + w + p + sx3, h + sy1 + sx3],
[(2 * l) + w + (2.5 * sx2), h + ((w + z + p) / 2)],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), h + ((w + z + p) / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2],
[(2 * (l + w)) - p, h]
]);
line25 = line21.duplicate();
line25.rotate(180);
line25.top = 0;
line25.left = (l - sx1) - (sw / 2);
line26.filled = false;
line26.stroked = true;
line26.strokeWidth = sw;
line26.setEntirePath([
[l, 0],
[l + sx2, -sx2],
[l + (2 * sx2), -(w + z + p) / 2],
[(l + w) - (2.5 * sx2), -(w + z + p) / 2],
[((l + w) - p) - sx3, -sy1 - sx3],
[(l + w) - p, -sy1],
[(l + w) - p, 0]
]);
line27 = line23.duplicate();
line27.rotate(180);
line27.top = 0;
line27.left = -sw / 2;
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[(2 * l) + w + p, 0],
[(2 * l) + w + p, -sy1],
[(2 * l) + w + p + sx3, -sy1 - sx3],
[(2 * l) + w + (2.5 * sx2), -(w + z + p) / 2],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), -(w + z + p) / 2],
[((2 * (l + w)) - p) - sx2, -sx2],
[(2 * (l + w)) - p, 0]
]);
line29 = myLine.duplicate();
line29.rotate(180);
line29.top = -p - w;
line29.left = p - (sw / 2);
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[0, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((l + w) - p, 0), Array((2 * l) + w + p, 0)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((l + w) - p, h), Array((2 * l) + w + p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
}
function lineFourBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
var sx1 = 7 * pointTomm;
var sx2 = 3 * pointTomm;
var sx3 = 2 * pointTomm;
var sy1 = 5 * pointTomm;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2.5 * sx2;
sx3 = 2.5 * sx3;
sy1 = 1.5 * sy1;
} else {
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.2 * sy1;
}
}
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(l + w, h + p), Array((2 * l) + w, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[l + w, h + w],
[(2 * l) + w, h + w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[l + w, 0 - w],
[(2 * l) + w, 0 - w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[l + w, 0 - p],
[(2 * l) + w, 0 - p]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
var myLine = lineGroup2.pathItems.add();
myLine.filled = false;
myLine.stroked = true;
myLine.strokeWidth = sw;
var newPoint1 = myLine.pathPoints.add();
newPoint1.anchor = [l + w, h + w + p];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine.pathPoints.add();
newPoint2.anchor = [l + w + p + z, h + w + p + z];
newPoint2.leftDirection = [l + w + p, h + w + p + z];
newPoint2.rightDirection = newPoint2.anchor;
newPoint2.pointType = PointType.CORNER;
var newPoint3 = myLine.pathPoints.add();
newPoint3.anchor = [((2 * l) + w) - z, h + w + z + p];
newPoint3.leftDirection = newPoint3.anchor;
newPoint3.rightDirection = [((2 * l) + w) - p, h + w + p + z];
newPoint3.pointType = PointType.CORNER;
var newPoint4 = myLine.pathPoints.add();
newPoint4.anchor = [(2 * l) + w, h + w + p];
newPoint4.leftDirection = newPoint4.anchor;
newPoint4.rightDirection = newPoint4.anchor;
newPoint4.pointType = PointType.CORNER;
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[l + w, h],
[l + w, h + w + p]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l, h],
[l + sx2, h + sx2],
[l + (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - sx2, h + sx2],
[l + w, h]
]);
line23.filled = false;
line23.stroked = true;
line23.strokeWidth = sw;
line23.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w, h + w + p]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w + sx2, h + sx2],
[(2 * l) + w + (2 * sx2), h + ((w + z + p) / 2)],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), h + ((w + z + p) / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2],
[(2 * (l + w)) - p, h]
]);
line25 = line21.duplicate();
line25.rotate(180);
line25.top = 0;
line25.left = ((2 * l) + w) - (sw / 2);
line26.filled = false;
line26.stroked = true;
line26.strokeWidth = sw;
line26.setEntirePath([
[l, 0],
[l + sx2, -sx2],
[l + (2 * sx2), -(w + z + p) / 2],
[(l + w) - (2 * sx2), -(w + z + p) / 2],
[(l + w) - sx2, -sx2],
[l + w, 0]
]);
line27 = line23.duplicate();
line27.rotate(180);
line27.top = 0;
line27.left = l + w + (-sw / 2);
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[(2 * l) + w, 0],
[(2 * l) + w + sx2, -sx2],
[(2 * l) + w + (2 * sx2), -(w + z + p) / 2],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), -(w + z + p) / 2],
[((2 * (l + w)) - p) - sx2, -sx2],
[(2 * (l + w)) - p, 0]
]);
line29 = myLine.duplicate();
line29.rotate(180);
line29.top = -p - w;
line29.left = (l + w) - (sw / 2);
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-0.25 * sx, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[-0.25 * sx, 0],
[0, 0],
[l, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array(0, h), Array(l, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
}
function lineFiveBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
var sx1 = 7 * pointTomm;
var sx2 = 3 * pointTomm;
var sx3 = 2 * pointTomm;
var sy1 = 5 * pointTomm;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2.5 * sx2;
sx3 = 2.5 * sx3;
sy1 = 2 * sy1;
} else {
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.5 * sy1;
}
}
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(l + w, h + p), Array((2 * l) + w, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[l + w + sx1, h + w],
[((2 * l) + w) - sx1, h + w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[l + w + sx1, 0 - w],
[((2 * l) + w) - sx1, 0 - w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[l + w, 0 - p],
[(2 * l) + w, 0 - p]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
var myLine = lineGroup2.pathItems.add();
myLine.filled = false;
myLine.stroked = true;
myLine.strokeWidth = sw;
var newPoint1 = myLine.pathPoints.add();
newPoint1.anchor = [l + w + p, h + w + p];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine.pathPoints.add();
newPoint2.anchor = [l + w + (2 * p) + z, h + w + p + z];
newPoint2.leftDirection = [l + w + p, h + w + p + z];
newPoint2.rightDirection = newPoint2.anchor;
newPoint2.pointType = PointType.CORNER;
var newPoint3 = myLine.pathPoints.add();
newPoint3.anchor = [(((2 * l) + w) - z) - p, h + w + z + p];
newPoint3.leftDirection = newPoint3.anchor;
newPoint3.rightDirection = [((2 * l) + w) - p, h + w + p + z];
newPoint3.pointType = PointType.CORNER;
var newPoint4 = myLine.pathPoints.add();
newPoint4.anchor = [((2 * l) + w) - p, h + w + p];
newPoint4.leftDirection = newPoint4.anchor;
newPoint4.rightDirection = newPoint4.anchor;
newPoint4.pointType = PointType.CORNER;
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[l + w, h],
[l + w, h + w + p],
[l + w + sx1, h + w + p],
[l + w + sx1, (h + w) - (2 * p)]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l + p, h],
[l + p, h + sy1],
[l + p + sx2, h + sx2 + sy1],
[l + p + (2.5 * sx2), h + ((w + z + p) / 2)],
[(l + w) - (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - sx2, h + sx2],
[l + w, h]
]);
line23.filled = false;
line23.stroked = true;
line23.strokeWidth = sw;
line23.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w, h + w + p],
[((2 * l) + w) - sx1, h + w + p],
[((2 * l) + w) - sx1, (h + w) - (2 * p)]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w + sx2, h + sx2],
[(2 * l) + w + (2 * sx2), h + ((w + z + p) / 2)],
[(((2 * l) + (2 * w)) - p) - (2.5 * sx2), h + ((w + z + p) / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2 + sy1],
[(2 * (l + w)) - p, h + sy1],
[(2 * (l + w)) - p, h]
]);
line25 = line21.duplicate();
line25.rotate(180);
line25.top = 0;
line25.left = (((2 * l) + w) - sx1) - (sw / 2);
line26.filled = false;
line26.stroked = true;
line26.strokeWidth = sw;
line26.setEntirePath([
[l + p, 0],
[l + p, -sy1],
[l + p + sx2, -sx2 - sy1],
[l + (2.5 * sx2), -(w + z + p) / 2],
[(l + w) - (2 * sx2), -(w + z + p) / 2],
[(l + w) - sx2, -sx2],
[l + w, 0]
]);
line27 = line23.duplicate();
line27.rotate(180);
line27.top = 0;
line27.left = l + w + (-sw / 2);
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[(2 * l) + w, 0],
[(2 * l) + w + p + sx2, -sx2],
[(2 * l) + w + (2 * sx2), -(w + z + p) / 2],
[(((2 * l) + (2 * w)) - p) - (2.5 * sx2), -(w + z + p) / 2],
[((2 * (l + w)) - p) - sx2, -sx2 - sy1],
[(2 * (l + w)) - p, -sy1],
[(2 * (l + w)) - p, 0]
]);
line29 = myLine.duplicate();
line29.rotate(180);
line29.top = -p - w;
line29.left = (l + w + p) - (sw / 2);
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[0, 0],
[l + p, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array(0, h), Array(l + p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
}
function lineSixBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
if (l <= w) {
alert("输入的长度必须大于宽度!自动调整长与宽", "错误");
a = l;
l = w;
w = a;
lineSixBox();
} else {
var sx1 = 7 * pointTomm;
var sx2 = 3 * pointTomm;
var sx3 = 2 * p;
var sy1 = 5 * pointTomm;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2.5 * sx2;
sx3 = 2.5 * sx3;
sy1 = 1.5 * sy1;
} else {
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.2 * sy1;
}
}
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(l + w, h + p), Array((2 * l) + w, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[l + w + sx1, h + w],
[((2 * l) + w) - sx1, h + w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[p, 0 - p],
[l - p, 0 - p]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[l + w + p, 0 - p],
[((2 * l) + w) - p, 0 - p]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
var myLine = lineGroup2.pathItems.add();
myLine.filled = false;
myLine.stroked = true;
myLine.strokeWidth = sw;
var newPoint1 = myLine.pathPoints.add();
newPoint1.anchor = [l + w + p, h + w + p];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine.pathPoints.add();
newPoint2.anchor = [l + w + (2 * p) + z, h + w + p + z];
newPoint2.leftDirection = [l + w + p, h + w + p + z];
newPoint2.rightDirection = newPoint2.anchor;
newPoint2.pointType = PointType.CORNER;
var newPoint3 = myLine.pathPoints.add();
newPoint3.anchor = [(((2 * l) + w) - z) - p, h + w + z + p];
newPoint3.leftDirection = newPoint3.anchor;
newPoint3.rightDirection = [((2 * l) + w) - p, h + w + p + z];
newPoint3.pointType = PointType.CORNER;
var newPoint4 = myLine.pathPoints.add();
newPoint4.anchor = [((2 * l) + w) - p, h + w + p];
newPoint4.leftDirection = newPoint4.anchor;
newPoint4.rightDirection = newPoint4.anchor;
newPoint4.pointType = PointType.CORNER;
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[l + w, h],
[l + w, h + w + p],
[l + w + sx1, h + w + p],
[l + w + sx1, (h + w) - (2 * p)]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l + p, h],
[l + p, h + sy1],
[l + p + sx2, h + sx2 + sy1],
[l + p + (2.5 * sx2), h + ((w + z + p) / 2)],
[(l + w) - (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - sx2, h + sx2],
[l + w, h]
]);
line23.filled = false;
line23.stroked = true;
line23.strokeWidth = sw;
line23.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w, h + w + p],
[((2 * l) + w) - sx1, h + w + p],
[((2 * l) + w) - sx1, (h + w) - (2 * p)]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w + sx2, h + sx2],
[(2 * l) + w + (2 * sx2), h + ((w + z + p) / 2)],
[(((2 * l) + (2 * w)) - p) - (2.5 * sx2), h + ((w + z + p) / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2 + sy1],
[(2 * (l + w)) - p, h + sy1],
[(2 * (l + w)) - p, h]
]);
line25.filled = false;
line25.stroked = true;
line25.strokeWidth = sw;
line25.setEntirePath([
[0, 0],
[sx2, -sx2],
[2 * sx2, -(w - (6 * p))],
[l - (2 * sx2), -(w - (6 * p))],
[l - sx2, -sx2],
[l, 0]
]);
line26.filled = false;
line26.stroked = true;
line26.strokeWidth = sw;
line26.setEntirePath([
[l, 0],
[l + sx2, -sx2],
[l + (2 * sx2), -(w + z + p) / 2],
[(l + w) - (2 * sx2), -(w + z + p) / 2],
[(l + w) - sx2, -sx2],
[l + w, 0]
]);
line27.filled = false;
line27.stroked = true;
line27.strokeWidth = sw;
line27.setEntirePath([
[l + w, 0],
[l + w + sx3, -sx3],
[l + w + (1.5 * sx3), -(w - p)],
[((2 * l) + w) - (1.5 * sx3), -(w - p)],
[((2 * l) + w) - sx3, -sx3],
[(2 * l) + w, 0]
]);
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[(2 * l) + w, 0],
[(2 * l) + w + p + sx2, -sx2],
[(2 * l) + w + (2 * sx2), -(w + z + p) / 2],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), -(w + z + p) / 2],
[((2 * (l + w)) - p) - sx2, -sx2],
[(2 * (l + w)) - p, 0]
]);
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[0, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array(0, h), Array(l + p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
}
}
function lineSevenBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
if (l <= w) {
alert("输入的长度必须大于宽度!自动调整长与宽", "错误");
a = l;
l = w;
w = a;
lineSevenBox();
} else {
var sx1 = 7 * pointTomm;
var sx2 = 3 * pointTomm;
var sx3 = 2 * p;
var sx4 = 28 * pointTomm;
var sy1 = 5 * pointTomm;
var sy2 = 8 * pointTomm;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2.5 * sx2;
sx3 = 2.5 * sx3;
sy1 = 1.5 * sy1;
} else {
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.2 * sy1;
}
}
if (l >= (110 * pointTomm)) {
sy2 = 2 * sy2;
sx4 = 2 * sx4;
}
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(l + w, h + p), Array((2 * l) + w, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[l + w + sx1, h + w],
[((2 * l) + w) - sx1, h + w]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[p, 0 - p],
[l - p, 0 - p]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[l + w + p, 0 - p],
[((2 * l) + w) - p, 0 - p]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
var myLine = lineGroup2.pathItems.add();
myLine.filled = false;
myLine.stroked = true;
myLine.strokeWidth = sw;
var newPoint1 = myLine.pathPoints.add();
newPoint1.anchor = [l + w + p, h + w + p];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine.pathPoints.add();
newPoint2.anchor = [l + w + (2 * p) + z, h + w + p + z];
newPoint2.leftDirection = [l + w + p, h + w + p + z];
newPoint2.rightDirection = newPoint2.anchor;
newPoint2.pointType = PointType.CORNER;
var newPoint3 = myLine.pathPoints.add();
newPoint3.anchor = [(((2 * l) + w) - z) - p, h + w + z + p];
newPoint3.leftDirection = newPoint3.anchor;
newPoint3.rightDirection = [((2 * l) + w) - p, h + w + p + z];
newPoint3.pointType = PointType.CORNER;
var newPoint4 = myLine.pathPoints.add();
newPoint4.anchor = [((2 * l) + w) - p, h + w + p];
newPoint4.leftDirection = newPoint4.anchor;
newPoint4.rightDirection = newPoint4.anchor;
newPoint4.pointType = PointType.CORNER;
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[l + w, h],
[l + w, h + w + p],
[l + w + sx1, h + w + p],
[l + w + sx1, (h + w) - (2 * p)]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l + p, h],
[l + p, h + sy1],
[l + p + sx2, h + sx2 + sy1],
[l + p + (2.5 * sx2), h + ((w + z + p) / 2)],
[(l + w) - (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - sx2, h + sx2],
[l + w, h]
]);
line23.filled = false;
line23.stroked = true;
line23.strokeWidth = sw;
line23.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w, h + w + p],
[((2 * l) + w) - sx1, h + w + p],
[((2 * l) + w) - sx1, (h + w) - (2 * p)]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w + sx2, h + sx2],
[(2 * l) + w + (2 * sx2), h + ((w + z + p) / 2)],
[(((2 * l) + (2 * w)) - p) - (2.5 * sx2), h + ((w + z + p) / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2 + sy1],
[(2 * (l + w)) - p, h + sy1],
[(2 * (l + w)) - p, h]
]);
line25.filled = false;
line25.stroked = true;
line25.strokeWidth = sw;
line25.setEntirePath([
[0, 0],
[sx2, -sx2],
[2 * sx2, -(w - (6 * p))],
[l - (2 * sx2), -(w - (6 * p))],
[l - sx2, -sx2],
[l, 0]
]);
line26.filled = false;
line26.stroked = true;
line26.strokeWidth = sw;
line26.setEntirePath([
[l, 0],
[l + sx2, -sx2],
[l + (2 * sx2), -(w + z + p) / 2],
[(l + w) - (2 * sx2), -(w + z + p) / 2],
[(l + w) - sx2, -sx2],
[l + w, 0]
]);
line27.filled = false;
line27.stroked = true;
line27.strokeWidth = sw;
line27.setEntirePath([
[l + w, 0],
[l + w + sx3, -sx3],
[l + w + (1.5 * sx3), -(w - p)],
[((2 * l) + w) - (1.5 * sx3), -(w - p)],
[((2 * l) + w) - sx3, -sx3],
[(2 * l) + w, 0]
]);
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[(2 * l) + w, 0],
[(2 * l) + w + p + sx2, -sx2],
[(2 * l) + w + (2 * sx2), -(w + z + p) / 2],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), -(w + z + p) / 2],
[((2 * (l + w)) - p) - sx2, -sx2],
[(2 * (l + w)) - p, 0]
]);
line29.filled = false;
line29.stroked = true;
line29.strokeWidth = sw;
line29.setEntirePath([
[0, h],
[0, h + w],
[l, h + w],
[l, h]
]);
var newPath11 = docRef.pathItems.roundedRectangle(h + ((2 * w) / 3), (l / 2) - (sx4 / 2), sx4, sy2, sy2 / 2, sy2 / 2);
newPath11.filled = false;
newPath11.stroked = true;
newPath11.strokeWidth = sw;
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[0, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array(l, h), Array(l + p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
}
}
function lineEightBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
if (l <= w) {
alert("输入的长度必须大于宽度!自动调整长与宽", "错误");
a = l;
l = w;
w = a;
lineEightBox();
} else {
var sx1 = 5 * pointTomm;
var sx2 = 3 * pointTomm;
var sx3 = 2 * pointTomm;
var sx4 = 5 * pointTomm;
var sx5 = 40 * pointTomm;
var sy1 = 5 * pointTomm;
var sy2 = 10 * pointTomm;
var z = sx;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2.5 * sx2;
sx3 = 2.5 * sx3;
sy1 = 1.5 * sy1;
} else {
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.2 * sy1;
}
}
if (l >= (200 * pointTomm)) {
sy2 = 3 * sy2;
sx5 = 3 * sx5;
} else {
if (l >= (110 * pointTomm)) {
sy2 = 2 * sy2;
sx5 = 2 * sx5;
}
}
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h],
[0, h + p],
[l, h + p]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(l + w, h + p), Array((2 * l) + w, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[l + w, h + (w / 2)],
[(2 * l) + w, h + (w / 2)]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[0, h + (w / 2)],
[l, h + (w / 2)]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[0, 0 - p],
[l, 0 - p]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[l + w + p, 0 - p],
[((2 * l) + w) - p, 0 - p]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
var myLine1 = lineGroup2.pathItems.add();
myLine1.filled = false;
myLine1.stroked = true;
myLine1.strokeWidth = sw;
var newPoint1 = myLine1.pathPoints.add();
newPoint1.anchor = [l + (w / 2), (sx3 + sx4) - ((3 * w) / 4)];
newPoint1.leftDirection = newPoint1.anchor;
newPoint1.rightDirection = newPoint1.anchor;
newPoint1.pointType = PointType.CORNER;
var newPoint2 = myLine1.pathPoints.add();
newPoint2.anchor = [l + (w / 2) + sx4, sx3 - ((3 * w) / 4)];
newPoint2.leftDirection = [l + (w / 2), sx3 - ((3 * w) / 4)];
newPoint2.rightDirection = newPoint1.anchor;
newPoint2.pointType = PointType.CORNER;
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[l + w, h],
[l + w, h + w],
[l + w + sx1, h + w],
[l + w + (2 * sx1), (h + w) - sx1],
[l + w + (3 * sx1), h + w],
[((2 * l) + w) - (3 * sx1), h + w],
[((2 * l) + w) - (2 * sx1), (h + w) - sx1],
[((2 * l) + w) - sx1, h + w],
[(2 * l) + w, h + w],
[(2 * l) + w, h]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l, h],
[l + sx2, h + sx2],
[l + p + (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - (2 * sx2), h + ((w + z + p) / 2)],
[(l + w) - sx2, h + sx2],
[l + w, h]
]);
var newPath11 = docRef.pathItems.roundedRectangle(h + ((3 * w) / 4) + (sy2 / 2), (l / 2) - (sx5 / 2), sx5, sy2, sy2 / 2, sy2 / 2);
newPath11.filled = false;
newPath11.stroked = true;
newPath11.strokeWidth = sw;
line23 = newPath11.duplicate();
line23.top = h + ((3 * w) / 4) + (sy2 / 2);
line23.left = (((3 * l) / 2) + w) - (sx5 / 2);
var newPath12 = docRef.pathItems.roundedRectangle(((h + ((w + z) / 2)) - sy1) + sx3, (l + (w / 2)) - ((3 * p) / 2), 3 * p, ((w + z) / 2) - sy1, (3 * p) / 2, (3 * p) / 2);
newPath12.filled = false;
newPath12.stroked = true;
newPath12.strokeWidth = sw;
var line232 = newPath12.duplicate();
line232.top = ((h + ((w + z) / 2)) - sy1) + sx3;
line232.left = ((2 * (l + w)) - ((w - p) / 2)) - ((3 * p) / 2);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w + sx2, h + sx2],
[(2 * l) + w + (2 * sx2), h + ((w + z + p) / 2)],
[(((2 * l) + (2 * w)) - p) - (2 * sx2), h + ((w + z + p) / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2],
[(2 * (l + w)) - p, h]
]);
line25.filled = false;
line25.stroked = true;
line25.strokeWidth = sw;
line25.setEntirePath([
[l + w, 0],
[l + ((3 * w) / 2), -w / 2],
[l + ((3 * w) / 2), (-3 * w) / 4],
[(2 * l) + (w / 2), (-3 * w) / 4],
[(2 * l) + (w / 2), -w / 2],
[(2 * l) + w, 0]
]);
line27.filled = false;
line27.stroked = true;
line27.strokeWidth = sw;
line27.setEntirePath([
[(2 * (l + w)) - p, 0],
[(2 * l) + ((3 * w) / 2), -w / 2],
[(2 * l) + ((3 * w) / 2), (sx3 - ((3 * w) / 4)) + sx4]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath([
[((2 * l) + ((3 * w) / 2)) - sx4, ((-3 * w) / 4) + sx3],
[(2 * l) + w, ((-3 * w) / 4) + sx3],
[(2 * l) + w, 0]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath1 = lineGroup2.pathItems.add();
newPath1 = myLine1.duplicate();
newPath1.rotate(90);
newPath1.top = (sx3 + sx4) - ((3 * w) / 4);
newPath1.left = ((2 * l) + ((3 * w) / 2)) - sx4;
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[l, 0],
[l + (w / 2), -w / 2],
[l + (w / 2), (sx3 - ((3 * w) / 4)) + sx4]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath([
[l + (w / 2) + sx4, ((-3 * w) / 4) + sx3],
[l + w, ((-3 * w) / 4) + sx3],
[l + w, 0]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
line29.filled = false;
line29.stroked = true;
line29.strokeWidth = sw;
line29.setEntirePath([
[0, 0],
[0, (-3 * w) / 4],
[w / 2, (-3 * w) / 4],
[w / 2, -w / 2],
[l - (w / 2), -w / 2],
[l - (w / 2), (-3 * w) / 4],
[l, (-3 * w) / 4],
[l, 0]
]);
line26.filled = false;
line26.stroked = true;
line26.strokeWidth = sw;
line26.setEntirePath([
[0, h],
[0, h + w],
[sx1, h + w],
[2 * sx1, (h + w) - sx1],
[3 * sx1, h + w],
[l - (3 * sx1), h + w],
[l - (2 * sx1), (h + w) - sx1],
[l - sx1, h + w],
[l, h + w],
[l, h]
]);
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[0, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
}
}
function lineNineBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
var sx1 = 5 * pointTomm;
var sx2 = 1.5 * pointTomm;
var sx3 = 2 * pointTomm;
var sx4 = 5 * pointTomm;
var sx5 = 40 * pointTomm;
var sy1 = 5 * pointTomm;
var sy2 = 10 * pointTomm;
var z = sx;
if (w >= (250 * pointTomm)) {
sx1 = 1.42857142857143 * sx1;
sx2 = 2.5 * sx2;
sx3 = 2.5 * sx3;
sy1 = 1.5 * sy1;
} else {
if (w >= (120 * pointTomm)) {
sx1 = 1.14285714285714 * sx1;
sx2 = 2 * sx2;
sx3 = 2 * sx3;
sy1 = 1.2 * sy1;
}
}
if (l >= (200 * pointTomm)) {
sy2 = 3 * sy2;
sx5 = 3 * sx5;
} else {
if (l >= (110 * pointTomm)) {
sy2 = 2 * sy2;
sx5 = 2 * sx5;
}
}
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[0, 0],
[0, h],
[0, h + p],
[l, h + p]
]);
line1.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(l + w, h + p), Array((2 * l) + w, h + p)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
newPath = lineGroup.pathItems.add();
newPath.setEntirePath([
[0, 0 - p],
[l, 0 - p]
]);
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.setEntirePath([
[l, h],
[l, 0],
[l + w, 0],
[l + w, h],
[l, h]
]);
line2.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[l + w, 0 - p],
[(2 * l) + w, 0 - p]
]);
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[(2 * (l + w)) - p, h],
[(2 * l) + w, h],
[(2 * l) + w, 0],
[(2 * (l + w)) - p, 0]
]);
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
var line29 = lineGroup2.pathItems.add();
var line20 = lineGroup2.pathItems.add();
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[l + w, h],
[l + w, h + (w / 2)],
[(2 * l) + w, h + (w / 2)],
[(2 * l) + w, h]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[l, h],
[l + sx2, h + sx2],
[l + sx2, h + (w / 2)],
[(l + w) - sx2, h + (w / 2)],
[(l + w) - sx2, h + sx2],
[l + w, h]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(2 * l) + w, h],
[(2 * l) + w + sx2, h + sx2],
[(2 * l) + w + sx2, h + (w / 2)],
[(((2 * l) + (2 * w)) - p) - sx2, h + (w / 2)],
[((2 * (l + w)) - p) - sx2, h + sx2],
[(2 * (l + w)) - p, h]
]);
line23 = line21.duplicate();
line23.rotate(180);
line23.top = 0;
line23.left = 0 - (sw / 2);
line25 = line22.duplicate();
line25.rotate(180);
line25.top = 0;
line25.left = l - (sw / 2);
line27 = line21.duplicate();
line27.rotate(180);
line27.top = 0;
line27.left = (l + w) - (sw / 2);
line28 = line24.duplicate();
line28.rotate(180);
line28.top = 0;
line28.left = ((2 * l) + w) - (sw / 2);
line26.filled = false;
line26.stroked = true;
line26.strokeWidth = sw;
line26.setEntirePath([
[0, h],
[0, h + (w / 2)],
[l, h + (w / 2)],
[l, h]
]);
line20.filled = false;
line20.stroked = true;
line20.strokeWidth = sw;
line20.setEntirePath([
[0, h],
[-sx, h - (sx * Math.tan(0.0833333333333333 * Math.PI))],
[-sx, sx * Math.tan(0.0833333333333333 * Math.PI)],
[0, 0]
]);
newPath = lineGroup2.pathItems.add();
newPath.setEntirePath(Array(Array((2 * (l + w)) - p, 0), Array((2 * (l + w)) - p, h)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
}
function lineTineBox() {
docRef.defaultStrokeColor = docRef.swatches[regColorIndex].color;
var sx1 = 26 * pointTomm;
var sx3 = 2 * p;
var sy1 = 3 * pointTomm;
var w2 = w - (2 * p);
var sx5 = myDialog.mySxsetEdittext.text * pointTomm;
if (w >= sx1 || sx5 < (12 * pointTomm) || sx5 > (12 * pointTomm)) {
sx1 = Math.ceil(((w + (2 * p)) * Math.tan(0.166666666666667 * Math.PI)) + sx5);
}
var sx2 = h - sx1;
var sx = ((w2 + (2.5 * p)) * Math.tan(0.166666666666667 * Math.PI)) + sx2;
var lineGroup = docRef.groupItems.add();
lineGroup.stroked = true;
lineGroup.strokeWidth = sw;
var lineGroup2 = docRef.groupItems.add();
var line1 = lineGroup.pathItems.add();
var line2 = lineGroup.pathItems.add();
var line3 = lineGroup.pathItems.add();
var line4 = lineGroup.pathItems.add();
var line5 = lineGroup.pathItems.add();
var line6 = lineGroup.pathItems.add();
line1.filled = false;
line1.stroked = true;
line1.strokeWidth = sw;
line1.setEntirePath([
[sx + w, w2],
[sx + w, l + w2]
]);
line1.strokeColor = docRef.swatches[4].color;
line2.filled = false;
line2.stroked = true;
line2.strokeWidth = sw;
line2.strokeColor = docRef.swatches[4].color;
line2.setEntirePath([
[h + sx + w, w2],
[h + sx + w, l + w2]
]);
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array((h + sx + w) - sx5, w2), Array((h + sx + w) - sx5, l + w2)));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line3.filled = false;
line3.stroked = true;
line3.strokeWidth = sw;
line3.strokeColor = docRef.swatches[4].color;
line3.setEntirePath([
[(h + sx + (2 * w) + sx1) - sx3, w2],
[h + sx + (2 * w), w2],
[h + sx + (2 * w), l + w2],
[(h + sx + (2 * w) + sx1) - sx3, l + w2]
]);
newPath = lineGroup.pathItems.add();
newPath.setEntirePath(Array(Array(h + sx + (2 * w) + sx1, w2 + (3 * p)), Array(h + sx + (2 * w) + sx1, (l + w2) - (3 * p))));
newPath.filled = false;
newPath.stroked = true;
newPath.strokeWidth = sw;
newPath.strokeColor = docRef.swatches[4].color;
line4.filled = false;
line4.stroked = true;
line4.strokeWidth = sw;
line4.strokeColor = docRef.swatches[4].color;
line4.setEntirePath([
[sx + w, 0],
[sx + w, w2 + p],
[sx + w + h, w2 + p],
[sx + w + h, 0]
]);
line5.filled = false;
line5.stroked = true;
line5.strokeWidth = sw;
line5.strokeColor = docRef.swatches[4].color;
line5.setEntirePath([
[sx + w, l + (2 * w2)],
[sx + w, (l + w2) - p],
[sx + w + h, (l + w2) - p],
[sx + w + h, l + (2 * w2)]
]);
line6.filled = false;
line6.stroked = true;
line6.strokeWidth = sw;
line6.strokeColor = docRef.swatches[4].color;
line6.setEntirePath([
[(sx - sx2) - p, w2],
[sx, w2],
[sx, l + w2],
[(sx - sx2) - p, l + w2]
]);
var line21 = lineGroup2.pathItems.add();
var line22 = lineGroup2.pathItems.add();
var line23 = lineGroup2.pathItems.add();
var line24 = lineGroup2.pathItems.add();
var line25 = lineGroup2.pathItems.add();
var line26 = lineGroup2.pathItems.add();
var line27 = lineGroup2.pathItems.add();
var line28 = lineGroup2.pathItems.add();
line21.filled = false;
line21.stroked = true;
line21.strokeWidth = sw;
line21.setEntirePath([
[0, 0],
[((sx + w + h) - sx5) - (w2 * Math.tan(0.194444444444444 * Math.PI)), 0],
[(sx + w + h) - sx5, w2]
]);
line22.filled = false;
line22.stroked = true;
line22.strokeWidth = sw;
line22.setEntirePath([
[0, l + (2 * w2)],
[((sx + w + h) - sx5) - (w2 * Math.tan(0.194444444444444 * Math.PI)), l + (2 * w2)],
[(sx + w + h) - sx5, l + w2]
]);
line23.filled = false;
line23.stroked = true;
line23.strokeWidth = sw;
line23.setEntirePath([
[0, 0],
[sx - sx2, w2 + (2.5 * p)],
[sx - sx2, (l + w2) - (2.5 * p)],
[0, l + (2 * w2)]
]);
line24.filled = false;
line24.stroked = true;
line24.strokeWidth = sw;
line24.setEntirePath([
[(sx + w + h) - sx5, w2 + sy1],
[(sx + w + h) - sx5, w2],
[((sx + w + h) - sx5) - (w2 * Math.tan(0.138888888888889 * Math.PI)), 0],
[sx + (2 * w) + h, 0],
[sx + (2 * w) + h, w2],
[(sx + w + h) - p, w2]
]);
line25.filled = false;
line25.stroked = true;
line25.strokeWidth = sw;
line25.setEntirePath([
[(sx + w + h) - sx5, (l + w2) - sy1],
[(sx + w + h) - sx5, l + w2],
[((sx + w + h) - sx5) - (w2 * Math.tan(0.138888888888889 * Math.PI)), l + (2 * w2)],
[sx + (2 * w) + h, l + (2 * w2)],
[sx + (2 * w) + h, l + w2],
[(sx + w + h) - p, l + w2]
]);
line26.filled = false;
line26.stroked = true;
line26.strokeWidth = sw;
line26.setEntirePath([
[sx + (2 * w) + h, 0],
[(sx + (2 * w) + h + sx1) - ((w2 + (4 * p)) * Math.tan(0.166666666666667 * Math.PI)), 0],
[sx + h + (2 * w) + sx1, w2 + (3 * p)],
[sx + (2 * w) + h + sx1 + z, w2 + (3 * p)],
[sx + (2 * w) + h + sx1 + z, (l + w2) - (3 * p)],
[sx + (2 * w) + h + sx1 + z, (l + w2) - (3 * p)],
[sx + h + (2 * w) + sx1, (l + w2) - (3 * p)],
[(sx + (2 * w) + h + sx1) - ((w2 + (4 * p)) * Math.tan(0.166666666666667 * Math.PI)), l + (2 * w2)],
[sx + (2 * w) + h, l + (2 * w2)]
]);
line27.filled = false;
line27.stroked = true;
line27.strokeWidth = sw;
line27.setEntirePath([
[sx, 0],
[sx, w2],
[sx + w + p, w2]
]);
line28.filled = false;
line28.stroked = true;
line28.strokeWidth = sw;
line28.setEntirePath([
[sx, l + (2 * w2)],
[sx, l + w2],
[sx + w + p, l + w2]
]);
}
myDialog.close();
}
}
合理的脚本代码可以有效的提高工作效率,减少重复劳动。
欢迎光临知了软件开发网络平台,本公司定制开发各类软件,主要方向为桌面专业软件开发和插件定制开发,桌面软件主要包括文字图形识别类软件,信息管理类软件,3D打印类软件,视频类软件以及其它涉及专业的各类图形图像处理软件。插件包含AE插件,AI插件,PS插件,PDF插件,3DMAX插件以及Word,Excel等Office插件开发。详情请咨询,微信QQ:312117271,手机:18928899728,邮箱: anjingzhi_sea@163.com.
公司网址:http://www.zhiliaos.com
标签:newPath,插件,illustrator,--,sw,sx2,add,var,pathItems 来源: https://blog.csdn.net/weixin_42247427/article/details/110880669