Highlighted

Dimension arrows in InDesign

Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Hello,

 

Is anyone aware of a script that will display the length of a line? It would be used to demonstrate height and width in layouts, like dimension arrows do in architectural drawings. I found _Jongware_'s very cool script labelImageSize, but I'd like to use lines that go from edge to edge of an area and are not based on an object.

Adobe Community Professional
Correct answer by Charu Rajput | Adobe Community Professional

Hey,

Because I am writing to the console, that's why Extended Toolkit get open. Try following

#target indesign
var length = app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1]
alert(length);

 

This will give length of a simple line and display on alert. Try executing this script after saving as a .jsx file.

I am not sure whether it will correct length for double-sided arrow, because I have not tried for double-sided arrow.

 

Topics

Scripting

Views

554

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

Dimension arrows in InDesign

Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Hello,

 

Is anyone aware of a script that will display the length of a line? It would be used to demonstrate height and width in layouts, like dimension arrows do in architectural drawings. I found _Jongware_'s very cool script labelImageSize, but I'd like to use lines that go from edge to edge of an area and are not based on an object.

Adobe Community Professional
Correct answer by Charu Rajput | Adobe Community Professional

Hey,

Because I am writing to the console, that's why Extended Toolkit get open. Try following

#target indesign
var length = app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1]
alert(length);

 

This will give length of a simple line and display on alert. Try executing this script after saving as a .jsx file.

I am not sure whether it will correct length for double-sided arrow, because I have not tried for double-sided arrow.

 

Topics

Scripting

Views

555

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
Adobe Community Professional ,
May 29, 2020

Copy link to clipboard

Copied

Hi,

I am not sure what exactly you mean in detail, but if you want length of simple line that you draw in Indesign, you can calcuate the length using geometricBounds property. Try following snippet and make sure your line is selected in Indesign before running the below code

 

var length = app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1]
$.writeln(length);

 

Let us know if this is what you required.

 

 

Best regards

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...
Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Thank you for your response, Charu. When I save the snippet as a .jsx file and run the script on a selected file, the ExtendScript Toolkit opens up, I assume to debug the script. I don't know very much about scripts, so probably I'm doing something wrong.

 

At any rate, here is the kind of thing I'm looking for:

 

Screen Shot 2020-05-29 at 11.51.58 AM.png

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...
Adobe Community Professional ,
May 29, 2020

Copy link to clipboard

Copied

Hey,

Because I am writing to the console, that's why Extended Toolkit get open. Try following

#target indesign
var length = app.selection[0].geometricBounds[3] - app.selection[0].geometricBounds[1]
alert(length);

 

This will give length of a simple line and display on alert. Try executing this script after saving as a .jsx file.

I am not sure whether it will correct length for double-sided arrow, because I have not tried for double-sided arrow.

 

Best regards

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...
Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Thank you, Charu, that did execute well:

Screen Shot 2020-05-29 at 1.23.08 PM.png

 

but what I'm looking for is to actually display the measurement on the layout, so that I can create a PDF showing the dimensions for different areas:

 

Screen Shot 2020-05-29 at 1.32.05 PM.png

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...
Adobe Community Professional ,
May 29, 2020

Copy link to clipboard

Copied

Ok, got it what you are looking. So, you have drawn this box using single lines. Well, this required more of scripting, If I have updated one, I will share with you soon.

 

Best regards

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...
Explorer ,
May 29, 2020

Copy link to clipboard

Copied

Thank you for your interest!

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...