Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

Sample image Image is taken from this site.

Is there a way in Illustrator to draw a group of rectangles like this without having to draw them one by one? The idea is to divide the area into as many rectangles of size 100x50 which have a 10 gap between them. Is there something automatic to make this happen?

share|improve this question

6 Answers 6

up vote 6 down vote accepted

This can be done fairly easily with Illustrator's Object->Transform->Move and Object->Transform->Transform Again cmd+D

First, draw the shape, then go to Object->Transform-Move option window.

enter image description here

Turn on Preview and put in a horizontal value so you get the ideal margin between the 2 shapes. In your case, 10px. Hit Copy Now just keep hitting Cmd+D until you have enough shapes for one row.

Then group cmd+g all the shapes in the row, and do the same in the Move option. Except for this time you're giving 0 for Horizontal value, and enter the appropriate vertical value instead. Keep hitting CMD+D until you have enough rows.

share|improve this answer
    
This is good if you know numerically the exact distance apart that you want the objects to be. My option below might be easier if you want to adjust the layout visually. –  user568458 Apr 9 '12 at 14:29
    
@user568458 I definitely like your answer better! –  Jin Apr 9 '12 at 14:35
    
Thanks :) you'll probably like the edit I did adding 3rd section too –  user568458 Apr 9 '12 at 14:43

Late answer, but there is a much simpler way...

  1. Create your comp that will be used as a tile -- in this case, a rounded rectangle surrounded by a transparent rectangle that affords 5pt padding on each side.

    Base pattern tile

  2. Drag the shapes to the swatches window to create a new pattern swatch

    Pattern swatch

  3. Use this pattern swatch as the fill on a shape.

    Pattern fill

Pattern swatches are really cool if you have uniform repetition. You don't have to worry about making sure every object is spaced properly; even if you use multiple shapes, AI will happily align the fills. If you need discrete objects, you can always expand the fill later.

There are some pretty cool examples of more powerful transforms at The Power (and ease) of Patterns in Illustrator.

share|improve this answer
    
Huh, pretty neat when you know exactly how much padding you need. I didn't know creating pattern swatches was so easy. I'd probably use my technique while eyeballing and tweaking what size of tile and amount of padding looks best, then switch to this technique if applying the pattern to complex shapes. –  user568458 Apr 9 '12 at 14:58
    
@user568458 Yeah... it's too bad the pattern swatch doesn't work with Symbols (at least as of CS3. I'm not sure about the newer versions.) –  Farray Apr 9 '12 at 16:05

Maybe I'm missing something here. Seems like a perfect case for a transform effect. Build your base rectangle then choose Effect > Distort & Transform > Transform. Set up either your horizontal or vertical dupes (move number + number of copies), accept, then do it one more time for the other direction.

The nice thing about this method is that you can adjust just one rectangle and affect the whole lot of 'em. If you need to resize it, you make your changes then go back to the Attributes panel to update the coordinates. I use it all the time when I'm playing around with grids in Illy.

share|improve this answer
    
Nice tip! There's loads of potential for other cool effects here too that aren't possible my way, like slanted or curved grids by setting horizontal and vertical in one effect or adding a rotation. I need to spend more time exploring Illy's effects! –  user568458 Apr 9 '12 at 15:16
1  
When you start playing around with stacked effects things get big. And don't forget that you can rearrange them in place. The options are so vast that it's a little hard to take it all in ;) –  plainclothes Apr 9 '12 at 15:27

I'd actually use the Split into Grid and an Effect to generate a lot of rounded rectangles of equal size and spacing quickly. Then expand appearance to have standard objects.

Rounded Rectangles

share|improve this answer

So there's three parts to this question: 1) Fast copying of objects, 2) Lining up row, 3) making these objects show appropriately spaced 'chunks' of an image. The good news is you can do the whole thing in about 20 seconds.

1) The fastest way to copy loads of the same thing in illustrator is: hold down alt+arrow key, and it creates and selects a copy nudged one unit in that direction. (it's alt on Windows, on a Mac it might be alt or maybe option?) Hit alt+right arrow 10 times and you'll get 10 copies all perfectly vertically aligned, almost on top of each other (holding shift as well gives more space)

2) To line them all up evenly in a row, a fast easy way to space them perfectly is to drag the far-most one to where you want the row to end, select all of them, open the awesome and underrated Align window (Window > Align), and hit the Horizontal distribute space button.

enter image description here

You can easily adjust the amount of spacing using this method: simply adjust the position of the far object, and/or delete or copy objects from the middle, and/or resize all, select the row and hit the button again, and it'll space them perfectly for you again. Repeat until you've got it looking just how you want it right.

When it's how you like it, you can then select this whole row, group it, and do the same thing vertically: hit alt-uparrow 3 times, drag the top row to the right place, select the rows, hit Vertical distribute space, tweak until it looks right, then select all four groups, ungroup, and delete those objects you don't need.

This is probably the fastest way [edit: second fastest, after plainclothes' excellent technique] - the whole task can take a few seconds, including tweaks and adjustments.

There are other ways too. It's almost as fast to create then expand a fixed-distance or fixed-number blend between two objects horizontally, then again between two groups vertically: doing so also gives you the option of having something change or fade gradually between each object, like colour, opacity or shape. That's a seperate topic, but here's a neat example of the basic principle (plus other stuff) if you're interested.

3) To easily get the effect in the linked image, stick your grid of objects on top of a placed image. Select them all and make them into a compound path (object menu, or ctrl+8). Select this compound path and the image, underneath, and create a clipping mask (object menu, or ctrl+7). Magic!

enter image description here

(I included some expanded text here as well, purely because it looks cool. Note that you need to expand text into fixed paths (object menu) and include it in the composite path in order to use it in a clipping mask like this)

share|improve this answer

Draw one of them. Then, cut, paste, align. Repeat as needed.

share|improve this answer
    
:)) best answer. the other answers are for lazy people :P –  Flavius Frantz Oct 17 '12 at 21:08
2  
why the downvotes? –  DA01 Oct 17 '12 at 21:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.