Making objects in a compound path then the clip

Hey everyone, I'm pretty new to Java and Illustrator, so any help would be appreciated.

I'm trying to set up a script that will retrieve a group of objects and turn them into a compound path, and then apply a clipping for the trace mask and the next group to the layer.

for this snippet, I typed the letter 'o', he described and separated with a unique path, then I drew a narrow rectangle through the O, no line, black fill. The rectangle selected, run the script

var idoc = app.activeDocument;
var cp = idoc.compoundPathItems[0]; // the topmost existing compound path
var sel = idoc.selection[0]; // select the path you wish to add to the existing compound path

sel.move (cp, ElementPlacement.PLACEATBEGINNING); // move selected path inside the compound path
sel.evenodd = true; // necessary to determine "insideness" or to make holes.

Tags: Illustrator

Similar Questions

  • A tap above an object can be used to make the clip through the object?

    A tap above an object can be used to make the clip through the object?  So that transparency can see through the object.


    I have a square that has a line above it.  I would like to see the transparent background behind the square in the area occupied by STROKE. Example below:

    Transparent.jpg

    I would like the white area (which was created using the Brush tool and applying a stroke) to display the transparent background behind the red square - or whatever that fall behind the place.


    I have read and tried many tutorials and suggestions on the forum without success. (Group of knockouts, mask opacity, etc...)  I even created a much simpler red square with an accident stroke by default and still unable to get transparency through red square.


    I'm probably just missing something.


    Is this possible using a stoke?  Anyone able to help?


    Thank you

    -Chris

    Or:

    Stroke (s) select 0) and Ctrl + G for group races if more than one,

    (1) with the stroke (s) selected object > decompose the aspect, and

    (2) with all selected Pathfinder > Subtract from shape area / less Front according to version.

  • A compound path to access/clipping mask, or something else?

    Hello

    Basically, I'm changing this.

    in a mouth with teeth.

    I am trying to get rid of the surplus lines and leave the black lines in the white space.

    I've tried highlighting all and make a mask of clipping and even with the compound path, and it does not produce the results that I need. Does anyone have an idea what to do?

    Thank you

    Sally

    Hi Sally,

    Using a mask, he would do what you want.

    Select all the black lines and group them (Ctrl + G).

    Then duplicate the white object Ctrl + C (copy) and paste Ctrl + F (stick it in place), make sure that the duplicate is in the front.

    Then by selecting the black lines, you can see and the white shape/object that you have brought to the front (now shift), press Ctrl + 7 (mask) and you will get the result you want.

    Let us know how you get on?

    Edit: Quick help Video:

  • Change a path of the clip

    I have one clip inside the other and I want to move it to another clip

    Is this possible?

    Ya I know.
    Humm. I knew it was impossible, but I hope that someone could...

    This should be a great property to be added in the future AS version.
    Tanx well...

  • Connecting two points on the compound path

    Hi guys,.

    First time posting and had a little research but could not know what I needed - forgive me if the answer is and I am looking with the wrong keywords!

    I'm trying to change a font, that I turned into an object. I don't want the tail down to cross during the rest of the letter and I want also to shorten the tail, so I want to join paths, so I can modify it all as one. If you look at the pictures, I'm hoping to join them at the pink line; the second image shows the current paths.

    He is currently a compound path, if that makes a difference.

    Is it possible to get this happening, or is my best bet to trace it?

    Thank you!

    Illustrator.PNG

    illustrator2.PNG

    tashacarolina,

    IF I (put) understand it, if you initially return a compound path, then:

    (1) with the line Segment tool ClickDrag between Anchor Points where you would like the tail to be cut, then object > path > divide objects below, then a compound path output if necessary (unlikely);

    Now you have a simple path;

    (2) cut the ponytail where you want and remove the line to the main part.

    (3) you can adjust the shape of the tip where you cut in 1), if you want to curve.

  • Apply the compound path

    Hello

    I had a problem to apply a compound path in a row group. I want the place before green ' to cut a square hole"orange so that all background is seen under the lines. Please take a glance at my screen turned to a better understanding. Thank you.

    compound path.jpg

    David,

    You can either,.

    (1) create a rectangle that is larger than the Group of line,

    (2) select the rectangle and the square and the object > compound path > make.

    (3) select the compound path and the Group of curves and object > clipping mask > make.

    or

    (1) change the color of the black square,

    (2) select the square and the line group and in the transparency palette dialog box click the opacity with Clip mask and mask Invert unchecked.

  • Make a group of clipping with a compound path

    So, as of today, I am new to scripting for Illustrator, I use the ExtendScript Toolkit. However, I am not new to my own script solutions and I do not have any experience with JavaScript.

    What I'm trying to do is the following: for all selected items-> duplicate selected item and make a group of simple clipping with it

    What I'm left with visually does not change the picture, but gives me a lot of clipped colored areas that I then can I change in isolated mode, which allows me good shading faster and better. That the doing by hand takes hours on some pictures, it would take a second with a script.

    The script itself is already works for normal PathItems. As evident in the title, as soon as I have to apply the same thing to CompundPathItems things stop working. My question is a bit like this old thread [problem with clipping path transparent], but I couldn't find a solution because I get different behavior.

    When I run the same script that works perfectly with the normal PathItems with CompoundPathItems I get this: 9046 error: the top element in the group must be a path element to create a mask

    Well, it's a problem. There is absolutely no difference between making a clipping with a simple path mask and a compound path in the GUI. Frankly reference guide not helped with this problem at all, the only thing that I learned from it is that the CompoundPathItem object is an attribute of cutting, but those included PathItems.

    Here's what I have so far:


    If ([i] selected. TypeName == 'PathItem') {}
    newGroup var = doc.groupItems.add ();
    copy is selected [i] .duplicate (newGroup, ElementPlacement.PLACEATEND);.
    Selected [i] .moveToBeginning (newgroup);
    newGroup.clipped = true;

    }

    As I said, this part is exactly what it is supposed to do for normal paths.

    For CompoundPaths, I use this work around.

    If ([i] selected. TypeName == 'CompoundPathItem') {}
    newGroup var = doc.groupItems.add ();
    copy is selected [i] .duplicate (newGroup, ElementPlacement.PLACEATEND);.
    Selected [i] .moveToBeginning (newgroup);
    compoundItems = selected [i] .pathItems;
    compoundIndex = compoundItems.length;
    for (f = 0; f < compoundIndex; f ++) {compoundItems [f] .clipping = true ;}
    var lineList = new array (10);
    for (l = 0; l < lineList.length; l ++) {lineList [l] = new Array (I * 10 + 50, ((i-5) ^ 2) * 5 + 50) ;}}
    newPath = app.activeDocument.pathItems.add ();
    newPath.setEntirePath (lineList);
    newPath.moveToBeginning (newGroup);
    newGroup.clipped = true;
    newPath.remove ();

    Mind you, this workaround works in so far that it ignores that annoying error and evil and composite clipping path also works with the only problem being that created composite clipping path as it is always displayed in its original colours in the layers section and is always selectable. When I lock the composite clipping path I can work with it, but still...

    So the question is, what am I missing here? Surely, there must be a good way to do this.

    app.executeMenuCommand ()? That is me away so far, might be just the right thing. I will definitely take a look, now just to find a ref about it, because unfortunately official documents Ref I do not mention this command. Any place with a list of possible commands?

    Ah, also of course I only do for the isolation mode. If you care to hear the background, it is here:

    As I said it's for photos of shading, I'm working on. I repeated and tried through a bunch of techniques. For example, gradient mesh on my first few true works. Now these cracks don't do well with complex shapes, which previously I mitigated by using a simple square or rectangle gradient mesh and using the original form as a color clipping mask. It worked, but it was a huge field of work.

    After a lot of attempts that I went to the use of simple gradients as a background for the form, and then I do the shading freehand with the blob Brush tool, using a graphic style and filters to make it look like to the right. Is better, but do it right all the clipping masks takes me much more time than anything else.

    Now the problem is that shading is not supposed to cross the lines, it's impossible to do correctly without messing up the order, either using clipping masks, where the script. Because you know, if you use a form of the task with a strong Gaussian blur near the lines, you'll find yourself with stuff on both sides. If you do not start close to the line that the shading will be not look right if the darker the shade needs to be close to the line. And that's where magic of clipping masks.

    And finally, here's an example of how I work with the script and the result:

    After that I drew a sketch, adjust the line widths and at the neatness I turn the paths to sketch the lines and then turn them into a live paint Group (which would ruin the line widths, unless you put the paths in first contour lines).

    With this live paint group need me a few minutes to color my piece dish. Then I develop the live paint group, in case of doubt, spend a few more minutes to make transparent traces of all regions, I need the shadow in one piece, and then I select all areas and use my script to activate the neat clipping masks. Then I can click on any field, enter the isolation mode, and go up one level, so I'm in the appropriate group, where I can shadow freely without the problem beyond the lines.

    At the end which allows me to apply shading complex and comprehensive, without wasting time to get there.

    PS: well, I just found out that draw inside is really close to what I want to do, and oddly enough, it produces the same Visual discrepancy with transparent traces that produces my script. I'll take a closer look that, while my script is a little more than just the stuff of clipping mask, so maybe I'll go for a hybrid solution. Everything that makes for a better workflow.

  • cut out a shape with compound path?

    Hello Cs6 here... I'm trying to cut out a simple shape to allow the area as transparent or Alpha. As a mask. Except when I use the mask for this, he must make and mask the area where is the shape and hide or delete areas not covered by the mask. I tried the compound path, but I don't get any results from it. My form remains just above my work and do not "cut out" to allow the background shine as an alpha channel. See photos for more clarity please. No matter what specific path or steps would be appreciated.

    Thanks in advance.

    NORTH CAROLINAshapeaway.PNGmask cut.PNG

    I want to reverse this trend where the circle is cut off and the rest remains visible...

    NORTH CAROLINA,

    In the second image of the OP, you have placed at the ellipse, and then you have made an object > clipping mask > make.

    Instead, you can simply select the ellipse and the work and transparency palette flyout > make opacity mask and she, with a reverse mask for a white ellipse.

    Or instead, you can:

    (1) create a rectangle that extends beyond the work behind the ellipse;

    (2) select the ellipse and the rectangle and object > compound path > make;

    (3) select the compound path and the work and the object > clipping mask > make.

  • Help! Can't make a compound path!

    I am an experienced user of FreeHand and feel like a guy blind in a maze trying to use Illustrator! I'm redrawing the Logo of the Realtor who is a simple square, and inside which are a rectangle, triangle and an arc with a flat edge on the left. When combined, resemble the letter R reversed on a black box. When I select all the elements and tell him to make a compound path, only the rectangle knocks out the place of the background and the semicircle and the triangle just appear grouped with the square instead of knocked out! I tried everything, including moving the square to the front and the back, etc. How do you find if the semicircle that I drew is a closed path? I did the half circle by drawing a circle and a square and then using pathfinder to edit them in a sharp left flat circle. The triangle, I've simply drawn with the pen tool. I'm lost in this program!

    Duffer,

    You can do this way:

    Select all three forms in front and the place and the Pathfinder > less before.

  • Compound path

    Hi all

    I humbly ask for help to create a compound path on the way to "S" like some of its area is not done correctly. I want the red circle to be 'empty' instead of green. Advice and assistance is greatly appreciated.

    compound path.jpg

    You're welcome, David.

  • What is the difference between object &gt; contour line, Object &gt; expand... and oppose &gt; Compound Path/do?

    Could someone explain the differences between these three commands? I created a circle with a stroke, applied all the three commands and ended up with the same thing, a compound path. Are there situations where this is not the case, or situations where one of these commands is more appropriate?

    Cleveland,

    In the case of the accident vascular cerebral/nofill right, object > describe vascular accidents, cerebral and object > expand seem to do the same thing.

    In the layers palette, you can see three different results to develop if you have so much background and outline ticked, ticked off just about fill, and only STROKE checked. Only the last corresponds to the contour line.

    You use Outline Stroke that more simple if it's what you need. Trace to create something with one or more holes of several paths, either to raise subsidized the Clipping Path of a clipping mask paths. Expand is for the rest.

  • I'm taking a vector object, say a flower, compensate for a path, then get a vector path around the outside edge of the offset.  I take my flower, add a line, compensate for this trait, then select Add to Pathfinder, which gives me visually the exact offse

    I am taking a vector object, say a flower, compensate a path then get a path independent vector around the outside edge of the offset.

    I take my flower, add a line, compensate for this trait, then select Add to Pathfinder, which gives me visually the exact shape of offbeat perimeter I'm looking for.  The problem is that this isn't a vector path in its own right.  Is there a way to get Illustrator to recognize the lag shot as it is vector own way

    Please forgive me if my terminology is off that I am not a formally trained graphic designer.

    MP,

    If I (put) understand it, object > decaying appearance.

    There is a difference between effect > Pathfinder and window > Pathfinder.

  • the addition of several paths in a compound path

    If I use the GUI to add multiple paths in a compound path, all I have to do is select multiple paths and choose object-> compound path-> order manufacture (or ctrl-8). When I do that, then the path of the bottom that is filled has holes "through" creating a window in the form of small roads that were on top again. For example, a large rectangle with a white fill color is the background element and two smaller paths are on top. I have create a compound path and everything that is below the new compound path is reflected in most previous form two small paths.

    If I use JavaScript and create a new compoundPathItem and move 3 trails, with the largest being first, then I get a compound path, but only the first small objects creates a transparent space.

    Here's a simplified example:

    var grpMask = doc.groupItems ['mask group'];

    var compound = grpMask.compoundPathItems.add ();
    var pathobj = grpMask.pathItems ['bigbox ""];
    pathobj. Move (Compound, ElementPlacement.Inside);
    pathobj = grpMask.pathItems ['PathLeft ""];
    pathobj. Move (Compound, ElementPlacement.Inside);


    pathobj = grpMask.pathItems ['PathRight ""];
    pathobj. Move (Compound, ElementPlacement.Inside);

    In the example above, the "bigbox" has left and right channels above it, but only the left path creates a transparent space in the original box.

    I also tried to use PLACEATEND instead of INSIDE and the two smaller paths and move the group to the compound path.

    Merging the elements of path won't work - I want to keep the original path closed and intact without drawing a line between them so I can't simply add their pathpoints.

    Is move() the best way to add existing paths to a new path

    Thank you!

    I'm not sure,

    Take a look at polarity and/or evenodd propertys of pathItems inside the compoundpath.

    Maybe there is a difference.

    ?

    Chris

  • How to convert the compound path to simple way barred?

    New animation SVG here and you would appreciate the help.

    I exported an SVG graphic logo to facilitate the animation of lines in the logo. In short, I'm trying to make these lines 'draw' sequentially.

    After you import the SVG object in the browser, I realize the path data to describe complex shapes, rather than a simple path with a vascular accident brain. For example, straight lines appear as a path around the outside edge of the line, a rectangle. See the part of the image below showing the anchor around the edge of the line.

    While I could very well be wrong, it seems that I need to make these lines in the draw of logo is given simple way, with the width of the line determined by a stroke. Does anyone know how I could convert/export what I need to give me what I need?

    Thank you!

    Joseph,

    Simple/no tracks transparent FO, you can do the following:

    1) switch from fill to line in the Toolbox (in you first picture you have completed and no stroke);

    (2) ShiftClick each of the segments of both ends with the direct Selection tool and then tap on delete.

    This will give you two simple traces to the mixture;

    (3) object > mix > blend Options, not specified the value 1, then object > mix > do, then object > mix > Expand, then Ctrl / Cmd + Shift + group to ungroup, and then delete the traces of origin;

    (3) select the new path and him giving the desired weight of stroke (half of the difference in width for traces of origin).

    And Willi comments on using JPEG.

  • I have an object that follows a path and I want another object is placed in a different position, but follow the same exact path?

    I have an object that follows a path and I want another object is placed in a different position, but follow the same exact path? I NEED HELP!

    Easy: Copy and paste images keys, then select all the keyframes in the layer followed and drag them to the left.

    More complex: use expressions - Motionscript.com trails of the creation

Maybe you are looking for