Sg2.9
Grid Generator
Recent RSS
Creator:  Shanfan Huang
Date:  4. January 2012, 11:04

This is a very straight forward tool that generates four kinds of grid. You type in the number of rows and columns, and the size of the unit, then click a button.

While those grids might seem basic to mathematicians, I thought it'd be handy to have something like this in AI for graphic artists. Something looking basic at first can be creatively altered and became something interesting. I attached two quick-dirty mockups just to demonstrate some possibilities.

My favorite trick is to use the raster.getAverageColor() function to layout a rich and abstract color combination. If you feel like to try, copy the code below to the end of my scripts:

  • -----------------------------------

// Pickup colors from a raster//
//NOTE: An image must be placed within the artboard and rasterized//

var rasters = document.getItems({
type: Raster,
selected: true
});

var paths = document.getItems({
type: Path,
selected: true
});

if(rasters.length >0 && paths.length >0){
var raster = rasters[0];
for(var i=0; i<paths.length; i++) {
var path = paths[i];
var color = raster.getAverageColor(path);
path.fillColor = color;
}
}else{
Dialog.alert('Please select at least one rasterized image and one path overlapping on top.');
}

  • -------------------------------------------

UPDATE: 01/10/2012
I uploaded the above lines as a separate script.

Re: Grid Generator
Date:  19. March 2015, 10:48

Sorry - have only ever tried with CS5.
Try reading the general notes on Scriptographer. If that claims to work with CS3 then there is a good chance the script will work - if not, no.

Re: Grid Generator
From:  Andrew A.
Date:  20. March 2015, 06:18

Scriptographer has version for CS3, CS4,CS5...but this script want work in my CS3. So sad, it's interesting and wonderfull script)..
These no script version for CS3?
Thanks for advance!

Re: Grid Generator
Date:  21. March 2015, 13:24

1) Is there an error message?
2) Does another script work ok ?
3) Does the original grid generator work ?

Re: Grid Generator
From:  Andrew A.
Date:  24. March 2015, 09:34

1)Error 22:
Line 207: -> var palette new Palette ('Grid Generator', components def);

or in line 147 in another version of script

2)Many various scripts i use in CS3

3) What does it mean "original" script?

Thanks!

Re: Grid Generator
From:  Andrew A.
Date:  24. March 2015, 10:00

All inner scripts of Scriptographer_Win_CS3_2.9.073works fine. Tools too...
What's the problem?

Re: Grid Generator
Date:  25. March 2015, 22:54

I just downloaded
grid_generator_alts.zip

Line 206 reads
var palette = new Palette('Grid Generator', components, values);
not
var palette new Palette ('Grid Generator', components def);
which would result in an error

Has something happened to your script -- perhaps try downloading again?

Re: Grid Generator
From:  Andrew A.
Date:  26. March 2015, 05:54

Now I has download this version:

grid_generator_alts.zip

Now error is:

Error 22: Palette does not have a constructor.
Line: 206

  • > var palette = new palette('Grid Generator', components,values);"

This script not compatible with CS3?

Re: Grid Generator
Date:  26. March 2015, 09:26

Scriptographer is compatible with CS3

  • and the Palette function exists in that release

Please see the download page http://scriptographer.org/Download
and reload the CS3 instance of Scriptographer in case that has been damaged

Re: Grid Generator
From:  Andrew A.
Date:  26. March 2015, 10:26

Thank you for patience.)
I run the grid generator at lst and it work great!!! Thanks again for your support and great code!

Re: Grid Generator
Date:  22. April 2015, 15:30

Alteration to allow spec of sizes in inches and millimeters
Also a couple of fixes to the rectangle process.

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19