Mobile app version of vmapp.org
Login or Join
Yeniel278

: How to add numbers to Adobe Illustrator anchor points? You know the "connect the dots" books for children where you connect the dots from 1 to 100 and a picture becomes visible? I would love

@Yeniel278

Posted in: #AdobeIllustrator #AnchorPoint #IllustratorScripting #Numbering

You know the "connect the dots" books for children where you connect the dots from 1 to 100 and a picture becomes visible?

I would love to do the same in Adobe Illustrator.

Is there a way (with any kind of scripting maybe) to add numbers to anchor points?

Is there a way (with any kind of scripting maybe) to color the points based on their anchor index (for example points 1-99 are black, 100-199 are blue etc.)?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Yeniel278

1 Comments

Sorted by latest first Latest Oldest Best

 

@Michele215

To get started, easy dotted line creation and ordering can be accomplished using this script as explained by joojaa here.

The importance of arrangement is because the Document.selection array respects the order that the objects are stacked. You can take advantage of that to create a new text object for each object currently selected.

Here's a very simple snippet of JavaScript to point you in the right direction:

var document = app.activeDocument; //Use the current open Ai File
var selected = document.selection; //Use the current selection in Ai

for (var i = 0; i < selected.length; i++) { //Iterate over every selected object
var text = document.textFrames.add(); //Add a new text object
text.contents = i + 1; //Set the corresponding number text
text.top = selected[i].top - 10; //Position the text object underneath
text.left = selected[i].left;
}


In action:



I'm using shapes instead of anchor points for demonstration purposes but it does not matter if you use just anchor points instead. It would not be difficult to color the points based on their index. You should consult the Illustrator Scripting Reference for all the information required on how to custom tailor a script to suit your needs.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme