Help organizing dozens of layers with hundreds of sub-layers.

Community Beginner ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

I'm looking for a plugin or script that can help me organize layers and sub-layers. Often I receive post-script files from vendors that have hundreds of sub-layers, each of which is just a small path that is part of many different objects on the artboard. I spend days organizing and combining these into layers with names that makes sense.

TOPICS
How to, Scripting, Third party plugins, Tools

Views

344

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
community guidelines
Adobe Community Professional ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

So these are sub layers? Or are they rather paths?

Do you want to join these paths?

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
community guidelines
Community Beginner ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Good question.  I've always assumed that I was looking at sub-layers.  What I have are a dozen layers, named "Layer 1", "Layer 2", "Layer 3", etc.  Inside each of these layers are hundreds of items (sub-layers?) all named "path".  Most of the time each top level layer represents an object on the artboard.  Layer 1 might be a circle, Layer 2 may be a rectangle.   Each of the "paths" inside those layers make the shape of the object.  Joining the individual paths into one path would be very helpful.

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
community guidelines
Adobe Community Professional ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

what are the rules for determining what to call a given layer?

 

if the script reaches layer[i], how would a script know what to call this layer? some kind of spreadsheet? if there are 5 sublayers, what do we call them? what if there are 50 sublayers?

 

long story short, what is the decision tree? when you're doing this manually, how to you determine which layers should be combined and how do you determine what to name the resulting layers/groups?

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
community guidelines
Community Beginner ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Hi Dilliam,  please see my response to Kurt Gold below.  Hopefully it explains the lack of efficiency regarding the naming of the layer tree.

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
community guidelines
Adobe Community Professional ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

LATEST

ok. I read that.. but it doesn't answer any of my questions. 

 

let's say you run the script. it starts on layer 1.. what should it name layer 1? How does the script know how to make a decision? An example answer to this question is this: "i have a spreadsheet with values input in the same order as the layers i want to rename. the first value in the spreadsheet should be used as the name for layer 1. second value for layer 2. etc". Or perhaps an answer could look like this: "there's a text frame inside each layer that contains the text i want to use for the parent layer name."

 

Moving beyond that, when you get to the items inside each layer, the same question applies. You mentioned that you have a bunch of items called "<path>".. this means they're unnamed and can't be accessed by name. So, if we just loop through all of the pageItems on a given layer, how do we know what any of them should be called? If the script reaches a pathItem inside layer 1, how do you know whether that path represents the front,back,collar, etc?

 

Scripts are great and they can definitely give you the efficiency boost you're looking for. But they can't read your mind. In order to write a functioning script, we need to know what the inputs are and what the outputs should be. We need to know what the rules are so that we can determine how to structure the code to do the thing that you want to do.

 

on a fundamental level, the answer to your question is this:

//to rename a layer
app.activeDocument.layers[0].name = "New Layer Name";

//to rename a pathItem (or any pageItem)
app.activeDocument.pathItems[0].name = "New Path Name";

//to move a pageItem from one layer to another
//this moves the first pathItem in the document to the second layer in the document
app.activeDocument.pathItems[0].moveToBeginning(app.activeDocument.layers[1])

 

As you can see, it's quite easy to change the name of something. But the value that you change it to needs to come from somewhere.

 

So, assuming you were doing this manually, when you opened a layer and found an unnamed path that represents the "front" of a garment, you'd double click on the item in the layers panel and type the new name, correct? So what is the decision structure that leads you to deciding to call that piece "front"? Is it just that you can look at it and recognize it as a "front"? Or are the pieces stacked in order in some way so that you're always changing the first item to "front" and the second item to "back" and the third item to "left sleeve" and so on?

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
community guidelines
Adobe Community Professional ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Can you share one or two sample Illustrator files (.ai) including some clarifications as per Dilliam's questions?

 

Also, it is always a good idea to mention which version of Illustrator you are using.

 

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
community guidelines
Community Beginner ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Hi Kurt,

Sure thing.  I'm using Illustrator 25.2.1 running on macOS Big Sur 11.2.3

 

I've attached a sample file with just one layer of what I'm dealing with.  This file is for a sewing pattern of a neck line.  Each path is what's called a "grade".  A "grade" represents one of the different sizes needed to create an item of clothing in various sizes.  Grades are typically named anywhere from 00 to XXL just as clothing sizes are named.  This is what I spend forever doing, naming each path as the grade it represents.  On each Illustrator file, I'll have multiple layers that represent the different parts of the clothing, such as the front, back, sleeves, pockets, etc.

 

FYI - Each grade is typically shown with a different dashed line style.  On a typical pattern for a shirt, each individual piece such as sleeves, backs, fronts, pockets will have "grade" stroke styles that match. When a pattern is ready to be distributed to the public, it's typically done so as a multi-layer PDF.  The consumer just turns on the layer that represents the grade they want.  Normally in an application such as Acrobat Reader.

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
community guidelines
Advocate ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

I'm not being flippant, but why do you need to do this?

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
community guidelines
Community Beginner ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Ha.  Because it takes forever and could lead to the ruin of my marriage.  😉

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
community guidelines
Adobe Community Professional ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Met, it's because it may help to clarify things and to think about possible solutions.

 

Or is your question perhaps not addressed to me?

 

If that applies, you may consider to make it clear to whom you are talking.

 

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
community guidelines
Advocate ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

To Kurt: I was replying to OP, I thought the forum stacked replies, I'll make it clearer in the future.

I thought understanding what the final objective was, might make for a quicker, easier and/or better solution.

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
community guidelines
Adobe Community Professional ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Thanks for the sample file, Robert.

 

I'm going to sleep right now, but I'm sure that Dilliam or someone else may confect a possible approach in the meantime. Or at least some other food for thoughts.

 

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
community guidelines
Adobe Community Professional ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Met, that is absolutely no problem.

 

The current structure of sometimes incredibly nested threads often requires a clear addressing.

 

Otherwise things may become confusing as hell.

 

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
community guidelines
Advocate ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

to OP: I'm assuming the dash config for each pattern line is always the same, so you can build a graphic style off of each, then move each graphic style elements to their own layer, name the layer as appropriate, and then stack layers in size order. (I noticed in the file they are unfortunately not created linearly stack-wise.)

 

[You say "When a pattern is ready to be distributed to the public, it's typically done so as a multi-layer PDF.  The consumer just turns on the layer that represents the grade they want", so someone has already done that hard work!]

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
community guidelines
Community Beginner ,
Mar 30, 2021 Mar 30, 2021

Copy link to clipboard

Copied

Yes, the line patterns stay the same for each of the grades.

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
community guidelines
Participant ,
Mar 31, 2021 Mar 31, 2021

Copy link to clipboard

Copied

hey @Robert Studio Eight MN 

I do the same every day, I work the following script and it works perfectly to me, try this 

 

var doc=app.activeDocument;
var capas=doc.layers
var sizes=["2XS","XS","S","M","L","XL","2XL","3XL","4XL"]

for (var i=0;i<capas.length;i++){
capas[i].name=sizes[i];
}

 

Best Regads

Gersson

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
community guidelines