Name automatically in the code layers for Illustrator

edited December 2016 in Questions about Code

Hi everyone,

I have a question regarding PDF exportation. When I export my work in PDF and open it in Adobe Illustrator, every "ellipse" I drew in the code represents a layer in Illustrator. Would it be possible to name them automatically in Processing? I mean, each of them, with a different name I take from my a csv file. In this way, as I work with a huge amount of data, I could afterward use these layers in java.

Thanks you very much.

**This is my code : **

PShape baseMap;
String csv[];
String myData[][];
PFont f;

void setup() {
  size(765, 627); 
  f = createFont("Verdana", 11);
  baseMap = loadShape("Europe_location_map.svg");
  csv = loadStrings("airportdata(2).csv");
  myData = new String[csv.length][3];
  for(int i=0; i<csv.length; i++){
   myData[i] = csv[i].split(";");    


// DRAW 
void draw(){
beginRecord(PDF, "airporttest(scale).pdf");

shape(baseMap, 0, 0, width, height);
for (int i=0; i<myData.length; i++){

fill(255, 0, 0, 100);
noStroke ();
println (myData[i][1]);

float graphLong = map(float(myData[i][3]), -25, 54, 0, width);
float graphLat = map(float(myData[i][2]), 82, 28, 0, height);
float markerSize = 0.014*sqrt(float(myData[i][1]))/PI;
ellipse (graphLong, graphLat, markerSize, markerSize);    

Sign In or Register to comment.