This question came up on my user group forum, and I thought it might be of interest to some here.
I refer to Adobe Illustrator (2018) here.
The question was - how do I calculate the area of an open curve? Some discussion ensued, and one user commented that an open curve does not have an area… but if you choose to fill the open curve, you will see that it does.
In early versions of Illustrator you could bring up something called an “Object Tree” by opening the DeBugging palette - Command+Option+Shift+F12. But trying this, nothing happened. The Properties panel provides width, height and X- and Y-axis info. But the area of a shape or open curve is not provided.
So not shying away from a challenge, this is what I came up with:
- I opened TextEdit (NotePad for PC folks). I chose Format > Plain Text.
- Paste this code into the document: alert("Area & Length (inches)\nArea: " + (Math.abs(app.activeDocument.selection.area/5184).toFixed(3)) + "\nLength: " + (app.activeDocument.selection.length/72).toFixed(3));
- For reference: this script came from: http://blog.k8baldwin.com/Finding-areas-and-lengths-in-Illustrator-td4.html
- Save the script as “AreaLength.JS”.
- In Illustrator, create the desired shape or curve. Select it.
- File > Scripts and choose the script you just made. The length and area will be displayed. For an example, see here: http://karenackoff.net/z-misc/calculate-area.png
I’m sure with some tweaking the script could be adapted further. But I thought it was a nifty trick.