Illustrator script to specify the dimensions of single or multiple objects, or to specify the dimensions between two objects.
To allow the script to show as an option within the default
Scripts
menu, save the script in the following location (path shown is for Mac. Your actual path may vary)Applications > Adobe Illustrator [YOUR VERSION] > Presets > en_US > Scripts
Alternatively, you may save the script in a folder of your choosing.
- Must have an open document in Illustrator
- Must have at least 1 object selected via Illustrator's Selection Tool (V) or Direct Selection Tool (A)
If you saved the script as described above, you should be able to run the script (after selecting object(s) in the document) by navigating within Illustrator to:
File > Scripts > Specify
If you chose an alternate location to save the script, you may run by using the following path, and selecting the script file once you navigate to your designated folder:
File > Scripts > Other Script...
After choosing to run the script, you will be presented with a dialog that allows you to choose which dimension(s) to specify. The dialog also allows you to edit the default options. Any changes to the options panel will persist until you close the application (even if you run the script in another document).
Select a single object (or group) or multiple objects on your artboard and run the script within Illustrator.
With a single object or multiple objects selected, the script will display a dialog box allowing you to choose which sides to dimension for all objects simultaneously, as well as customizable options. Click 'Specify Object(s)' and the script will output the selected dimensions to the SPEC layer (which is automatically created if needed).
Select two objects and run the script within Illustrator.
With two objects selected, the script will display a new option within the dialog box, Dimension between objects. When checked, this option will specify the selected dimension(s) between the two chosen objects.
Users may define the scale of the artwork/document being designed. For example, if you are designing an engineering drawing at 1/4 scale (or 1:4), you simply choose this ratio from the Scale dropdown menu, and then optionally enable a Custom Units Label that corresponds to the unit labels to output.
The script automatically dimensions objects based on the Document's default units. To dimension in different units (i.e. Inches, Centimeters, etc.) follow the instructions below:
- In your document, select show Rulers via
View > Rulers > Show Rulers
( ⌘Cmd + R on Mac, Ctrl + R on PC )- Right click on the Ruler, and select your desired units. Otherwise, the script will use the Document's selected units by default.
- Run the script and you will now get output as shown in the example below
The units label is optional. A checkbox is included in the Specify dialog box that allows the user to turn the units label on or off.
Units Label On:
220.00 px
Units Label Off:
220.00