Partial polyline Length (Perimeter) based on user selection

Kyle.Pederson
Advocate Advocate
1,034 Views
3 Replies
Message 1 of 4

Partial polyline Length (Perimeter) based on user selection

Kyle.Pederson
Advocate
Advocate

I'm looking for something where I can get the perimeter of both a closed or non-closed polyline by selecting the polylines of my choosing. Example would be if I had a Rectangle and only wanted the perimeter of 3 sides, or 2 sides. I've seen a lot where people get the full perimeter but not a partial.  Very similar to Lee Mac's Chain Length lee-mac.com - chainlength

But I'd like to be able to select certain polylines.

0 Likes
1,035 Views
3 Replies
Replies (3)
Message 2 of 4

Kent1Cooper
Consultant
Consultant

Explain more about the sequence of steps the User would take, and the kind of output you want.

 

If you're talking about selecting multiple Polylines [assuming that's what the end of Message 1 means], wouldn't you need to specify a start and end point on each one, so every one would need to be dealt with separately anyway?  And if you pick a start and end point along a closed  Polyline, wouldn't you need to specify which part  between those points you want the length of, since there are two possibilities in opposite directions?  Presumably you wouldn't always want it to measure in the Polyline's drawn  direction from the first point you pick to the second, especially since that's not visually apparent.  If it's a rectangle, and you want entire edges, it's easy enough to calculate if you ask for 2 edges, without requiring the User to specify start and end corners, and that could be done for multiple ones automatically, but there are two  solutions if you ask for 3 edges [unless the rectangle is a square ] -- how would you designate which edge to omit?  If there are multiple Polylines, how do you want the results -- one total of all the specified sub-lengths, or a list of individual results, or...?  Etc., etc.

Kent Cooper, AIA
0 Likes
Message 3 of 4

Kyle.Pederson
Advocate
Advocate

I attached a quick drawing example. Image on the Left is what we would draw in AutoCAD. the outline of the building would be a Polyline. (Sometimes Closed, sometimes opened) We Section the building based on changes in height. Example I have is the middle Section 2 is say 25ft tall and the Section  1 and 3 are both 10 ft tall.  We use a light line to show change in Section. When calculating the perimeter for all 3 buildings, Section 2(Red) would use all 4 walls because it's the tallest. Section 1(Yellow) & Section 3(Green) would only have a partial perimeter due to sharing a common taller wall with Section 2 (red) (Image on the right is color coordinated for explanation purposes only and never included in a drawing)

 

Currently to find the area I'm using a Lee-Mac program "Area Label" since it plays nice with our sectioning, Measure-Area in utilities only lets me click the outline to find entire area.

 

To find the perimeter we are a lot of times retracing the partial building we need or copying and break at points to divide it up. Ideally what I would like is a program similar to Lee-Mac Area followed by a command to have me select certain lines (Example would be clicking Section 3's four green lines and returning the value of that perimeter)

0 Likes
Message 4 of 4

Kent1Cooper
Consultant
Consultant

Somewhat challenging, in that you can't just pick segments of the white perimeter Polyline, because some of them extend beyond the portion of perimeter that you want for a given portion of building.

 

If they're always straight  edges, you may be able to use the routines >here<.  There are two AutoLisp files in the .ZIP file, each defining a command.  You can use the SDC command in SumDistCont.lsp for all the areas in your description -- it's for contiguous-end-to-end lengths.  Pick the corners around the perimeter, and where vertices are is irrelevant.  You can use Osnap to get ENDpoints and/or INTersections easily.  For a closed perimeter such as your taller area 2 in the middle, you do need to go back and pick the first corner again to include the length of the closing portion -- the prompt says "Enter to Close," but it doesn't work like the Polyline Close option, i.e. it doesn't close the shape, but just closes the command.  If your area 2 were the shorter  one, and you wanted only its top-&-bottom [thick] red edges, you can use the SD command in SumDist.lsp, which is for lengths that are not  contiguous end-to-end, so you pick both ends of each distance.  Both commands report both the latest distance and the cumulative total so far, after each distance is picked, and the cumulative total again at the end.

 

Both report the total length of all distances picked.

Kent Cooper, AIA