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

How to add an object that exists in a document to an existing group in a document?

Engaged ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

the Illustrator Scripting Guide has an example of creating a group of pathItems
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var triangleGroup = app.activeDocument.groupItems.add();

// Create a triangle and add text, the new art is created inside the group
var trianglePath = triangleGroup.pathItems.add();
trianglePath.setEntirePath(Array(Array(100, 100), Array(300, 100), Array(200, Math.tan(1.0471975) * 100 + 100)));
trianglePath.closed = true;
trianglePath.stroked = true;
trianglePath.filled = false;
trianglePath.strokeWidth = 3;
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

But it shows the process for newly created pathItems

Let's say that in the scene there is an pathItem called "Line01". How to add this pathItem to the group "Group 01"???

 
TOPICS
Scripting

Views

116

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

correct answers 1 Correct answer

Community Expert , Jul 13, 2022 Jul 13, 2022

try this

 

var idoc = app.activeDocument;
idoc.pageItems["Line01"].move (idoc.pageItems["Group 01"], ElementPlacement.PLACEATBEGINNING);

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 13, 2022 Jul 13, 2022

Copy link to clipboard

Copied

LATEST

try this

 

var idoc = app.activeDocument;
idoc.pageItems["Line01"].move (idoc.pageItems["Group 01"], ElementPlacement.PLACEATBEGINNING);

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