3 Replies Latest reply on Jun 30, 2013 2:06 PM by CarlosCanto

    Actually visible bounds, not the fake ones

    Onnel

      Please suggest how to get/determine the visible bounds (top+left coords and width+height or Rect structure) of a group having a clipping mask or several masks? When a script asks for Visible Bounds, Illustrator provides the coords/size of the group like it does not have any clipping mask. So, you see a circle of 10px diameter (and these are the actual visible bounds of this group), but Illustrator says that the visible bounds are 50 px wide and 70 px in height.

       

      I searched through this forum topics and found a suggestion to look at all the objects in the group and find which one of them is the clipping path/mask. Then take its coords/size. Is there any other/simplier way?

       

      And what to do if the group contains multiple clipping masks of different shapes/sizes?

       

      Thank you.

        • 1. Re: Actually visible bounds, not the fake ones
          CarlosCanto Adobe Community Professional & MVP

          Is there any other/simplier way?

          there's no simpler way that I know of

           

          And what to do if the group contains multiple clipping masks of different shapes/sizes?

          the main clipping mask group will always have one pathItem (the clipping mask) and other objects or groups (other clipping mask groups), you shouldn't have any problem identifying which one is the clipping mask.

          • 2. Re: Actually visible bounds, not the fake ones
            Onnel Level 1

            Thank you, Carlos. But even if I'll drill-down through the list of all items and will find all the clipping masks, how will I get the visible area coords/size? The masks can be intersecting, for example.

             

            Let's say there is a square clipping mask with 100 px wide sides at the top of the group. And below there is another square clipping mask with 50 px wide sides. If the 2nd mask is inside the 1st one, the visible area = the 2nd mask = 50px x 50 px. Simple!

             

            But If the 2nd mask is intersecting 1 side (or 2 sides!) of the 1st mask, we get some rectangular area with 0 to 50 px width and 0 to 50 px height, let's say 12 x 27 px.

             

            And this is the simpliest possible case - just 2 squares. What about rotated ellipses?

             

            Adobe Illustrator knows what are the real visible bounds, because it allows to align and distribute objects by those bounds. There should be a way to ask the Illustrator about them Maybe some undocumented function like TellMeTheTruthDude()

             

            Any ideas?

            • 3. Re: Actually visible bounds, not the fake ones
              CarlosCanto Adobe Community Professional & MVP

              can you post a screen shot showing the objects and the layers panel expanded?