sudam Posted March 25, 2019 Posted March 25, 2019 (edited) i am not understand . kindly see the attachment. i need this type interpolation in grid pattern. please please please help me. elevation in value mention in grid pattern. Survey_Engineering_v2.VLX Edited March 25, 2019 by sudam this VLX CAN convert in lisp? Quote
sudam Posted March 26, 2019 Posted March 26, 2019 (edited) Sir, i am new in lisp . kindly see the attachment. i need this type interpolation in grid pattern. please please please help me. elevation in value mention in grid pattern. Anyone can help me. Thank you. Sample.dwg Edited March 26, 2019 by sudam Quote
drdownload18 Posted April 29, 2019 Posted April 29, 2019 On 1/24/2018 at 3:37 PM, netelaana said: I would like to exit the while loop and then delete the line with , but I can't get it to work yet with multiple instances. the closest I can get is this ;interpolation function to populate text elevation labels ; written by Nete Laana on 24.01.18 (defun c:INTEL (/ p1 p2 p3 el1 el2 el3 dista distb distc h1 prod r1 t1) ;define the function intel (setq p1 (getpoint "\nPick First Point : "));get the first point (setq el1 (getreal "\nSpecify First Elevation : "));manually enter first elevation (setq p2 (getpoint "\nPick Second Point : "));get the second point (setq el2 (getreal "\nSpecify Second Elevation : "));manually enter second elevation (command "Line" p1 p2 "");draw the line (setq p3 (getpoint "\ns Pick Interpolation Point : ")); pick desired interpolation point (setq distb (distance p1 p3)); calculate distance a (setq distc (distance p2 p3)); calculate distance b (setq dista (+ distb distc)); calculate total distance (setq h1 (- el2 el1)); calculate height difference (setq prod (* h1 distb)); numerator (setq r1 (/ prod dista)); relative height (setq el3 (+ r1 el1));calculate interpolated elevation (setq t1 (rtos el3 2 2)); convert to text string rounded to two digits (entdel (entlast)); delete the line (command "circle" p3 0.15); draw circle to identify point (command ".TEXT" p3 1.2 0 t1); dump el3 as text object ;(print (strcat "Elevation at point is " (rtos el3))) ;(print (strcat "distb " (rtos distb))) ;(print (strcat "distc " (rtos distc))) ;(print (strcat "dista " (rtos dista))) ;(print (strcat "h1 " (rtos h1))) ;(print (strcat "el1 " (rtos el1))) ;(print (strcat "el2 " (rtos el2))) ;(print (strcat "prod " (rtos prod))) ;(print (strcat "r1 " (rtos r1))) ;(print (strcat "t1 " t1)) (princ) ) is it possible to change this lisp so we choose between manually enter elevation AND pick written text with Z value? It will be much more easier to click on text containing Z value than manualy typing values for every point. Tnx Quote
dlanorh Posted April 30, 2019 Posted April 30, 2019 (edited) Try this. Modified lisp slightly (defun rh:get_elev ( msg / ss rtn) (prompt msg) (setq ss (ssget "_+.:E:S" '((0 . "TEXT")))) (cond ( (not ss) (initget 3) (setq rtn (getreal "\nEnter Level : ")) ) (t (setq rtn (atof (cdr (assoc 1 (entget (ssname ss 0)))))) ) );end_cond );end_defun ;interpolation function to populate text elevation labels ; written by Nete Laana on 24.01.18 Modified dlanorh 30.04.19 (defun c:INTEL (/ p1 p2 p3 e1 e2 e3 d1 d2) ;define the function intel (while (setq p1 (getpoint "\nPick First Point : "));get the first point (setq e1 (rh:get_elev "\nSpecify First Elevation : ");get first elevation p2 (getpoint "\nPick Second Point : ");get the second point e2 (rh:get_elev "\nSpecify Second Elevation : ");get second elevation d1 (distance p1 p2); calculate total distance );end_setq (command "Line" p1 p2 "");draw the line (setq p3 (getpoint "\nPick Interpolation Point : "); pick desired interpolation point d2 (distance p1 p3); calculate distance a e3 (+ (/ (* (- e2 e1) d2) d1) e1);calculate interpolated elevation );end_setq (entdel (entlast)); delete the line (command "circle" p3 0.15); draw circle to identify point (command ".TEXT" p3 1.2 0 (rtos e3 2 2)); dump e3 as text object (setq p1 nil) );end_while (princ) );end_defun The lisp will now loop and ask for the next "Pick First Point : ". To exit the loop press return or click the right mouse button if it is set up that way. Edited April 30, 2019 by dlanorh Edited code 2 Quote
Ish Posted July 23, 2019 Posted July 23, 2019 On 3/25/2019 at 9:44 AM, sudam said: i am not understand . kindly see the attachment. i need this type interpolation in grid pattern. please please please help me. elevation in value mention in grid pattern. Survey_Engineering_v2.VLX 142.14 kB · 8 downloads can you write commands of Survey_Engineering_v2 to use in autocad.. Quote
dek Posted October 29, 2020 Posted October 29, 2020 thank you for this LSP really appreciate it.. can I ask one more thing..is it ok to modify this so that the output value would be in 3 decimal places currently its on 2 decimal places,. thanks On 4/30/2019 at 5:39 PM, dlanorh said: Try this. Modified lisp slightly (defun rh:get_elev ( msg / ss rtn) (prompt msg) (setq ss (ssget "_+.:E:S" '((0 . "TEXT")))) (cond ( (not ss) (initget 3) (setq rtn (getreal "\nEnter Level : ")) ) (t (setq rtn (atof (cdr (assoc 1 (entget (ssname ss 0)))))) ) );end_cond );end_defun ;interpolation function to populate text elevation labels ; written by Nete Laana on 24.01.18 Modified dlanorh 30.04.19 (defun c:INTEL (/ p1 p2 p3 e1 e2 e3 d1 d2) ;define the function intel (while (setq p1 (getpoint "\nPick First Point : "));get the first point (setq e1 (rh:get_elev "\nSpecify First Elevation : ");get first elevation p2 (getpoint "\nPick Second Point : ");get the second point e2 (rh:get_elev "\nSpecify Second Elevation : ");get second elevation d1 (distance p1 p2); calculate total distance );end_setq (command "Line" p1 p2 "");draw the line (setq p3 (getpoint "\nPick Interpolation Point : "); pick desired interpolation point d2 (distance p1 p3); calculate distance a e3 (+ (/ (* (- e2 e1) d2) d1) e1);calculate interpolated elevation );end_setq (entdel (entlast)); delete the line (command "circle" p3 0.15); draw circle to identify point (command ".TEXT" p3 1.2 0 (rtos e3 2 2)); dump e3 as text object (setq p1 nil) );end_while (princ) );end_defun The lisp will now loop and ask for the next "Pick First Point : ". To exit the loop press return or click the right mouse button if it is set up that way. Quote
dlanorh Posted October 29, 2020 Posted October 29, 2020 6 hours ago, dek said: thank you for this LSP really appreciate it.. can I ask one more thing..is it ok to modify this so that the output value would be in 3 decimal places currently its on 2 decimal places,. thanks Unsure of what you are after. It's not my lisp, I just modified it. If you want to do it yourself, be my guest. If you don't or don't know how, find this line (command ".TEXT" p3 1.2 0 (rtos e3 2 2)); dump e3 as text object and change it to (command ".TEXT" p3 1.2 0 (rtos e3 2 3)); dump e3 as text object 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.