aecune Posted November 14, 2010 Posted November 14, 2010 (edited) I need help working on my code. It was taken from another thread. The point of this LISP routine is to help me interpolate points between two known points so that I can come in and draw contour lines. Here are my goals: *Change the routine to make a point every 5 ft of elevation (65, 70, 75, etc) instead of every 1 ft. It must be every five relative to 0. It cannot be relative to one another. Example: 163, 168, 173 Here's the code: (defun c:test (/ pt1 el1 pnt1 pt1 el2 pnt2 len el1a slp d1) (vl-load-com) (setq oldsnap (getvar "osmode"));tweak (setvar "pdmode" 3) (setq pt1 (getpoint "\nPick point 1: ") el1 (caddr pt1) pnt1 (list (car pt1) (cadr pt1) el1) pt2 (getpoint pt1 "\nPick point 2: ") el2 (caddr pt2) pnt2 (list (car pt2) (cadr pt2) el2) len (distance pnt1 pnt2) el1a (1+(fix el1)) slp (/ (- el2 el1)(distance pnt1 pnt2)) d1 (/ (- el1a el1) slp) ) (setq obj (vlax-ename->vla-object (entmakex (list (cons 0 "LINE") (cons 10 pnt1) (cons 11 pnt2) ) ) ) ) (while ( (entmakex (list (cons 0 "POINT") (cons 10 (vlax-curve-getPointAtDist Obj d1)) ) ) (setq d1 (+ d1 (/ 1 slp))) ) (setvar "osmode" oldsnap) (princ) ) Edited November 15, 2010 by aecune Quote
BIGAL Posted November 15, 2010 Posted November 15, 2010 My suggestion don't reinvent the wheel theres some free/cheap contour software out there just look for it and it does a lot more. Quote
The Buzzard Posted November 15, 2010 Posted November 15, 2010 I need help working on my code. It was taken from another thread. The point of this LISP routine is to help me interpolate points between two known points so that I can come in and draw contour lines. Here are my goals: *Change the routine to make a point every 5 ft of elevation (65, 70, 75, etc) instead of every 1 ft. It must be every five relative to 0. It cannot be relative to one another. Example: 163, 168, 173 Here's the code: Maybe you should contact lpseifert on this thread: http://www.cadtutor.net/forum/showthread.php?44496-Interpolation-Lisp-Needed&highlight=pt1+el1+pnt1+pt1+el2+pnt2+len+el1a+slp+d1%29 It is his code you want to change. I am sure he would help you if you requested it. 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.