Canvas line points

Hello, i try to export drawn lines on canvas to Rhino3d software using UDP.
to get the points i use (currentX,currentY) but the first point is missing and if i add (startX,startY) it duplicated for every movement.
my second question when i draw many separated lines, is there a way to know how to separate their points list? i try to solve that by adding color button ,but auto separation is better

canvas.aia (2.8 KB)

You should get that from the TouchDown event, and the “x” and “y” local variables.

Could you elaborate on this? I didn’t exactly understand what you’re trying to achieve.

How i can get that point and at the same time i use drag tool?


I draw two lines for example, in the screen i see 2 but the list created join all points together.
how i can create separated points lists based on their separated lines.
i actually use a solution by add color to every line and than separate than in the software based on the colors

How about you create a list of objects?
Each element of the list will be the lines that are in between a canvas touch down and a canvas touch up.

1 Like

Do you mean by line which created between 2 points?
because as you see in the video it’s not just a line between 2 points , it’s a curve or polyline which have many points.
When i draw with drag all points detected by previous and current X,Y ; how touch down/up can help here?
you can check the project attached in the first post

When touch down, you start a new object. When touch up, you close the current object. In between you record as you do now all the points. The only difference is that you create a separate list of points for each touch down event. That way you know which lines should be separated and which connected.

Do you mean instead of button i use touch down/up?

Any way you want, it’s up to you. I’m just giving you an idea on how to differentiate when you have to continue a line and when to connect it.

Actually i use similar mehod with button, i thought there is another trick or pre-existing method