Skip to main content
tt27079448
Inspiring
June 13, 2016
質問

JS how to split the object to two diffrent parts ,like this:

  • June 13, 2016
  • 返信数 1.
  • 928 ビュー

JS how to split the object to two diffrent parts ,like this:

このトピックへの返信は締め切られました。

返信数 1

Disposition_Dev
Legend
June 13, 2016

we're going to need more info about exactly what you're trying to do and the structure of your file so we can help plan for problems..

in it's simplest form, the code would go like this:

function splitParts()

{

     var docRef = app.activeDocument;

     var item1 = docRef.pathItems[0];

     var item2 = docRef.pathItems[1];

     item1.top = item1.top + 50;

     item2.top = item2.top - 50;

}

splitParts();

tt27079448
tt27079448作成者
Inspiring
June 14, 2016

sorry ,

the object have only one pathItems ,have not two pathItems .

Alexander Ladygin
Inspiring
June 14, 2016

As an options:

var s = selection[0],

    i = s.pathItems.length,

    obj = s.parent;

while ( i-- ) s.pathItems.moveToBeginning( obj );

s.remove();