• Measuring the Longest side of closed rectangular p...

# Measuring the Longest side of closed rectangular paths

New Here ,
Feb 08, 2022 Feb 08, 2022

Copied

Hi,

I have a number of paths that all closed and the width is arbitrary to fill a small pattern. I am attempting to find out the length of the longest side for each selection and then to total this length. Is this possible? Unfortunately you cannot use the Document Info on the Object, because it totals the perimeter of the shape. Effectively this would be like drawing an open path down the middle of each closed rectangle and then checking Document Info, but there are over a hundred and this would be too manual a task.

Thank you

TOPICS
How to , Scripting , Tools

Views

253

Likes

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 , Feb 08, 2022 Feb 08, 2022
Lucas, As I (mis)understand it (closed rectangles all with the same length of the shortest side), you ought to be able to get the total length of the selected rectangles LR as follows, using the number of selected rectangles N (number of paths in the Document Info), the total length of the perimeters L (length in the Document Info), and the length of the shortest side S (which you know: LR = L/2 - N*S, in other words divide the total length in the Document Info by 2 and subtract the length...

Likes

16 Replies 16
Feb 08, 2022 Feb 08, 2022

Copied

defaultk,

Still manual, but maybe easier and maybe the basic for an automated approach, you can (with the/each path deselected) click one of the longest sides with the Direct Selection Tool, then hold Ctrl/Cmd and press C then F then X then C, then read the length.

This is presuming the rectangles are at different angles and placed in non contiguos positions in all sorts of ways.

If there is some (repetitive/whatever) pattern, it may be much easier.

A few screenshots (please use the Insert Image button rather than attach) can help helpers.

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 08, 2022 Feb 08, 2022

Copied

Hi Jacob, I am attaching an image for you. These lines are all to scale on the artboard. There are a lot of them, so such a manual process will not work. I am attempting to find the total length of them all... the width is identical, but because they are technically measured as a perimeter, the usual method of Document Info does not work.

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 08, 2022 Feb 08, 2022

Copied

Likes

Report

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

Copied

Lucas,

As I (mis)understand it (closed rectangles all with the same length of the shortest side), you ought to be able to get the total length of the selected rectangles LR as follows, using the number of selected rectangles N (number of paths in the Document Info), the total length of the perimeters L (length in the Document Info), and the length of the shortest side S (which you know:

LR = L/2 - N*S,

in other words divide the total length in the Document Info by 2 and subtract the length of the shortest side multiplied by the number of objects in the Document Info.

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 09, 2022 Feb 09, 2022

Copied

Thank you Jacob, sadly the shortest side length is not always the same, it varies slightly from line to line, but it should give me an estimate at least. Thanks

Likes

Report

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

Copied

For my part you are welcome, Lucas.

Likes

Report

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

Copied

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 10, 2022 Feb 10, 2022

Copied

Find attached Kurt

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 10, 2022 Feb 10, 2022

Copied

For some reason I can't attach it, it keeps coming up with the error "The attachment's cracks.ai content type (application/postscript) does not match its file extension and has been removed."

Likes

Report

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

Copied

Lucas,

Likes

Report

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

Copied

Is this one path or many separate rectangles lying close together?

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 09, 2022 Feb 09, 2022

Copied

That is one path. It actually originally was many unconnected next to each other. I then redrew those so they were continuous.

Likes

Report

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

Copied

Measuring the sum of the lengths of rectangles is very easy with a script. But irregular polygons don't have a length in that sense.  For example, what is one to do in this case?

Or this?

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 10, 2022 Feb 10, 2022

Copied

I guess the script would need to identify if the 4 lengths of the perimeter are rectangular, namely, lengths are the same on both sides. If this is the case, then you would take just the longest length of each rectangle. In this case that would work if I had a script to do this, because every single one of my shapes is a rectangle.

Likes

Report

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

Copied

Lucas,

If you know they are rectangles there is no need; if not, all parallellograms will slip in,

Femke has already stated that "Measuring the sum of the lengths of rectangles is very easy with a script.", and I believe you just need to conform that you only have rectangles.

But you have already stated that some are not: "That is one path. It actually originally was many unconnected next to each other. I then redrew those so they were continuous."

Can you go back to a version of the document where you have only (unconnected) rectangles?

Likes

Report

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

Copied

LATEST

Bonjour à tous,

J'ai un script qui à partir des tracés sélectionnés (composés de segments de droite) réalise ce qui est montré dans les deux exemples suivants.

J'ai mis en rouge la longueur totale (somme des longueurs maxi de chaque objet)

ajouté les cadres et la cote de l'exemple 2

Exemple 1

Exemple 2

Cela pourrait-il vous convenir

Je suis curieux de connaître le but de ce processus ?

René

PS dans les listes individuelles les valeurs sont arrondies 2 chiffres après le virgule.

Likes

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Resources
Learning Resources for Illustrator
Crash on launch and known issues
Fonts and Typography in Illustrator