Order script

Explorer ,
Oct 04, 2020 Oct 04, 2020

Copy link to clipboard

Copied

Hi. I need a script to group same color paths to same groups and after, combine/join paths in this groups into objects.

 

What do you think?

P.S Sorry I am not good at English.

test_script [преобразованный]-01.jpg

TOPICS
Scripting

Views

176

Likes

translate

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
Explorer ,
Oct 04, 2020 Oct 04, 2020

Copy link to clipboard

Copied

About "group same color paths to same groups" I mean situation like this

test_script [преобразованный]-02.jpg

Likes

translate

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
Enthusiast ,
Oct 04, 2020 Oct 04, 2020

Copy link to clipboard

Copied

This is a primitive way of grouping path items with the same stroke color.

var paths = app.activeDocument.pathItems;
for (var i = 0; i < paths.length; i++) {
  if (paths[i].parent != "GroupItem") {
    paths[i].selected = true;
    app.executeMenuCommand("Find Stroke Color menu item");
    app.executeMenuCommand("group");
    app.executeMenuCommand("deselectall");
  }
}

I'm afraid I don't understand the second part of your question.

Likes

translate

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
Explorer ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

About second part.

I can't fill the surfaces because they are not surfaces. They are a lot of paths. I need to join (Like Ctrl+j) this paths into surfaces.

 

For example cube.

On my picture you can see the cube like 3 surfaces (like surface x, surface y, surface z). But this surfaces are consist from separate paths. Could I combine it by script?

Likes

translate

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
Explorer ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

Be_Illustrator_0-1601900126338.png

 

Likes

translate

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
Enthusiast ,
Oct 05, 2020 Oct 05, 2020

Copy link to clipboard

Copied

I cannot help you, but I will suggest Hiroyuki Sato's script Join Reasonably.

http://shspage.com/aijs/en/#join_reasonably

This will work on simple 2D shapes, but will produce extra lines on 2D representations of 3D objects.

Untitled01.png

Untitled02.png

Likes

translate

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
Enthusiast ,
Oct 06, 2020 Oct 06, 2020

Copy link to clipboard

Copied

Salut!

ctrl+j puis Outil K (pot de peinture dynamique)

renél80416020_2-1601972827078.png

 

 

 

Likes

translate

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