Соединить два graphicLine

Статус
Закрыто для дальнейших ответов.

Oleg_Sh

Топикстартер
15 лет на форуме
Сообщения
179
Реакции
50
Задача: создать и объединить две линии в один объект и соединить их прямой.
Indesign CS 5.5

Создать и объединить получается, но последняя команда не дает никакого результата:
Код:
var myGraphicLine = graphicLines.add();
myGraphicLine.paths.item(0).pathPoints.item(0).anchor = [50,50];
myGraphicLine.paths.item(0).pathPoints.item(1).anchor = [70,30];
var myGraphicLine1 = myGraphicLine.duplicate([100,30]);
myGraphicLine1.flipItem (Flip.HORIZONTAL, AnchorPoint.CENTER_ANCHOR)
myGraphicLine=myGraphicLine.makeCompoundPath (myGraphicLine1);
var myPathP=myGraphicLine.paths.item(1).pathPoints.item(-1);
myGraphicLine.paths.item(0).pathPoints.item(-1).join(myPathP);
}
Помогите разобраться.
 

Oleg Butrin

20 лет на форуме
Сообщения
1 990
Реакции
1 213
Код:
with (app.activeDocument.pages[0]) {
    var myGraphicLine = graphicLines.add();
    myGraphicLine.paths.item(0).pathPoints.item(0).anchor = [50,50];
    myGraphicLine.paths.item(0).pathPoints.item(1).anchor = [70,30];
    var myGraphicLine1 = myGraphicLine.duplicate([100,30]);
    myGraphicLine1.flipItem (Flip.HORIZONTAL, AnchorPoint.CENTER_ANCHOR);
    myGraphicLine.paths.item(0).entirePath = myGraphicLine.paths.item(0).entirePath.concat(myGraphicLine1.paths.item(0).entirePath.reverse());
    myGraphicLine1.remove();
    }
 

Oleg_Sh

Топикстартер
15 лет на форуме
Сообщения
179
Реакции
50
Работает! Большое Спасибо!
 
Статус
Закрыто для дальнейших ответов.