Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Illustrator script that resizes/changes object Height to the same as object Width

New Here ,
Oct 22, 2021 Oct 22, 2021

Hi,

 

For a design im making i have multiple circles or ellipses that are of varied sizes - id like to change the height to equal the width so that all are perfect circles. 

Is there any script out there that you know of that can help do this? 

 

Is this possible?  ThanksScreenshot 2021-10-22 at 19.41.59.png

TOPICS
Scripting
574
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 22, 2021 Oct 22, 2021
function makeOvalsIntoPerfectCircles()
{
	var doc = app.activeDocument;
	var items = doc.pageItems;

	var centerPoint;

	var curItem;
	for(var x=0;x<items.length;x++)
	{
		curItem = items[x];
		centerPoint = [curItem.left + curItem.width/2,curItem.top - curItem.height/2];
		curItem.height = curItem.width;
		curItem.position = [centerPoint[0] - curItem.width/2,centerPoint[1] + curItem.height/2];
	}
}
makeOvalsIntoPerfectCircles();
Translate
Adobe
Community Expert ,
Oct 22, 2021 Oct 22, 2021
function makeOvalsIntoPerfectCircles()
{
	var doc = app.activeDocument;
	var items = doc.pageItems;

	var centerPoint;

	var curItem;
	for(var x=0;x<items.length;x++)
	{
		curItem = items[x];
		centerPoint = [curItem.left + curItem.width/2,curItem.top - curItem.height/2];
		curItem.height = curItem.width;
		curItem.position = [centerPoint[0] - curItem.width/2,centerPoint[1] + curItem.height/2];
	}
}
makeOvalsIntoPerfectCircles();
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 22, 2021 Oct 22, 2021

 Works and has amazed me and i send you a huge huge thank you DilliamWowling - a gentleman to the extreme

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2021 Oct 22, 2021

And it works for rectangles too!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2021 Oct 22, 2021

My versatility and genius are unmatched. That's why they pay me the big bucks....

 

🤔😐😳😢😭

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2021 Oct 22, 2021

That is probably true for most of us 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2021 Oct 22, 2021
LATEST
quote

My versatility and genius are unmatched. That's why they pay me the big bucks....

 

🤣🤣🤣🤣 8)

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