// // requires that polychain2curve lscript is installed into modeler // main { // check bg layer bgLayer = lyrbg(); if(bgLayer==nil) { error("No background layer selected."); } numbg = size(bgLayer); if(numbg != 1) { error("More than 1 background layer is active"); } selmode(DIRECT); //save list of all selected end points count = editbegin(); mypoints = points; editend(); selmode(USER); //check for point selection if(count==0) error("Must select points first"); moninit(count, "Processing..."); //for each 2 point poly chain create a curve for(i=1;i<=count;i++) { if(monstep()) { return; } selpoint(CLEAR); // clear any existing selections //select first point of current poly chain //selList = buildSelectionList(mypoints[i]); //select the first point selmode(USER); selpoint(SET,POINTID,mypoints[i]); cmdseq("polychain2curve"); } info("done processing"); monend(); }