Use a compound path as clipping mask?

Hello,
I’m trying to use a complex compound path as a clipping mask, but it won’t work. I have narrowed down the problem a little in two smaller scripts described below.
Using a single path as clipping mask works very well:
var doc = app.documents.add();
var clipGroup = doc.groupItems.add();
var bgItem = clipGroup.pathItems.rectangle(200, 200, 200, 200);
bgItem.position = Array(200, 500);
bgItem.fillColor = doc.swatches[8].color;
var fgItem = clipGroup.pathItems.polygon(144, 288, 72.0, 7);
fgItem.position = Array(220, 480);
fgItem.fillColor = doc.swatches[7].color;
fgItem.zOrder(ZOrderMethod.BRINGTOFRONT);
clipGroup.clipped = true;
alert(clipGroup.clipped); // will alert true
But when trying the simplest form of a compound path, it’s not working:
var doc = app.documents.add();
var clipGroup = doc.groupItems.add();
var bgItem = clipGroup.pathItems.rectangle(200, 200, 200, 200);
bgItem.position = Array(200, 500);
bgItem.fillColor = doc.swatches[8].color;
var compoundItem = clipGroup.compoundPathItems.add();
var fgItem = compoundItem.pathItems.polygon(144, 288, 72.0, 7);
fgItem.position = Array(220, 480);
fgItem.fillColor = doc.swatches[7].color;
compoundItem.zOrder(ZOrderMethod.BRINGTOFRONT);
clipGroup.clipped = true;
alert(clipGroup.clipped); // will alert false
Using compound paths as clipping masks is really simple in the Illustrator GUI. So what am I missing here?
Help would be greatly appreciated.

The simplest way, I think, would be to set the white line work as an opacity mask on top of the tan circle. That is not a clipping mask, but does the same thing and it's much easier.
Otherwise, outline white strokes and "Unite" using pathfinder tool, then delete outside path (the circle), from the compound shape. That will leave the appropriate compound object to make the clipping mask:

Similar Messages

  • Calling all compound path and clipping mask experts...

    I am attempting to get all the white areas in the attached "globe" artwork to knockout to the background color. I have tried making the entire thing a compound path, tried clipping mask and different combinations in pathfinder with no success. The image on the right is what happens when I make it a compound path. Any suggestions would be greatly appreciated, thanks!

    The simplest way, I think, would be to set the white line work as an opacity mask on top of the tan circle. That is not a clipping mask, but does the same thing and it's much easier.
    Otherwise, outline white strokes and "Unite" using pathfinder tool, then delete outside path (the circle), from the compound shape. That will leave the appropriate compound object to make the clipping mask:

  • Why are all paths in Clipping Masks and Compound Paths?

    When I open up previous versions of Illustrator files (i.e. CS5), why are all of my paths messed up. Every object is embedded in a Clipping Mask, paths are compounded and in most cases type on a path is expanded into multiple non-editable objects. This causes complete redesign. This is terrible.

    Because Illustrator accessed the PDF part of the file.
    ---> this points to corrupt files.
    How were those files transferred to your computer? Are they on a server?
    How old are they?
    Which versions were they created in?
    Did you already try to restart (the computer)?
    Any plugins installed?

  • Draw inside disabled, and clipping mask workaround loses information

    I want to use my compound paths, with styles, fills and strokes applied to "draw inside", but that command is greyed out when I select them.
    However, if I "cheat" and instead use the compound paths as clipping masks first, I accomplish something which looks exactly the same way in the layer palette as when I do manage to "draw inside" an object.
    The trouble is that all my styles, fills and strokes get killed using that workaround, and I have to reapply them.
    Am I missing a step somewhere, or doing this in the wrong order?
    Any advice will be appreciated.
    Also, any word on why "draw inside" is disabled for compound paths?
    PS. Another problem using my poor workaround is that when the compound path becomes invisible, I can't find a way to drag appearances to it or apply swatches, even when I select it in the layer palette. I have to redo all styles, gradients, etc. manually, which is not efficient, nor desirable, at all.

    Monika Gause wrote:
    eobet wrote:
    So, if I understand this correctly, two people replying here can draw inside compound paths, and two people can't. Is this a design premium feature, or why does there seem to be a difference?
    Has nothing to do with Design Premium.
    Maybe you'd like to show us your art. There might be other ways to achieve what you need to do.
    Well my problem is that I can't do either of these:
    Now, the stroke aligned to the outside, I apparently can never get around unless I choose to outline the path on that stroke, which means I loose flexibility (or add steps to my workflow).
    And drawing on the inside... I guess I could make a clipping mask manually, but then I loose that really nice gradient I spent a lot of time to position just right... (either way, more steps in my workflow).
    Actually, the whole point of my question is completely lost if I have to outline any path, because the reason I want to work with compound shapes and clipping masks at all, is that I want to easily be able to move one of the sub-shapes which creates the final outline, without having to redo neither the gradient fill or stroke.
    And yeah, thinking again, my workflow is completely wrecked either way, since compound paths don't allow aligned strokes.

  • How to use a clipping mask layer to a multiple base layers?

    Is it possible to use one layer as a clipping mask to a 5 different bottom layers.
         What I'm trying to do is apply an adjustment layer to certain layers only. Is that possible?
    -Zeropan

    Zpan wrote:
    Is it possible to use one layer as a clipping mask to a 5 different bottom layers.
    not that I would know, but what you can do instead is group those 5 layers (CTRL+G), add the adjustment layer as the topmost layer in the group and set the group's blending mode to "normal". The adustment layer is then only applied to the layers within the same group.

  • Using "transform-effect copies" as a clipping mask

    1. I have a box shape, with a transform effect applied on it that copies the box 5 times horizontally.
    2. I want to use these 6 boxes as a clipping mask.
    3. How do I:
    a) Directly use this object as a clipping mask? Doesn't look like it's possible. When I try it only uses the original single box as the mask. The other 5 boxes disappear.
    b) "Break" the box shape object into 6 separate boxes so that they're no longer "phantom copies" but individual objects that I can then group to form a real clipping mask.

    Thank you, that worked (at least for B).
    Since Expand Appearance permanently breaks the object, does that mean that A isn't possible? (where I can keep the original object intact as 1 box with 5 copies and still act as a clipping mask)

  • Help needed to make a compound path of text in rectangle

    Hello, I hope some one will really solve my problem.
    Im trying to make a compound path (text inside a rectangle). I had done this previously with success but now the whole shape and text is showing same color. Although text should be transparent! And now due to the similarity in colors i cannot see any font.
    I don't know why this is happening?
    I made outlines of text, ungrouped it, released their compound paths, placed all fonts and rectangle in seperated layer and then made it a compound  path.
    Please let me know if im following all the steps.
    Also, please forgive my bad English as im not native.

    adobied,
    As you know now, Larry answered the Compound question while you were still typing.
    We do have quite a few cross postings in this busy forum, especially at this time of day with natives present both over there and over here.
    You can use Opacity Masks for a whole range of purposes, and they can act as (inverted) Clipping Masks, and also for partial/varying transparency.
    In this case, the suggested use corresponds to an inverted Clipping Mask.
    I quite understand your wish to have the Compound under control, and I believe that is sorted with the advice from Larry.

  • Trouble with mass amount of text and clipping mask - please help!

    I have a curvy vector image that I want text to appear in, then create a clipping mask. When I try this I get a message saying that the text object is extremely complex and might not print. The file is impossible to move around and sometimes crashes my machine.
    Here is a screen cap of what I'm doing:
    http://www.aaronpenton.net/mask.html
    I blocked all the text so there's just a ton of it.
    This is for a large graphic (22') that will be placed on glass.
    Is there a better way to do this? Or a way of making the file more manageable ?
    Any help is much appreciated.

    >I have a curvy vector image that I want text to appear in, then create a clipping mask.
    Inaccurate description. You are using the text as a clipping mask for the image. That's a lot of text, which means a very complex compound path with tens of thousands of points. No wonder this is slowing things down.
    Try using the text as an opacity mask instead, then flatten transparency. Keep a copy of the text and a copy of the wave on hidden layers so you can go back and edit the text or modify the path.

  • Clipping mask is clipping my lines and not the actual object.

    Hi all,I'm using the latest CC Illustrator.
    I'm so frustrated and hope someone can help me, I've already spent a few hours trying to figure this out and looked through a number of tutorials and troubleshoot forums and I cant find an answer.
    How do I stop the clipping mask from clipping inside the line itself, instead of my within the object. I'm still a newbie and I know I've done something wrong somewhere. I just cant figure out what.
    Here are a couple of screenshots of my problem.
    The end result looks pretty cool, but since this is for an assignment, I need it to work properly.
    Help!

    You are welcome. No you don't need to undo, you are on the right track, you expanded the lines in order to clip mask with a lighter image, now you need to use PathFinder to fill the holes (the turtle's shells) and clipmask them with a darker image like two turtle I created a few years ago. To use pathfinder, place a large rectangle behind the turtle expanded lines (compound path), select the expanded artwork and the rectangle and click PathFinder Divide button, at this point you will have the holes filled with paths and grouped with the original paths, so ungroup them. Then you select the newly generated paths and clip mask with a different and darker image. This attach image was done with PathFinder, pen tool and live paint. The images I used are real wood species, that I scanned into .jpg files.

  • Illustrator CS Clipping mask

    When I attempt to create a clipping mask using grouped objects (any objects - outlines created from text mostly)it does not work. Creating a mask from 1 object does work! I have looked at 'Help' and seem to be following instructions correctly. What is going on, can anyone assist?
    Steven

    First, create a compound path out of the outlined text, then use the compound as a clipping path.

  • Clipping mask with appearances?

    Hi all, I was trying to create a clipping mask from an object that is made from two shapes, and one has appearances (thanks to Rufus Deuchler's evangelism), but I had to resort to expand appearance, then use the object as a clipping mask.
    Is there really no way to keep the dynamic appearances and use a layer as a clipping mask?

    You can also try using the transparency palette flyout >> Make opacity mask
    Works similar to opacity masks as in Photoshop, and you can either use black for tranparent or white for tranparent dpending on if you click invert.

  • Compound path w/varying line styles?

    Hello!  I'm generating an emf for ArcMap symbols.  I need this symbol to be shaped like Nevada, but to have a rectangular "hole" in its center.  I'm hoping I can convince Arc to then center a three digit route number in the "hole," as pictured.  I created this using the compound path function.  This forced the hole to take on the line weight of the outer perimeter, but I need the hole to be "invisible," with no line weight at all.  How can I achieve this?  Thanks!

    A compound path can only have a single line weight and/or fill colour.
    So what you should do is this:
    Use your drawing (minus the digits) and colour it with (say) a red fill and no stroke. The hole will be transparent.
    Now copy the outer shape only, paste it in front of the red compound and give it a black stroke (probably set to overprint).
    Then select the red compound and change its colour to white.
    The hole is still there but you can't see it unless you put something behind it.

  • Compound Path Trouble in CS3

    I'm working on a tracing project and haven't had a hitch.  Until now.
    I'm working on tracing, filling and colouring hair and have been using the compound path tool for chopping out areas.
    This has been successful for the entirety of the project until suddenly it doesn't work any longer.  I'm not sure if I've accidentally altered the
    hair/compound path in some fundamental way but here's the problem as it appears:
    Previously, I'd draw the shape I wanted deleted, select the shape and the hair, and bingo--the shape disappears.
    Now, the shape does not disappear.  I've tried a few different things to discover what I may have done wrong for this to suddenly not work the way
    it did just before but I can't figure out what I've done.
    I've tried the subtract shape in Pathfinders, but this doesn't seem to quite work very well.
    I don't know what I've done wrong and could rally use some advice from the gurus here on the forum.
    I hope I've provided enough bacjground to give an idea as to what the problem might be to those more better informed than I am.

    Thanks for the suggestion, Wade.  It seems what I needed to do was release and recreate the compound path.
    I really appreciate you taking the time to look into it!

  • Clipping mask, object too complex, can't use bitmap either

    Hi all,
    I'm in Illustrator CS4 trying to make a page that has content that I want to embed within a rounded rectangle.  Sounds easy enough.
    I've been successful sticking some content into a rounded rectangle, until now.  Now I have a page that apparently is "too complex".  It has lots of transparencies and gradients and such.  Once I try to do the clipping mask thing I am told it's very complex and may not print or work right.  I go ahead anyway and it just looks blank/invisible.
    Then I thought artboards might be a way to do this, but I couldn't see how you could make an artboard that is a shape other than a rectangle (I'd like a rounded rectangle).
    So then I thought if export the image to a bitmap and then repaste it in, maybe I could embed the bitmap into the rounded rectangle.  Pain in the butt, but I'm looking for any solution.  But that doesn't even work because it says the top selected object must be "a path, a compound shape, a text object, or a group of those".  So a bitmap can't be used
    Has anyone had more luck with this?  In CorelDraw I've always just placed objects, no matter how complex, into a "container" without any issues.  Certainly there's a way to do the same here.  This drawing isn't *that* complex.
    Thanks in advance for your advice!

    Check your flattener settings in the prefs, specific flattening options of your object groups and also the raster effects resolution for your document. Reduccing their dpi should make working possible.
    Mylenium

  • Making a clipping group with a compound path

    So, as of today I'm new to scripting for Illustrator, I'm using the ExtendScript Toolkit. However I'm not new to scripting my own solutions and I do have some experience with JavaScript already.
    What I'm trying to do is this: For all selected Items->Duplicate selected item and make a simple clipping group with it
    What I end up with visually doesn't change the picture, but gives me a lot of clipped colored areas which I then can edit in the isolated mode, allowing me far faster and better shading. Doing that by hand takes hours on some pictures, it'd take a second with a script.
    The script itself already perfectly works for normal PathItems. As obvious in the title, as soon as I have to apply the same to CompundPathItems things stop working. My issue is somewhat similar to this old thread [Problem with compound path clipping], but I couldn't find a solution there because I get different behavior.
    When I run the very same script that perfectly works with the normal PathItems with CompoundPathItems I get this: Error 9046: The top item in the group must be a path item to create a mask
    Well that's a problem. In the GUI there is absolutely no difference between making a clipping mask with a simple path and a compound path. The reference guide has frankly not helped me with this issue at all, the only thing I learned from that is that the CompoundPathItem object doesn't have a clipping attribute, but those included PathItems do.
    Here's what I have so far:
    if ( selected[i].typename == "PathItem" ) {
    var newGroup = doc.groupItems.add();
    copy = selected[i].duplicate(newGroup,ElementPlacement.PLACEATEND);
    selected[i].moveToBeginning(newGroup);
    newGroup.clipped = true;
    As I said, this part perfectly does what it's supposed to do for normal Paths.
    For CompoundPaths I use this workaround.
    if ( selected[i].typename == "CompoundPathItem" ) {
    var newGroup = doc.groupItems.add();
    copy = 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 does work in so far that it bypasses that annoying and wrong error, and the Compound Clipping Path also works, with the only problem being that the Compound Clipping Path created like this is still displayed in its original colors in the Layers section, and is still selectable. When I lock the Compound Clipping Path I can work with it but still...
    So the question is, what am I missing here? Surely there must be a proper way to do this.

    app.executeMenuCommand()? That one eluded me so far, might be just the right thing. I'll definitely take a look, now just to find a ref on that, as unfortunately the official ref documents I have don't mention that command. Any place with a list of possible commands?
    Ah, also of course I'm not only doing it for the isolation mode. If you care to hear the background, here is it:
    As I said it's for shading the pictures I'm working on. I've iterated and tried through a bunch of techniques. For example gradient meshes on my first few real works. Now those meshes don't do well with complex shapes, which previously I alleviated by using a simple square or rectangle gradient mesh and using the original colored shape as a clipping mask. That did work, but it was a huge lot of work.
    After a bunch of attempts at that I went over to using simple gradients as a background for the shape and then I'm doing the shading freehand with the blob brush tool, using a graphic style and filters to make it look right. That's better, but properly making all the clipping masks takes me much longer than anything else.
    Now the problem is that the shading is not supposed to go over the lines, which is impossible to do properly without either messing up the order, or using clipping masks, hence the script. Because you know, if you use a blob brush with a strong Gaussian blur close to the lines you'll end up with stuff on both sides. If you don't start close to the line the shading won't look right if the darkest part of the shade needs to be close to the line. And that's where clipping masks do magic.
    And finally here's an example how I work with the script and the result:
    After I have traced a sketch, adjusted the line widths and everything to look neat I turn the paths to outline strokes and then make them into a live paint group (which would mess up the line widths, unless you turn the paths into outline strokes first).
    With that live paint group it takes me just a few minutes to flat color my piece. Then I expand the live paint group, in case of doubt spend some more minutes to make compound paths from all areas I need to shade in one piece, then I select all the areas and use my script to turn them into neat clipping masks. Then I can click any area, enter the isolation mode and go up one level so I'm in the appropriate group, where I can shade freely without the problem of going over the lines.
    At the end that allows me to apply a complex and in-depth shading, without wasting any time to get there.
    PS: Well, I just found out that Draw Inside is pretty darn close to what I want to do, and oddly enough it produces the same visual discrepancy with compound paths that my script produces. I'll be taking a closer look at that, though my script does a little more than just the clipping mask stuff, so maybe I'll go for a hybrid solution. Whatever makes for a better workflow.

Maybe you are looking for

  • How To Create the HP_TOOLS partition manually?

    Hello,      According to HP, you can create the HP_TOOLS partition manually with type FAT32 and make the partition name HP_TOOLS. I installed Windows 8 on my MSata Drive after I upgraded it and for some reason you can't install the HP_TOOLS on those

  • Depreciation calculated on credit memo is more than its own value

    Hi, We have noticed that the depreciation calculated on credit memo is more than its own values. please refer the screen shot below: 24.05.2010     108,044.64     120     Goods receipt     108,044.64-     0     USD 24.05.2010     108,044.64     120  

  • To buypass the SAP standard POP up box in PO create and change mode

    Hi All, In purchase order ME21N or ME22N, i have made changes using enhancement MM06E005. It is in FM Exit_sapmm06E_012 that i have my new code. Here when the business requirement is met the custom warning message is triggered. With this, i get sap p

  • Music Plays on iPod Touch won't update to iTunes 10.5

    number of music plays on ipod touch won't update to itunes 10.5

  • Desktop Projector Export Feature? Yeah? Yeah!!

    I would strongly recommend incorporating a Projector Export feature in Flash Builder 4. Despite having AIR support, I can't think of a single reason why this couldn't, easily, be done. Doing this now requires that every .swf file be opened manually i