copy length or distance

Any question about CaRMetal.
Post Reply
dvs1
Posts: 4
Joined: Mon Sep 01, 2014 7:10 am

copy length or distance

Post by dvs1 » Mon Sep 01, 2014 7:14 am

Is there a way to copy the length of a line segment, and/or the distance between two points?

User avatar
Dibs
Posts: 112
Joined: Tue Apr 24, 2012 2:15 am
Location: Pau

Re: copy length or distance

Post by Dibs » Mon Sep 01, 2014 8:34 pm

Hello,
About the length of a segment, there's a convention when it is used in an expression (I presume this is where you want to "copy") :

the name of the segment is interpreted as its length. For example, if the segment is called s1, then you can use s1 in an expression to get its length.
And its the same idea for polygons, the name in an expression giving its area.

For the length, you can also use the notation d(A,B) to get the distance between points called A and B.

dvs1
Posts: 4
Joined: Mon Sep 01, 2014 7:10 am

Re: copy length or distance

Post by dvs1 » Mon Sep 01, 2014 9:19 pm

Thank you. That is useful to know.
However, I want to copy it to the clipboard, so I can use the number in other programs.

dvs1
Posts: 4
Joined: Mon Sep 01, 2014 7:10 am

Re: copy length or distance

Post by dvs1 » Mon Sep 01, 2014 9:29 pm

I just realized the numeric tab of the properties panel gives a length you can copy.
However, it doesn't show that number (or box that it is in) when
I create a line segment that requires me to choose between two intersections at the same location.

User avatar
Dibs
Posts: 112
Joined: Tue Apr 24, 2012 2:15 am
Location: Pau

Re: copy length or distance

Post by Dibs » Mon Sep 01, 2014 10:31 pm

I'm not sure to understand precisely what you mean.

To get the numeric value of the length of a segment which is called s1, you can create an expression whose value is s1.
This expression will display the numeric value.

And if you had to treat this value in a Javascript program, you could create a script and use GetExpressionValue("E1"), where E1 is that expression.

Hope that can hep.

dvs1
Posts: 4
Joined: Mon Sep 01, 2014 7:10 am

Re: copy length or distance

Post by dvs1 » Mon Sep 01, 2014 11:33 pm

It displays segment length in the left panel as well;
but I want to copy the number to use outside of CarMetal.
I want to paste the number into Firefox and other programs...
The perfect solution would be a tool that
copies the distance between two points after you click on them.

Post Reply