Skip to main content
Participant
September 26, 2024
Answered

Using Live Effects Functions for Illustrator (double paths)

  • September 26, 2024
  • 1 reply
  • 364 views

Here (below) is my full script. The numbers are fine, but my original paths are each offset twice (!). I end up with two of everything.

Is there a remedy??

 

//@include LE_Functions.js
// units are points (pt)
// script works on selected items

semi_minor = 170
q = 8
t = 6
semi_major =  q * t 

var scope = app.activeDocument.selection.length ? app.activeDocument.selection : app.activeDocument.pageItems;

for (var i=0; i<scope.length; i++) {
    w = i * t
    p = (semi_major * semi_major) - (w * w)
    y = (semi_minor/semi_major) * Math.sqrt(p)

    kate = y - semi_minor
    LE_OffsetPath(scope[i], {offset: kate, expandAppearance: true})
}

 

@m1b 

This topic has been closed for replies.
Correct answer m1b

Hi @Paul_St_George, perhaps your page items have a fill *and* stroke? If so, then Expand Appearance will create at least two shapes, grouped together—one filled and one stroked. That is just how it works.

 

Possible solutions would be to remove the stroke and re-apply it after the expand appearance (you could use a graphic style?). Or you could manipulate the groupItem(s) the way you need them, eg. putting group child 1's stroke on group child 0.

 

Sorry it is not a smooth process.

- Mark

1 reply

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
September 26, 2024

Hi @Paul_St_George, perhaps your page items have a fill *and* stroke? If so, then Expand Appearance will create at least two shapes, grouped together—one filled and one stroked. That is just how it works.

 

Possible solutions would be to remove the stroke and re-apply it after the expand appearance (you could use a graphic style?). Or you could manipulate the groupItem(s) the way you need them, eg. putting group child 1's stroke on group child 0.

 

Sorry it is not a smooth process.

- Mark

Participant
September 26, 2024

Doh. I spent hours looking at the script and no time looking in Illustrator. Lesson learned and now everything is as it should be.
Paul