*Setting Up Rectangular Grid in Adobe® Illustrator®
 
 
overview of colored rectangular grid

The alignment grids in Adobe® Illustrator® (View > Show Grid) are non-printing grid-lines, customizable by the user, to aid in layout and design. It's great for alignment and designing. Unfortunately, by default Adobe® Illustrator® allows you to specify only square grids, i.e. you set one parameter for gridline spacing (and one for its subdivisions) and Ai creates square grid applying your value for both: horizontal and vertical directions. But what if we need something more, for example 16:9 proportion grid (subdivided into 4 and 3)? Hmm….  actually… we can do this!

// Option 1: Modifying the default Ai Preferences File
// Editing Preferences: Windows

Go to Edit > Preferences > Guides & Grid…
Set Gridline every to 16 (I use pixels as my primary unit, but this could be anything else), and Subdivisions to 4. Set Color Attribute to Red (RGB 255, 0, 0)

// Editing Preferences: Mac OS X

Go to Illustrator > Preferences > Guides & Grid…
Set Gridline every to 16, and Subdivisions to 4. Set Color Attribute to Red (RGB 255, 0, 0)

ai preferences guides and grid
Now Quit Adobe® Illustrator®.
// Locating the Ai Preferences File: Windows
*Note: The AppData  folder located under C:\Users\[User Name] is hidden by default. To access it you need to set the ‘Show hidden files, folders and drives’ option (under ‘Folder Options’). If you are not familiar with advanced Windows settings, this should help: 
Windows 7: http://windows.microsoft.com/en-us/windows/show-hidden-files#show-hidden-files=windows-7
Windows 8: http://blogs.msdn.com/b/zxue/archive/2012/03/08/win8-howto-19-show-hidden-files-folders-and-drives.aspx
show hidden files and folders

Ai CS6 (32-bit)
File Name: AIPrefs, File Location:

C:\Users\[User Name]\AppData\Roaming\Adobe\Adobe Illustrator CS6 Settings\[language]\x86\

Ai CS6 (64-bit)
File Name: AIPrefs, File Location:

C:\Users\[User Name]\AppData\Roaming\Adobe\Adobe Illustrator CS6 Settings\[language]\x64\

Ai CC (32-bit)
File Name: Adobe Illustrator Cloud Prefs, File Location:

C:\Users\[User Name]\AppData\Roaming\Adobe\Adobe Illustrator 17 Settings\[language]\x86

Ai CC (64-bit)
File Name: Adobe Illustrator Cloud Prefs, File Location:

C:\Users\[User Name]\AppData\Roaming\Adobe\Adobe Illustrator 17 Settings\[language]\x64

// Locating the Ai Preferences File: Mac OS X

Ai CS6
File Name: Adobe Illustrator Prefs, File Location:

/Users/[User Name]/Library/Preferences/Adobe Illustrator CS6 Settings/[language]

*Note: To access the folder, go to Finder > Go > Go to Folder, and type:

~/Library/Preferences/Adobe Illustrator CS6 Settings/en_US

go to folder ai CS6 (mac)

Ai CC
File Name: Adobe Illustrator Cloud Prefs, File Location:

/Users/[User Name]/Library/Preferences/Adobe Illustrator 17 Settings/[language]

*Note: To access the folder, go to Finder > Go > Go to Folder, and type:

~/Library/Preferences/Adobe Illustrator 17 Settings/en_US

go to folder ai CC (mac)
// Locating the Ai Preferences File: Operating System Independent

Instead of digging in your hard drive, you can use the Doc Revealer Tool (free copy available here). Just go to its interface and hit the Preferences button.

doc revealer UI

This automatically reveals the Adobe® Illustrator® Preferences folder where Illustrator®  stores the AIPrefs (Illustrator® CS6, Windows) or Adobe Illustrator Cloud Prefs (Illustrator® CC, Windows) or Adobe Illustrator Prefs (Illustrator® CS6, Mac OS X) or Adobe Illustrator Cloud Prefs(Illustrator® CC, Mac OS X).

// Opening the Ai Preferences File for editing

Since the Ai Preferences File is a plane text file you can open/edit it with any text editor, for example Notepad (Windows) or TextEdit (Mac OS X)
Windows: Right Click on the File > Open With > select (for example) Notepad
Mac OS X: Right Click on the File > Open With > Other… > Applications > choose (for example) TextEdit.app

// Modifying the Ai Preferences File

Find the Grid record in your file. It starts with the /Grid keyword. This should be something like this:

/Grid {
     /Color {
          /Dark {
              /r 1.0
              /g 0.0
              /b 0.0
          }
          /Lite {
              /b 0.5
              /g 0.5
              /r 1.0
          }
     }
     /Style 0
     /Posn 1
     /Vertical {
          /Ticks 4
          /Spacing 16
     }
     /Horizontal {
          /Ticks 4
          /Spacing 16
     }
}

The Grid shape is controlled with two variables: Vertical and Horizontal. Each variable has two attributes: Ticks (stands for Subdivisions) and Spacing (for Gridline every). We can modify these settings and set it to whatever we like. We change the Vertical spacing to 9 with 3 subdivisions:

/Vertical {
     /Ticks 3
     /Spacing 9
}
/Horizontal {
     /Ticks 4
     /Spacing 16
}

The Color has also two variables: /Dark and /Lite. The Dark one refers to the color we’ve already set via Adobe® Illustrator® Preferences Dialog Box RGB 255, 0, 0:

1.0 = 255/255

Now, we will modify set Lite color (subdivisions) to, let’s say light blue RGB 187, 209, 255:

187/255=0.73333333
209/255= 0.81960784
255/255=1.0

     /Color {
          /Dark {
               /r 1.0
               /g 0.0
               /b 0.0
          }
          /Lite {
               /r 0.73333333
               /g 0.81960784
               /b 1.0
          }
     }

That’s it! Save and Close your file.
*Note: Make sure the file is closed before you start Ai

// Verifying your settings

Launch Adobe® Illustrator®. Go to File > New
Go to View > Show Grid
16 : 9 with 4:3 subdivisions Grid should appear. Here is my result:

overview of colored rectangular grid
// Option 2: Modifying the *.ai file

The method described above overrides the default settings. These settings are only applied to the new *.ai files. But what if we need to modify the grid in one of our existing project file? This is also possible!

// New *.ai file

Create a new file.  Go to Edit (windows)/Illustrator (mac) > Preferences > Guides & Grid…
Set Gridline every to 16 (I use pixels as my primary unit, but this could be anything else), and Subdivisions to 4. Set Color Attribute to Red (RGB 255, 0, 0). Then go to View > Show Grid

ai new file with red square grid shown
// Saving As Uncompressed File

Now, go to File > Save As…
Make sure that the Use Compression option is not checked!

ai save as uncomressed dialog
// Editing the *.ai file

Now close your file and locate it in your hard drive. Since the uncompressed *.ai is a plane text file you can edit it with any text editor, for example Notepad (Windows) or TextEdit (Mac OS X). Open the *.ai file in your text editor and find the second occurrence of the following line:

%AI7_GridSettings:

In my case this is line number 10828 and looks like this:

<</Length 65536>>stream
%!PS-Adobe-3.0
%%Creator: Adobe Illustrator(R) 17.0
%%AI8_CreatorVersion: 18.0.0
%%For: (Pawel Kuc) ()
%%Title: (grid.ai)
%%CreationDate: 7/26/2014 2:03 PM
%%Canvassize: 16383
%%BoundingBox: 0 0 0 0
%%HiResBoundingBox: 0 0 0 0
%%DocumentProcessColors:
%AI5_FileFormat 13.0
%AI12_BuildNumber: 18
%AI3_ColorUsage: Color
%AI7_ImageSettings: 0
%%RGBProcessColor: 0 0 0 ([Registration])
%AI3_Cropmarks: 0 -980 700 0
%AI3_TemplateBox: 350.5 -490.5 350.5 -490.5
%AI3_TileBox: 56 -874 644 -106
%AI3_DocumentPreview: None
%AI5_ArtSize: 14400 14400
%AI5_RulerUnits: 6
%AI9_ColorModel: 1
%AI5_ArtFlags: 0 0 0 1 0 0 1 0 0
%AI5_TargetResolution: 800
%AI5_NumLayers: 1
%AI9_OpenToView: 166 -501 8 1829 1083 18 0 0 46 111 1 1 0 1 1 0 1 1 0 0
%AI5_OpenViewLayers: 7
%%PageOrigin:-50 -790
%AI7_GridSettings: 16 4 16 4 1 0 1 0 0 1 0.5 0.5
%AI9_Flatten: 1
%AI12_CMSettings: 00.MP
%%EndComments
%%BeginProlog
%%EndProlog
%%BeginSetup
%AI5_Begin_NonPrinting

The first two numbers stand for Horizontal Spacing and Ticks, then goes Vertical Spacing and Ticks, then Dark Color in RGB format (3 numbers) and finally the Light Color (last 3). We modify Vertical Spacing/Ticks and Light Color (as described in the previous example).

But be careful with that! The size (length in characters) of the file is fixed. And each record of that file has its fixed length. You cannot add or remove any character! We replace our original line:

%AI7_GridSettings: 16 4 16 4 1 0 1 0 0 1 0.5 0.5

with:

%AI7_GridSettings: 16 4 09 3 1 0 1 0 0 0.7 0.8 1

As you see the length (including the white spaces) of the new line equals the original one.
That’s it! Save and Close your file.
*Note: Make sure the file is closed before you start Ai

// Verifying your settings

Open your file in Adobe® Illustrator®, the result should be like this:

overview of colored rectangular grid editing ai file

// Note
Now you can set the Use Compression option back to checked. Just save your file once again: File > Save As…

// author: