Skip to main content
McCready1982
Known Participant
January 27, 2020
Question

Automatically set margins for rectangles around multiple objects.

  • January 27, 2020
  • 2 replies
  • 724 views

I would like to create an Illustrator macro that draws a rectangle around an object while maintaining a specified margin of distance between object and border--regardless of the object's size.

Does anyone know if this is possible?

This topic has been closed for replies.

2 replies

Kurt Gold
Community Expert
Community Expert
January 27, 2020

You may select one of the (linked) objects and then:

 

- In the Appearance palette, add a new stroke.

- Highlight the new stroke item in the palette.

- Effect > Convert to Shape > Rectangle: Choose the desired relative width and height settings.

- While the object is selected, go to the Graphic Styles palette and create a new graphic style out of it.

- Now you can select multiple objects and apply the style in one whack.

McCready1982
Known Participant
February 4, 2020

I appreciate your answer, Kurt. However, I performed these steps and I must be misinterpreting a step.

 

First, I create a new stroke.

Next, I select Effect > Convert to Shape > Rectangle. Default settings are fine, so I click OK.

But when you say "while the object is selected," what object do you mean? Other than the vector drawing I have open, I have not yet created an oject.

 

I haven't used the Appearance or Graphic Styles palettes very often, so my knowledge is limited.

 

Kurt Gold
Community Expert
Community Expert
February 4, 2020

Without seeing one of your files it is rather difficult to tell what is going wrong.

 

Can you share a sample file and – if required – include some further instructions?

Kurt Gold
Community Expert
Community Expert
January 27, 2020

There may be several ways to do that.

 

Which version of Illustrator are you using? Also, can you specify what you mean by "object"? Any kind of object? Specific objects? Or something else?

McCready1982
Known Participant
January 27, 2020

Hi Kurt,

I am using Illustrator 24.0.2.

By "object," I mean vector drawings in an EPS file.