hepcpltd Posted August 25, 2011 Posted August 25, 2011 Acad drawing is available with survey contour. Is there any autolisp or codes which will find elevation of intermediate unknown points from nearby contours. Quote
eldon Posted August 25, 2011 Posted August 25, 2011 Are the contours 3D lines? If so, can you draw a line from one contour to another (using Nearest Osnap), and then break the line at your required point and ID the end of the line. I see that you are using LT which means that you cannot use Lisp, and I do not know about 3D lines. Quote
BIGAL Posted August 26, 2011 Posted August 26, 2011 Simple maths draw a line from start contour dist1 extend to next contour dist 2 the ratio dist1/dist2 * ht diff + level 1st contour = elevation if I wrote it right. Quote
hepcpltd Posted August 26, 2011 Author Posted August 26, 2011 Having Acad full version. My problem is, there are so many points outside contour lines and with some lisp I want to assign 'Z' to those point/ Text by interpolating contour values in drawing. Quote
hepcpltd Posted August 27, 2011 Author Posted August 27, 2011 Simple maths draw a line from start contour dist1 extend to next contour dist 2 the ratio dist1/dist2 * ht diff + level 1st contour = elevation if I wrote it right. Having Acad full version. My problem is, there are so many points outside contour lines and with some lisp I want to assign 'Z' to those point/ Text by interpolating contour values in drawing. Quote
Tharwat Posted August 27, 2011 Posted August 27, 2011 Having Acad full version. My problem is, there are so many points outside contour lines and with some lisp I want to assign 'Z' to those point/ Text by interpolating contour values in drawing. With a simple piece of drawing before and after , I guess that would clarify your needs to all readers . Quote
eldon Posted August 27, 2011 Posted August 27, 2011 Perhaps I should repeat my request for information. Are the contour lines in 3D? If most of your points are outside the contour lines, you would be extrapolating instead of interpolating. How confident are you that the ground has the same slope outside the contours as that slope defined by the existing contours? It might be better to request that the survey be extended to cover the area that you want. Quote
hepcpltd Posted August 27, 2011 Author Posted August 27, 2011 Available contour drawing ts attached. Want to find 'Z' for Text point shown as value '100', by referring contour elevation and distances.contour.dwg Quote
Tharwat Posted August 27, 2011 Posted August 27, 2011 Try this simple code and select any entity and it would show you the Z value in a message box . (defun c:Test (/ ss) (if (setq ss (car (entsel "\n Select Entity :"))) (alert (strcat " The Z is >> " " : " (rtos (caddr (cdr (assoc 10 (entget ss)))) 2) ) ) (princ "\n Nothing Selected :") ) (princ) ) Tharwat Quote
eldon Posted August 27, 2011 Posted August 27, 2011 To get the level at your point, first of all draw a line (NOT a polyline) at approximately right angles to the nearest contours (using the Osnap Nearest) so that the line passes through the desired point. Then ID the line where you want the level. Quote
Lee Mac Posted August 27, 2011 Posted August 27, 2011 Here is a very old program of mine that might help, tweaked for the purpose of this post: ([color=BLUE]defun[/color] c:Sample ( [color=BLUE]/[/color] _sub dc el l1 ls p1 p2 sp ss ) [color=GREEN];; © Lee Mac 2011[/color] ([color=BLUE]defun[/color] _sub ( lst el ) ([color=BLUE]if[/color] lst ([color=BLUE]cons[/color] ([color=BLUE]list[/color] ([color=BLUE]car[/color] lst) ([color=BLUE]cadr[/color] lst) el) (_sub ([color=BLUE]cdddr[/color] lst) el))) ) ([color=BLUE]setq[/color] dc ([color=BLUE]vla-get-activedocument[/color] ([color=BLUE]vlax-get-acad-object[/color])) sp ([color=BLUE]vlax-get-property[/color] dc ([color=BLUE]if[/color] ([color=BLUE]=[/color] 1 ([color=BLUE]getvar[/color] 'CVPORT)) 'paperspace 'modelspace)) ) ([color=BLUE]if[/color] ([color=BLUE]and[/color] ([color=BLUE]setq[/color] p1 ([color=BLUE]getpoint[/color] [color=MAROON]"\nSpecify First Point of Sample Line: "[/color])) ([color=BLUE]setq[/color] p2 ([color=BLUE]getpoint[/color] [color=MAROON]"\nSpecify Second Point of Sample Line: "[/color] p1)) ([color=BLUE]ssget[/color] [color=MAROON]"_F"[/color] ([color=BLUE]list[/color] p1 p2) '((0 . [color=MAROON]"LWPOLYLINE"[/color]))) ([color=BLUE]setq[/color] p1 ([color=BLUE]trans[/color] p1 1 0) p2 ([color=BLUE]trans[/color] p2 1 0) ) ) ([color=BLUE]progn[/color] ([color=BLUE]setq[/color] l1 ([color=BLUE]vlax-invoke[/color] sp 'addline p1 p2)) ([color=BLUE]vlax-for[/color] ob ([color=BLUE]setq[/color] ss ([color=BLUE]vla-get-activeselectionset[/color] dc)) ([color=BLUE]setq[/color] el ([color=BLUE]vla-get-elevation[/color] ob)) ([color=BLUE]vla-put-elevation[/color] ob 0.) ([color=BLUE]setq[/color] ls ([color=BLUE]append[/color] ls (_sub ([color=BLUE]vlax-invoke[/color] ob 'intersectwith l1 [color=BLUE]acextendnone[/color]) el))) ([color=BLUE]vla-put-elevation[/color] ob el) ) ([color=BLUE]vla-delete[/color] ss) ([color=BLUE]vla-delete[/color] l1) ([color=BLUE]vlax-invoke[/color] sp 'add3dpoly ([color=BLUE]apply[/color] '[color=BLUE]append[/color] ([color=BLUE]vl-sort[/color] ls ([color=BLUE]function[/color] ([color=BLUE]lambda[/color] ( a b ) ([color=BLUE]<[/color] ([color=BLUE]distance[/color] p1 ([color=BLUE]list[/color] ([color=BLUE]car[/color] a) ([color=BLUE]cadr[/color] a))) ([color=BLUE]distance[/color] p1 ([color=BLUE]list[/color] ([color=BLUE]car[/color] b) ([color=BLUE]cadr[/color] b))) ) ) ) ) ) ) ) ) ([color=BLUE]princ[/color]) ) ([color=BLUE]vl-load-com[/color]) ([color=BLUE]princ[/color]) Pick two points running across your contours and the above will create a 3D Polyline with vertices at the elevations of the contours. Quote
motee-z Posted August 28, 2011 Posted August 28, 2011 here is your request i use it to interpolate points lines every thing has z value and print calculated level on screen intermediat2level.LSP Quote
Guest Posted September 8, 2014 Posted September 8, 2014 Nice job Lee Mac .Is it possible to update this code. To select a line or polyline and convert it to 3d polyline from contours elevetion. Look the atach file Drawing1.dwg Quote
BIGAL Posted September 9, 2014 Posted September 9, 2014 Lee code from 2011 is not old I have september 1998 Quote
eldon Posted September 9, 2014 Posted September 9, 2014 Perhaps this thread is what you are looking for Quote
Guest Posted September 9, 2014 Posted September 9, 2014 No eldon i have this lisp but is not exactly what i am looking for .. 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.