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.
Copy link to clipboard
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.
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.
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.
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
For my part you are welcome, Lucas.
Copy link to clipboard
Can you share this Illustrator file with the red objects?
Find attached Kurt
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."
You will have to upload it somewhere and post a link.
Is this one path or many separate rectangles lying close together?
That is one path. It actually originally was many unconnected next to each other. I then redrew those so they were continuous.
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?
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.
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?
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
Cela pourrait-il vous convenir
Je suis curieux de connaître le but de ce processus ?
PS dans les listes individuelles les valeurs sont arrondies 2 chiffres après le virgule.