Highlighted

Anyone know a way to subtract a specific amount from the size of all objects selected?

New Here ,
Jul 15, 2020

Copy link to clipboard

Copied

I have a file filled with objects at a specific size which need scaling in a way which reduces 9mm from the top and bottom of each individual object. I thought i could select all objects and type -9 in the transform size tab but this just re sizes everythihng to -9mm. I am not great with maths so perhaps there is an equation to work out the perentage needed so i can scale using the transform scale function but the problem with this is that there is a gap between each object and the scale function takes these gaps into account meaning it is impossible to get it to re size the shapes to the specific sizes (I think). Hopefully I have explained this properly. Does anyone know if what im trying to achieve is possible? If not I will just have to redraw the file from scratch using the altered dimensinos.

 

Perhaps this can be done with an action or script? Or am I overcomplicating this?

 

Any help is appreciated!

 

Thanks,

- Jake

TOPICS
Draw and design, Feature request, How to, Scripting, Third party plugins, Tools

Views

169

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Anyone know a way to subtract a specific amount from the size of all objects selected?

New Here ,
Jul 15, 2020

Copy link to clipboard

Copied

I have a file filled with objects at a specific size which need scaling in a way which reduces 9mm from the top and bottom of each individual object. I thought i could select all objects and type -9 in the transform size tab but this just re sizes everythihng to -9mm. I am not great with maths so perhaps there is an equation to work out the perentage needed so i can scale using the transform scale function but the problem with this is that there is a gap between each object and the scale function takes these gaps into account meaning it is impossible to get it to re size the shapes to the specific sizes (I think). Hopefully I have explained this properly. Does anyone know if what im trying to achieve is possible? If not I will just have to redraw the file from scratch using the altered dimensinos.

 

Perhaps this can be done with an action or script? Or am I overcomplicating this?

 

Any help is appreciated!

 

Thanks,

- Jake

TOPICS
Draw and design, Feature request, How to, Scripting, Third party plugins, Tools

Views

170

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 15, 2020 0
Adobe Community Professional ,
Jul 15, 2020

Copy link to clipboard

Copied

The script Set all the things might help.

https://github.com/johnwun/js4ai

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 15, 2020 1
New Here ,
Jul 15, 2020

Copy link to clipboard

Copied

Thanks for this. I just tried it out but unfortunatley won't quite do the job as the script only allows me to set everything to a specific size and will not let me subtract an amount from the current size. I tried putting -9 in the value for width and height but it just said it was an invalid entry and needs to be above the minimum amount. Aprreciate the suggestion though. 🙂

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 15, 2020 0
Adobe Community Professional ,
Jul 15, 2020

Copy link to clipboard

Copied

Which version of Illustrator are you using?

 

Can you share a sample .ai file with some instructions?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 15, 2020 0
Adobe Community Professional ,
Jul 15, 2020

Copy link to clipboard

Copied

yes please share a sample file if possible.

 

do you need to resize to -9mm vertically? Horizontal measurement will adjust accordingly

 

what kind of objects are you dealing with?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 15, 2020 0
Most Valuable Participant ,
Jul 15, 2020

Copy link to clipboard

Copied

Jake,

 

As I (mis)understand it, you can select all and then use Object>Transform>Transform Each, inserting the following value in the Vertical Scale: start with the desired resulting height which is the original height minus 9 and mulitply by 100 (you can just add 00 or move the decimal point two places to the right) then add / and then add the original height.

 

If you wish proportional scaling just use the same value for Horizontal Scale.

 

If you wish unchanged width just leave the Horizontal Scale at 100%.

 

To illustrate: if your objects have a height of 144, you start with 144 - 9 = 135 which you multiply by 100 and get 135 * 100 = 13500 which you insert in the Vertical Scale box, and then you add / and 144, so the full insertion is 13500/144, which will show up as 93.75% in the box when you click the Horizontal Scale box. You can just copy either 13500/144 or 93.75 to the Horizontal Scale box.

 

All this is based on the fact that Illy (job description Adobe Illustrator) can do one operation with + or - or * or /).

 

 

If you want 9 cut off at both top and bottom you will need to subtract 18 (2 * 9 = 18) of course.

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 15, 2020 0
Engaged ,
Jul 15, 2020

Copy link to clipboard

Copied

This should vertically scale down selected objects 9 mm from top and 9 mm from bottom. 

 

for (var i = 0; i < selection.length; i++) {
  var percentage = ((selection[i].height - (9*2*2.835)) / selection[i].height) * 100;
  selection[i].resize(100, percentage, true, false, false, false, 0, selection[i].scaleAbout = Transformation.CENTER);
}

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 15, 2020 0
Contributor ,
Jul 16, 2020

Copy link to clipboard

Copied

Nice!

 

Does the selection[i].scaleAbout = Transformation.CENTER mean anything special? I normally use just the constant on it's own as the parameter.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 16, 2020 0
Engaged ,
Jul 16, 2020

Copy link to clipboard

Copied

No, that's just me not knowing how to use constants as arguments.  Thanks.  

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 16, 2020 1
Adobe Community Professional ,
Jul 16, 2020

Copy link to clipboard

Copied

hahaha

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 16, 2020 0