: Frame around the selected area to the script in Illustrator var idoc = app.activeDocument; var sel = idoc.selection; var blk_color = new CMYKColor(); blk_color.cyan = 100; for (i=0;
var idoc = app.activeDocument;
var sel = idoc.selection;
var blk_color = new CMYKColor();
blk_color.cyan = 100;
for (i=0; i<sel.length; i++)
{
var pgItem = sel[i];
var bounds = pgItem.geometricBounds;
var ipath = idoc.pathItems.rectangle
(pgItem.position[1],
pgItem.position[0],
pgItem.width,
pgItem.height);
ipath.stroked = true;
ipath.strokeColor = blk_color;
ipath.filled = false;
ipath.strokeWidth = 5;
ipath.strokeDashes = [10];
}
More posts by @Reiling762
1 Comments
Sorted by latest first Latest Oldest Best
The rectangle method of pathItems takes the parameters (top,left,width,height) so all you need to do is offset those values accordingly.
Illustrator works exclusively with points so you need to convert the value from mm to points. 2.834645 points = 1 millimeter so...
15mm = 42.52point (rounded to 2 decimal places)
This should work:
var ipath = idoc.pathItems.rectangle(
pgItem.position[1]+42.52,
pgItem.position[0]-42.52,
pgItem.width+85.04,
pgItem.height+85.04);
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.