hdn32 Posted October 1, 2009 Posted October 1, 2009 Hi all, I am new to this forum and have no clue about AutoLISP. Could anyone please help me with an AutoLISP routine that calculates the total length of polylines bordered by a closed polyline? I need this total length in order to calculate the average slope of a parcel of land. Please see attached image. What i have been doing is as the following: Manually trim each contour (polyline) to the boundary of each parcel (closed polyline) Use AutoCad's properties or list to get the length of each polyline within the boundary Add all the lengths using MS Excel to get the total length Any help would be deeply appreciated. Cheers, hdn32 screen.pdf Quote
CarlB Posted October 2, 2009 Posted October 2, 2009 That sounds familiar, wrote that one years ago. The routine: -copied contours to a new temporary layer, the closed polyline was used to select contours using the "cp" selection method -isolate layers to include just copied contours -trimmed contours, using polyline as cutting edge, and an offset (small) for a trimming fence line -select remaining enclosed & trimmed contours, sum up length of each May not have been slick but generally worked. Some lisp jedi masters here may be able to use this as fodder for an improved approach. Quote
hdn32 Posted October 2, 2009 Author Posted October 2, 2009 I found a thread at AUGI named "Length of polylines within an area". But the code is just partially completed Since I am a newbie, I can not post a link here. Quote
smurrison Posted October 18, 2009 Posted October 18, 2009 Anyone find a solution to this. It would come in rather handy. Scott Quote
ReMark Posted October 18, 2009 Posted October 18, 2009 I could have sworn I've come across such a routine but for the life of me I could not find it. In the meantime I have a two part solution. For trimming everything on the outside (or inside) of a closed polyline you could try CookieCutter2 v1.2 whcih can be found at www.theswamp.org and then get the total length of all the entities within the closed polyline using Tlen.lsp which you can find at www.turvill.com. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.