Copy link to clipboard
Copied

Hi,
I'm a begginer in scripting. And the above are the symbols i'm having. And i want to arrange these symbols as below in two layers. 1st layer should contains symbols which are color and another layer contains whites.

And i want the file name should be displayed in right bottom of the illustrator file. The purpose of the white area is cutting the symbols for printing.
Can anyone suggest and help me to do this task?
Sorry for my poor english!!
-Thanks,
Rajesh.
Copy link to clipboard
Copied
Hi Rajesh,
Could you make clarely some points ?
1- you use "symbol" word as reference (there are symbol in illustrator, and it's specifics to illustrator), but i think that you mean "shapes" or geometrics form, i'm right ?
2- have you in first time only colored shapes and after you will make the white shapes OR have you the both white and colored mixed in same document ?
3 - If you would make it by hand, what is your process ?
4- how many shapes have you ?
5 - are there two(or more) differents shapes with same color ?
I notice that you have curious process for cutting, indeed when i make a stikers, i use a pentone in overprint (allows to factory to make a new layer) to make die-cut (see my exemple)

If i understand fine your problem, may be i can help you.
cya, art.chrome.
Copy link to clipboard
Copied
Hi artchrome,
Thanks for your reply.
1- Its(Symbol) not specific to illustrator. and yes, u r right. I meant shapes or geometric form only.
2- I'm having the colored shapes and i have to fill white in that colored shapes and add stroke 2 or 3 points and keep in seperate layer.
3-
4-There may be N number of shapes in different color and/or same color.
5-
Actually, the white layer is for light cutting. i mean that area will be transparent, so that light passes through that area
Ok... I ll explain u properly.
Below image is the Empty sheet given to arrange shapes:

and below is the shape inputs

And we should place the symbols as per details given in excel sheet.
Currently i'm manually placing the symbols in particular order which is given in excel sheet.

After placing the shapes, i have to create whites layer by filling that shapes with white and i should add stroke with the size 3points as below in seperate layer.

And finally i have to add the file name and date to right bottom corner of the file(Ex:Cutting_033110).
My question is; i want to automate following above process.
Can u help me to write a script?
And also want to know, is there any way to access excel sheet data and arrange according to that?
-Rajesh.
Copy link to clipboard
Copied
Hi Rajesh,
ok for light cutting, i understand now ![]()
may be you can use this following way (it's a little bit "barbarian mode"
😞
First, prepare a gauge (a based model) which include all shape named, for exemple
1' layer : yellow star (here may be you can use the same name used in excel sheet)
2' layer : red bone
3' layer : green star
X' layer : something colored
put excel sheet in Array() like this :
var myLists = new Array();
myLists="yellow star;red bone;red bone...." <= from excel sheet converted to CSV with semi coma
var myContentList=MyLists.split(";");
after that, we can call each one by : myDoc.layers.getByName(myContentList[count]) .. where myDoc is app.activeDocument
and duplicate at fisrt position over black square on an another named layer (previously created by: myDoc.add(); layers.name="myNewLayer";)
make it in white with 2 or 3 pt stroke
duplicate again on same position without change color
increase count
change position
... repeat all
what do you about it ?
Copy link to clipboard
Copied
Rajesh, You should be able to save your 'Excel' workbook or whatever they call them to CSV or TDT file. From this you can as Art Chrome has pointed out read this text file by script and place your Symbol Shapes to a grid position. Have you actually made Illustrator 'Symbols' of these items? Once you have done all this in your first layer then you can make a new layer duplicate all the object from one to the other fill white stroke white. Here is the latter part of this as example.
#target illustrator
function shapeCutter() {
if (app.documents.length == 0) {
alert('Please have an "Illustrator" document open before running this script.');
return;
}
var docRef = app.activeDocument;
with (docRef) {
var white = swatches.getByName('White').color;
var colorLayer = layers[0]
var colorItems = colorLayer.pathItems;
var whiteLayer = layers.add();
whiteLayer.move(colorLayer, ElementPlacement.PLACEAFTER);
for (var i = 0; i < colorItems.length; i++) {
colorItems.duplicate(whiteLayer, ElementPlacement.PLACEATEND)
}
for (var j = 0; j < whiteLayer.pathItems.length; j++) {
whiteLayer.pathItems
Copy link to clipboard
Copied
Special thanks to art chrome and muppet mark. ![]()
I'm getting into it. Both of ur replies helped me a lot.
Thanks for ur script muppet mark.
Actually i made that shapes into symbols. Bcoz if there is any correction over the shapes we can change that in one place, right?
For that i'm using symbols.
Thanks,
-Rajesh
Copy link to clipboard
Copied
Correct, if you have a piece of art containing many symbol instances it is much easier later to use redefine symbol and have it modify the art through out. Although Im not sure if that can be scripted would have to check on that. The other thing I would recommend doing depending on your situation is when creating your symbols use a transparent (no fill/no stroke) square at the back of the shape. This just makes it easier on the old math when placing in a grid.
Copy link to clipboard
Copied
Actually, the white layer is for light cutting. i mean that area will be transparent, so that light passes through that area
If the purpose of the white is only to result in transparent areas when printing (not cutting), why does all the white have to be on a separate Layer? White objects in Illustrator do not print. A white fill or stroke simply means "non-image area" or "paper color."
So if that's the case, the white stroke could simply be included in the artwork of your Symbols. Draw the path. Give it a fill. Give it a white stroke. In the Appearance Palette, drag the stroke to below the fill. Convert the path to a Symbol.
If, on the other hand, the white is intended to provide an actual cutting path (as for a knife plotter), then a Stroke is not going to do the job; you'll need an offset path (and possibly a slightly inset path to provide a "bleed" if the colored fill is to be cut also).
Since Illustrator provides multiple-object level (Group, TextFrame) settings for strokes and for live Effects (like offset path), and the ability to "expand" such constructs to simple paths, I don't yet see why you need separate white objects corresponding to each of your shapes. You could probably generate the white cut paths using a macro (Actions) rather than a script.
Even if the white objects do need to be on a separate Layer, that should be a simple matter of duplicating the original colored objects, applying a Graphic Style to the duplicate, and sending it to its own Layer. Again, that's just normal UI stuff that can be automated with an Action.
I might also be inclined to take another route for the spreadsheet-to-Symbols portion. For example: Assuming this is a recurring kind of project, and assuming the shapes are represented in the spreadsheet as alpha-numeric values, using a font editor to create a custom dingbat font would let you simply copy/paste the tab-delimited text from the spreadsheet into Illustrator, and the whole thing would remain an editable text object unless/until you decided to convert it to paths. The color could be applied at the character level by either using Find/Replace in conjunction with Character Styles or Graphic Styles, or by a script that does essentially the same thing.
You have three shapes and eight colors. Both color and font can be applied in either Illustrator or in a spreadsheet program:

If you're using Excel for the spreadsheet (or FileMaker for the database), you can use Conditional Formatting to automatically apply the color and/or font based on the cell's value.
JET
Find more inspiration, events, and resources on the new Adobe Community
Explore Now