Jump to content

Recommended Posts

Posted (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 by aecune
Posted

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.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...