Highlighted

Any way to expand until completely expanded

Contributor ,
Jul 10, 2020

Copy link to clipboard

Copied

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.

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

Topics

How to, Scripting

Views

70

Likes

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

Any way to expand until completely expanded

Contributor ,
Jul 10, 2020

Copy link to clipboard

Copied

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.

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

Topics

How to, Scripting

Views

71

Likes

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

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jul 10, 2020 0
Adobe Community Professional ,
Jul 10, 2020

Copy link to clipboard

Copied

You may try Object > Flatten Transparency.

Likes

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
Reply
Loading...
Jul 10, 2020 2
Contributor ,
Jul 10, 2020

Copy link to clipboard

Copied

Nice!

Likes

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
Reply
Loading...
Jul 10, 2020 0
Adobe Employee ,
Jul 17, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jul 17, 2020 0