• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Why does the illustrator find an extra group?

Contributor ,
Nov 15, 2024 Nov 15, 2024

Copy link to clipboard

Copied

Screenshot_1.png

 

You see a group that consists of: on the left is a regular rectangle, on the right is a clipping mask, in which the mask is the same rectangle as on the left, and inside the mask are three rectangles (squares): white, above it orange, and above the orange white with a blue border. Simple, right?
The question is equally simple, how many groups are there from a scripting perspective? It would seem that the general group and the clipping group are just two groups. But Illustrator finds three groups.

Let's simplify and ungroup the outer group. Now we have two separate objects: a rectangle on the left and a clipping mask (group) on the right. So there's one group, and Illustrator will agree with us on that.

Question: where does the third group come from in the first case?

TOPICS
Scripting

Views

152

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Nov 15, 2024 Nov 15, 2024

Copy link to clipboard

Copied

Hi @fastwind, I cannot reproduce this. At your first step I get 3 groupItems, same as you. But after ungrouping the outer group I get 2 groupItems (the clipping group and the clipped group). How are you measuring the groupItems' count? I'm using doc.groupItems.length.

 

Edit: to answer your question: where does the third group come from in the first case? You made two groups (the outer group and the group inside the clipping group) and the extra group is the clipping group—that's just how clipping masks work in Illustrator.

 

- Mark

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 16, 2024 Nov 16, 2024

Copy link to clipboard

Copied

Hi @m1b I used a recursive function that counted the groups differently than the method you cited - obviously this is the reason for the difference in counts. But maybe you meant: "the extra group is the clipped group". 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 16, 2024 Nov 16, 2024

Copy link to clipboard

Copied

Oh I see. I thought there was a group inside the clipping group. In that case the reason for your 3 count was an incorrect function. My count is 2—the outer group and the clipping group. When I ungroup the outer group, the count is 1.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Nov 16, 2024 Nov 16, 2024

Copy link to clipboard

Copied

LATEST

there is no groups inside the clipping group in the above example - that's a correct note

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines