Copy link to clipboard
Copied
Hello,
at first sorry for my bad english.
I use my script to embeding a placed graphic (MyImage.embed();). Then I always get a group with the correct paths and two clipping paths in a grouped grouped groupItem.
My question is:
I want to delete the two clipping paths to get only the correct paths of the graphic. Does anyone know the best way?
Thanx for your help.
<edit>
This is, what I always have:
and this is, what i want:
Copy link to clipboard
Copied
Your example looks straight forwatd enough for you to loop the group and remove() items property whose clipping is true… Im almost certain you will get the same issue with groupItems.createFromFile() as place() then embed() as you test your pathItems move to parent layer… What you want can become very complex depenent on what your placing? Is it *.ai or *.pdf?
Copy link to clipboard
Copied
Hello Muppet Mark, Thanks for your reply.
Mostly I put *. Ai or eps rare. There are only simple graphics.
I already suspected that a loop through the Items of the graphics is likely to be "the method of choice", but unfortunately elsewhere in the script several loops through larger groups are required. The script becomes quite slow.
So I'm looking for alternatives. I will try your suggestion groupItems.createFromFile () and then sign up again. (This command was previously unknown to me)
Copy link to clipboard
Copied
Okay,
createsFromFile() gives the same grouped grouped groupItem with also two clipping paths. Nevertheless, this seems to be the more direct route. Thank you.
Probably I need in any case to loop through items to delete the clipping Paths? Is that so?
Copy link to clipboard
Copied
I thougth groupItems.createFromFile() resulted in the same thing… The other alternative is to open the *.ai or *.eps files and duplicate the required art from on doc to another… Clunky again but may be better the more complex the art gets… You look to be doing things the right way and I don't know of any other methods to avoid this…
Copy link to clipboard
Copied
A little update.
@ Muppet mark, your two answers were helpful, but now I am afraid to try another way.
The main script needs to run on several computers, so it is not good to distribute many more files. I have written to me for each file a function that draws the paths. This is probably the best way for me.
I thank you again for your answers.
regards
Copy link to clipboard
Copied
You can store an Array of pathPoints in your script if you need to… then use setEntirePath() method.
I have not looked at this just yet but sounds like what you are wanting to do…
http://www.behance.net/gallery/Trace-vector-to-script-Illustrator-scripts-CS3-and-up/806397
Copy link to clipboard
Copied
Hello Muppet Mark,
I have completed my script before half a week. That's why your link was unfortunately a few days too late for me.
Nevertheless seems linked script to the behance.net page to allow a much more comfortable reading and passing the path point locations in a *. jsx file. Maybe I sign on the page and test the script.
Greetings pixxxelschubser
Copy link to clipboard
Copied
in your picture, what's "MyImage", a group or a layer? either way, I think your only option is to loop thru your pageItems in the second "group" and take them all out and put them somewhere (in "MyImage" maybe), except if they are the actual clipping paths you're trying to delete...then delete the group with the remaining clipping paths.
in this example, I'm just showing how to delete the clipping paths, this will leave you with the wanted paths still inside the group, you'll still need to "ungroup".
my sample was only one group deep, unlike your sample wich is two groups deep.
before
after
var idoc = app.activeDocument;
var clip = [];
var igroup = idoc.groupItems[0];
for (i=0; i<igroup.pathItems.length; i++) {
var ipath = igroup.pathItems;
if (ipath.clipping) {
clip.push(ipath);
}
}
for (j=0; j<clip.length; j++) {
clip
.remove(); }
Find more inspiration, events, and resources on the new Adobe Community
Explore Now