How to measure the distance of a polyline by only specifying start and end point

How to measure the distance of a polyline by only specifying start and end point

Anonymous
Not applicable
15,540 Views
9 Replies
Message 1 of 10

How to measure the distance of a polyline by only specifying start and end point

Anonymous
Not applicable

I have the structure below in which I would like to measure the distance between the two red points. I know I can measure it by the command (DIST), and by tapping on the corners until I reach the second point.

 

 

 

Untitled.PNG

 

I would like to know if there is another way of measuring the distance between the two points (ALONG the poly-line) by only specifying the the start and end points? I have 50+ of theses structures and I would love to use and easier method than using (DIST).

 

 

 

0 Likes
Accepted solutions (1)
15,541 Views
9 Replies
Replies (9)
Message 2 of 10

TheCADnoob
Mentor
Mentor
Accepted solution

Give this a shot :http://www.lee-mac.com/polyinfo.html

 

CADnoob

EESignature

0 Likes
Message 3 of 10

neaton
Advisor
Advisor

@Anonymous wrote:

 

I would like to know if there is another way of measuring the distance between the two points (ALONG the poly-line) by only specifying the the start and end points? I have 50+ of theses structures and I would love to use and easier method than using (DIST).


If it is a polyline (one long continuous object) then the length in Properties should be accurate. If it isn't a polyline then use JOIN to join the segments together and see what the length is in Properties.

Message 4 of 10

Anonymous
Not applicable
Yes, it is a closed poly line but I only need to measure part if it, not all as shown in the image
0 Likes
Message 5 of 10

Anonymous
Not applicable
Yes, it is a closed poly line but I only need to measure part if it, not all as shown in the image
0 Likes
Message 6 of 10

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... I would like to measure the distance between the two red points. ....

 

I would like to know if there is another way of measuring the distance between the two points (ALONG the poly-line) by only specifying the the start and end points? ....


If the Polyline's entity name is in a variable, let's call it 'pl', and those two points are in variables, let's call them 'pt1' and 'pt2', then the distance between them along the Polyline would be the difference between their individual distances along it, something like [untested]:

 

(abs

  (-

    (vlax-curve-getDistAtPoint pl (vlax-curve-getClosestPointTo pl pt2))

    (vlax-curve-getDistAtPoint pl (vlax-curve-getClosestPointTo pl pt1))

  ); -

); abs

 

I used (abs) so that it won't matter whether pt1 or pt2 is the one nearer the beginning of the Polyline, and you won't get a negative result.  I used (...getClosestPointTo ...) because I believe the measured locations need to be on the Polyline center-line, not on the edge of its width as your red marks are.

 

Type in (vla-load-com) if those functions are not recognized.

 

EDIT:  Now I'm noticing your description of it as a closed Polyline, which suggests that those red marks are on its centerline, and what I took for Polyline width is an infilling solid Hatch pattern or some such thing.  If that's the case, you can simplify it:

 

(abs (- (vlax-curve-getDistAtPoint pl pt2) (vlax-curve-getDistAtPoint pl pt1)))

 

but make sure the points are on the same side of the filled pathway -- you would get a much longer distance result if it's measuring along one edge and around an end and back down the other side.

 

Also, the validity of that would be affected by where the Polyline starts/ends.  If the portion to be measured crosses that start/end vertex, it would need to be handled differently.

Kent Cooper, AIA
0 Likes
Message 7 of 10

Anonymous
Not applicable
Thanks for the detailed reply!
Yes, actually it is a closed polyline that was converted into a surface, and then extruded. The object is not stored in any variable, so I am not sure if this is going to work. I have never used complex commands on autocad
0 Likes
Message 8 of 10

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:
...
Yes, actually it is a closed polyline that was converted into a surface, and then extruded. The object is not stored in any variable, so I am not sure if this is going to work. I have never used complex commands on autocad

Is the Polyline itself still there?  If you Extrude with the DELOBJ System Variable set to keep source objects, the Polyline will still be there, and a routine can easily be made to ask you to pick it, and to pick the two points, then do that calculation.

 

If what you have is only a 3D Solid from the Extruding, I don't know of any way to do what you want except in pieces as you originally described, though the SumDistCont.lsp routine with its SDC command from here will make that easier for you [pick a series of points and it adds up the cumulative total of the distances as it goes].

 

 

Kent Cooper, AIA
0 Likes
Message 9 of 10

pendean
Community Legend
Community Legend
DIMALIGNED command, pick each of the red dots: the result is the same as DIST command (if your dimstyle is set correctly of course). Assuming that's all you ever wanted to do.
0 Likes
Message 10 of 10

Simon_Blain
Advocate
Advocate

Copy the polyline and then break it so it's total lenght is at the 2 red spot

With properties should you have the total lenght of the polyine. 🙂

0 Likes