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

Any way to expand until completely expanded

Engaged ,
Jul 10, 2020 Jul 10, 2020

I have a symbol that looks like a standard stick figure. Inside the symbol, each body part is also a symbol. So inside the head, for example, is an ellipse shape/vector path.

But inside the arm symbol, there are three more symbols (shoulder, bicep, forearm).

Inside each of the symbols in the arm symbol is a shape/vector path.

I have been expanding and expanding and expanding and I'm sick and tired of it.

 

Is there any way to "EXPAND COMPLETELY" so that I have a series of layered shapes/vectors?

I keep expanding ungrouping and this is one of several that I have to do. 

Any ideas on how to do this better?

Thanks in advance.

TOPICS
Scripting
599
Translate
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

correct answers 2 Correct answers

Community Expert , Jul 10, 2020 Jul 10, 2020

Hi JP_Burnout,

 

First off, I'll say that I don't know the proper way to do this, and I hope someone posts a better way... But, I've had a quick hack at it and come up with this:

 

// start with the SymbolItem selected before running script

completelyExpandSymbol(app.activeDocument.selection[0]);


function completelyExpandSymbol(item) {
    var items;
    if (item.typename == 'SymbolItem') {
        app.executeMenuCommand('Expand3');
        item = app.activeDocument.selection[0];
    }
    if (it
...
Translate
Community Expert , Jul 10, 2020 Jul 10, 2020

You may try Object > Flatten Transparency.

Translate
Adobe
Community Expert ,
Jul 10, 2020 Jul 10, 2020

Hi JP_Burnout,

 

First off, I'll say that I don't know the proper way to do this, and I hope someone posts a better way... But, I've had a quick hack at it and come up with this:

 

// start with the SymbolItem selected before running script

completelyExpandSymbol(app.activeDocument.selection[0]);


function completelyExpandSymbol(item) {
    var items;
    if (item.typename == 'SymbolItem') {
        app.executeMenuCommand('Expand3');
        item = app.activeDocument.selection[0];
    }
    if (item.typename == 'GroupItem') {
        items = ungroup(item)
    }
    if (items != undefined) {
        for (var i = 0; i < items.length; i++) {
            if (items[i].typename == 'GroupItem' || items[i].typename == 'SymbolItem') {
                completelyExpandSymbol(items[i])
            }
        }
    }
    function ungroup(group) {
        if (!group.pageItems) return false;
        var items = [];
        for (var i = group.pageItems.length - 1; i >= 0; i--) {
            items.push(group.pageItems[i]);
            group.pageItems[i].move(group, ElementPlacement.PLACEBEFORE);
        }
        return items;
    }
}

 

You still have to manually hit enter once for every SymbolItem. It keeps groups based on the way the symbols were structured. Let me know if it works for you!

 

Regards,

Mark

Translate
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 ,
Jul 10, 2020 Jul 10, 2020

You may try Object > Flatten Transparency.

Translate
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 ,
Jul 10, 2020 Jul 10, 2020

Nice!

Translate
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
LEGEND ,
Jul 17, 2020 Jul 17, 2020
LATEST

Hi there,

 

Thanks for reaching out. I hope you found your answer. We'd appreciate if you can mark the appropriate response correct. If you used any other method, you can share it with us. It'll help other users with similar concern.

Let us know if you have still have any concern, we'll be happy to help.

 

Regards,

Ashutosh

Translate
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