I trying to get the properties for a line to use as input for changing the line.
Some of the values do not come as an object that I am able to use directly.
“line.lineType” gives [object LineType: 1]
“line.points” gives [object Point: (100.0, 150.0)],[object Point: (300.0, 200.0)]
How can I get the values as int, array or objects?
I am creating a small plugin.
One usage I have is to check if the line is Curved, then add two new midpoints,
Now I am getting the points by doing a split of the string and convert the string to int.
“coord = (String(line.points).split(’(’).pop().split(’)’).shift()).split(’,’)”
I am looking for a better method and hopefully get the values directly.
Which property/object have I missed?
Lines that connect 2 graphics do not have any geometry except for that it connects 2 graphics. That is why you can move objects and the lines grow or shrink to accommodate them. In this case, a Line is a graphic which is a vector, potentially connecting two other graphics at its head and tail ends.
See https://omni-automation.com/omnigraffle/lines-00.html for some examples of how to get all of the lines in a document. I hope that will help with the connecting lines, but differentiating when you have a stand alone Line defined by it’s geometry (so no connections) and when you have a line defined by it’s head and tail connections might be useful to think about.