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.
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()
can you post a screen shot showing the objects and the layers panel expanded?