Skip to main content
Inspiring
January 27, 2023
Answered

What wholePath parameter of fillPath method of PathItem object affect (js script)?

  • January 27, 2023
  • 2 replies
  • 1982 views

I can’t understand what the change in this boolean (wholePath) parameter entails when writing a script? in the JavaScript Scripting Reference, a couple of lines of description that do not explain anything.

"If wholePath is true, all subpaths are used when doing the full"

 No understanding, for what use and how?

This topic has been closed for replies.
Correct answer RedButNoDead

Maybe I don't understand what you are asking. In any case, there is no easy and guaranteed way to select subpath(s) using a script. You can manually select using the Path Selection tool, for example.


I meant that of course you can select individual subpaths through the selection and then fill the resulting shape with any color through filling the selection. the question was - how does changing the wholePath parameter affect the filling of the path?

2 replies

Legend
January 27, 2023

There is an error in the description.

Swapped antiAlias and wholePath parameters.

 

wholePath must be the last one. If it is false, then it fills only the selected sub-paths.

 

Inspiring
January 27, 2023

Could you then explain how to select a separate subpath? Since it is written that the fill is applied to the all path (pathItem)

Legend
January 28, 2023

Maybe I don't understand what you are asking. In any case, there is no easy and guaranteed way to select subpath(s) using a script. You can manually select using the Path Selection tool, for example.

c.pfaffenbichler
Community Expert
Community Expert
January 27, 2023

Looks like a useless (possibly redundant) parameter; the wording of the description would seem to indicate that »false« would result in NOT ALL SubPathItems being considered in the filling. 

So far I could not create a situation in which this would actually happen.

Neither a selected SubPathItem nor off-canvas SubPathItems seem to make a difference. 

 

Ultimately I would recommend using AM-code instead of the DOM-code for Path-releated operations in general, though. 

Inspiring
January 27, 2023

Thank you. I feel the same way. But I asked because I thought there was something I didn't understand. About AM I understand. But for now I want to understand the classics)))