Dim appRef As New Illustrator.Application
Dim triangleGroup As Illustrator.GroupItem
'Create a new group in the active document.
'This will be the group that holds the new triangle art
Set triangleGroup = appRef.ActiveDocument.GroupItems.Add
'Create a triangle and add text inside the group
Dim trianglePath As Illustrator.PathItem
Dim captionText As Illustrator.TextFrame
Set trianglePath = triangleGroup.PathItems.Add
trianglePath.SetEntirePath Array(Array(100, 100), Array(300, 100), _
Array(200, Math.Tan(1.0471975) * 100 + 100))
Set captionText = triangleGroup.TextFrames.Add
captionText.Position = Array(100, 100)
captionText.Contents = "A triangle"
Set trianglePath = triangleGroup.PathItems.Add
trianglePath.SetEntirePath Array(Array(100, 100), Array(300, 100), _
Array(200, Math.Tan(1.0471975) * 100 + 100))
trianglePath = мойКакой-тоТамPath
у меня другой вопрос - почему он добавляет обьекты в группу в шахматном порядке ? вот кусок скрипта :
--------------------------------------------------------
doc = app.activeDocument.layers[0];
var group = doc.groupItems.add();
group.name = "group";
group.move (doc, ElementPlacement.PLACEATEND);
for(i=0;i<doc.pathItems.length;i++)
{
obj=doc.pathItems;
obj.move (group,ElementPlacement.PLACEATEND)
}
for(i=0;i<doc.pathItems.length;i++)
{
obj=doc.pathItems;
obj.move (group,ElementPlacement.PLACEATEND)
i=i-1;
}