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"???
try this
var idoc = app.activeDocument;
idoc.pageItems["Line01"].move (idoc.pageItems["Group 01"], ElementPlacement.PLACEATBEGINNING);
Copy link to clipboard
Copied
try this
var idoc = app.activeDocument;
idoc.pageItems["Line01"].move (idoc.pageItems["Group 01"], ElementPlacement.PLACEATBEGINNING);