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

Measuring the Longest side of closed rectangular paths

New Here ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

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
Scripting , Tools

Views

380

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
community guidelines

correct answers 1 Correct answer

Community Expert , 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

...

Votes

Translate

Translate
Adobe
Community Expert ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

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.

Votes

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
community guidelines
New Here ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

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.

Votes

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
community guidelines
New Here ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

Copied

LengthLines.jpg

Votes

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
community guidelines
Community Expert ,
Feb 08, 2022 Feb 08, 2022

Copy link to clipboard

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.

 

Votes

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
community guidelines
New Here ,
Feb 09, 2022 Feb 09, 2022

Copy link to clipboard

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

Votes

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
community guidelines
Community Expert ,
Feb 09, 2022 Feb 09, 2022

Copy link to clipboard

Copied

For my part you are welcome, Lucas.

 

Votes

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
community guidelines
Community Expert ,
Feb 09, 2022 Feb 09, 2022

Copy link to clipboard

Copied

Can you share this Illustrator file with the red objects?

 

Votes

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
community guidelines
New Here ,
Feb 10, 2022 Feb 10, 2022

Copy link to clipboard

Copied

Find attached Kurt 

Votes

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
community guidelines
New Here ,
Feb 10, 2022 Feb 10, 2022

Copy link to clipboard

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

Votes

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
community guidelines
Community Expert ,
Feb 10, 2022 Feb 10, 2022

Copy link to clipboard

Copied

Lucas,

 

You will have to upload it somewhere and post a link.

 

Votes

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
community guidelines
Guide ,
Feb 09, 2022 Feb 09, 2022

Copy link to clipboard

Copied

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

 

femkeblanco_0-1644444036681.png

 

Votes

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
community guidelines
New Here ,
Feb 09, 2022 Feb 09, 2022

Copy link to clipboard

Copied

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

Votes

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
community guidelines
Guide ,
Feb 10, 2022 Feb 10, 2022

Copy link to clipboard

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?

femkeblanco_0-1644523684304.png

Or this?

femkeblanco_1-1644523706611.png

 

Votes

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
community guidelines
New Here ,
Feb 10, 2022 Feb 10, 2022

Copy link to clipboard

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.

Votes

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
community guidelines
Community Expert ,
Feb 17, 2022 Feb 17, 2022

Copy link to clipboard

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?

 

Votes

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
community guidelines
Advocate ,
Feb 18, 2022 Feb 18, 2022

Copy link to clipboard

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

longueur.png

Exemple 2

longueur1.png

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.

 

Votes

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
community guidelines