Illustrator CS4 javascript
how blends used in document being created in document follows select object->blends->make
hi,
you can see "compoundpathitem properties" & "compoundpathitems" in adobe illustrator cs4 scripting reference javascript.
selecting paths in document
// selects paths not part of compound path
if ( app.documents.length > 0 ) {
doc = app.activedocument;
count = 0;
if ( doc.pathitems.length > 0 ) {
thepaths = doc.pathitems;
numpaths = thepaths.length;
for ( = 0; < doc.pathitems.length; i++ ) {
pathart = doc.pathitems[i];
if ( pathart.parent.typename != "compoundpathitem" ) {
pathart.selected = true;
count++;
}
}
}
}
creating , modifying compound path item
// creates new compound path item containing 3 path
// items, sets width , color of stroke
// items in compound path
if ( app.documents.length > 0 ) {
doc = app.activedocument;
newcompoundpath = doc.activelayer.compoundpathitems.add();
// create path items
newpath = newcompoundpath.pathitems.add();
newpath.setentirepath( array( array(30, 50), array(30, 100) ) );
newpath = newcompoundpath.pathitems.add();
newpath.setentirepath( array( array(40, 100), array(100, 100) ) );
newpath = newcompoundpath.pathitems.add();
newpath.setentirepath( array( array(100, 110), array(100, 300) ) );
// set stroke , width properties of compound path
newpath.stroked = true;
newpath.strokewidth = 3.5;
newpath.strokecolor = app.activedocument.swatches[3].color;
}
ciao, art.chrome
More discussions in Illustrator Scripting
adobe
Comments
Post a Comment