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

CS6: Measure a shape’s area?

Engaged ,
Jan 05, 2013 Jan 05, 2013

Hi there!

With Illustrator CS6, is there a way to measure/calculate the enclosed area of a given vector shape?

Thanks

Klaus

24.6K
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
Adobe
Community Expert ,
Jan 05, 2013 Jan 05, 2013

Klaus,

I hope this thread will help you.

http://forums.adobe.com/message/4742474#4742474

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
Engaged ,
Jan 05, 2013 Jan 05, 2013

I’ve read that before, but it did not actually help me.

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 ,
Jan 05, 2013 Jan 05, 2013

why not? then what is it what you need?

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
Engaged ,
Jan 05, 2013 Jan 05, 2013

I need to know if there is a way to measure/calculate the enclosed area of a given vector shape with Illustrator CS6.

The mentioned thread mainly seems to list methods not compatible with CS6 – plus some sort of scripting approach (?) which is not compatible with me

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 ,
Jan 05, 2013 Jan 05, 2013

Then why don't you just ask how to handle scripts?

Copy the line of code into a text document (ASCII), save it as a .jsx in Illustrator program folder > Presets > Scripts, restart Illustrator and select from  File > Scripts.

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
Engaged ,
Jan 05, 2013 Jan 05, 2013

Thanks, Monika.

Had to alter the code, though, because none of the versions there prompted me with correct millimeter or square millimeter values.

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 ,
Jan 06, 2013 Jan 06, 2013

did they know at that time that 3 months later, Klaus was going to need square mm?

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
Engaged ,
Jan 06, 2013 Jan 06, 2013

Find it somewhat surprising that such an «area feature» isn’t included in the standard Illustrator features set – the Info window would just be perfect for that.

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 ,
Jan 06, 2013 Jan 06, 2013

Find it somewhat surprising that such an «area feature» isn’t included in the standard Illustrator features set

Indeed, Klaus.

And it is noteworthy that CS6 is the worst version in terms of hidden solutions and use of ready external means.

As a joke you could save the object in question, place it in a new document in 10 (the one before (the first version of) CS), apply the free Patharea filter from Telegraphics, and see the area.

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 ,
Apr 04, 2015 Apr 04, 2015

Hi! I also needed the area to be calculated into the metric system. To save some work for others that like me suffers from dyscalculia I publish my effort:

1. See the original script at github: Script to find the area of shapes in Adobe Illustrator

2. Change the divisor from 72 (ppi - pixels per inch) to 2.834645669291 (pixels per millimeter) [pixels acctually being "computer points"].

3. The last two parts of the original script was changed into this:

// Conversions   

  var ppMm = 2.834645669291;

  var areaInMm = Math.round((totalArea / ppMm / ppMm) * 100) / 100;

  if (areaInMm < 0) var areaInMm = -areaInMm;

  // Display

  alert('Shape Area\n' + areaInMm + ' square millimeters \n' + i + ' shapes');

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
Guest
Jun 08, 2013 Jun 08, 2013

I'm sorry to be so ignorant, but could someone please provide what precisely needs to be copied into the text document and saved as .jsx (in order to calculate the area of any given vector shape in Adobe Illustrator CS6)? I've tried several variations of the code from the above link, with and without the beginning "alert" and parenthesis, and with or without the closing semicolon, but am always getting a syntax error when I try to launch the script in Illustrator.

Thanks for your help.

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 ,
Jun 08, 2013 Jun 08, 2013

This is the line


alert("Area & Length\nArea: " + (app.activeDocument.selection[0].area/5184).toFixed(3) + "\nLength: " + (app.activeDocument.selection[0].length/72).toFixed(3));

This is for inches to 3 decimal places.

Copy the above and paste into a new window in either the ExtendScript Tool Kit (ESTK found in Applications/Utilities/Adobe Utilities) or in a text editor. If you use the text editor make sure you save it as plain text with a .jsx extension. Place it in the Application/Adobe Illustrator CSX/Presets/en_US/Scripts folder and restart. Open a file, select an object and run the script from File/Scripts.

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
Explorer ,
Nov 06, 2014 Nov 06, 2014

so it seems the area script will calculate the area of a simple shape, like a rectangle or a circle, but not a compound shape, or an odd shape like a letter (made with outline) or a donut shape....bummer...still on the hunt myself for this solution in CS6...

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 ,
Apr 09, 2015 Apr 09, 2015

None of these work for me, it just keeps giving me a syntax error. Why is this?

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 ,
Apr 09, 2015 Apr 09, 2015
LATEST

It works for me. I think the culprit could be your not saving it as really plain text, just changing the file ending is not enough.

Or that your actually have a syntax error.

The script is not mine, but I take liberty and attach my version of the entire script below.

But be aware that if you have too many and too complex shapes, the script does not calculate correct at all times.

Best regards, Alfred.

if (app.documents.length > 0) {

  if (app.activeDocument.selection.length < 1) {

  alert('Select a path first');

  } else if (app.activeDocument.selection[0].area) {

  // Individual Items

  var objects =  app.activeDocument.selection;

  } else if (app.activeDocument.selection[0].pathItems) {

  // Group/Compound Shape

  var objects = app.activeDocument.selection[0].pathItems;

  } else {

  alert('Please select a path or group.');

  }

  // Collect info

  var totalArea = 0;

  for (var i=0; i<objects.length; i++) {

  if (objects.area) {

  var totalArea = totalArea + objects.area;

  }

  }

  // Conversions

  var ppCm = 28.34645669291;

  var areaInCm = Math.round((totalArea / ppCm / ppCm) * 100) / 100;

  if (areaInCm < 0) var areaInCm = -areaInCm;

  // Display

  alert('Shape Area\n' + areaInCm + ' square centimeters \n' + i + ' shapes');

}





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