home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / graphics / survey.zip / INTERP.LSP < prev    next >
Text File  |  1987-09-30  |  2KB  |  53 lines

  1. ;***********************************************************
  2. ;This lisp routine plots the interpolated contour elevations between
  3. ;user selected survey points. The elevation of each selected
  4. ;survey point is requested along with the elevation of the
  5. ;first itermediate contour elevation.
  6.  
  7. ;When selecting survey points for interpolation, select
  8. ;lowest elevation point first then the higher point. 
  9. ;The lisp routine notes each interpolated point with the
  10. ;appropriate elevation for that interpolated point.
  11. ;***********************************************************
  12. (defun c:interp ()
  13. (setvar "cmdecho" 0)
  14. (setvar "blipmode" 0)
  15. (command "osnap" "node")
  16. (setq cnt 0)
  17. (setq tp1 (getpoint "\nSelect survey point 1: "))
  18. (setq tp2 (getpoint "\nSelect survey point 2: "))
  19. (setq ev1 (getreal "\nElevation of point 1: "))
  20. (setq ev2 (getreal "\nElevation of point 2: "))
  21. (setq j (getreal "\nElevation of first iterpolated point: "))
  22. (command "osnap" "none")
  23. (setq d (distance tp1 tp2))
  24. (setq la (angle tp1 tp2))
  25. (setq evd (* 10 (abs (- ev1 ev2))))
  26. (setq icd (/ d evd))
  27. (setq iev ev1)
  28. (WHILE (< IEV J)
  29.        (setq cnt (+ 1 cnt))
  30.        (setq iev (+ 0.1 iev))
  31. )
  32. (setq cnt (1- cnt))
  33. (if (= cnt 0) (setq cnt (1+ cnt))
  34. )
  35. (setq ici (* cnt icd))
  36. (command "point" (polar tp1 la ici))
  37. (setq t (itoa (fix iev)))
  38. (command"text" "@" "" "" t)
  39. (setq np (getvar "lastpoint"))
  40. (setq iev (+ iev 1.0))
  41. (setq ci1 (* 10 icd))
  42. (while (< iev ev2)
  43.       (command "point" (polar np la ci1))
  44. (setq t (itoa (fix iev)))
  45. (command "text" "@" "" "" t)
  46.       (setq iev (+ iev 1.0))
  47.       (setq np (getvar "lastpoint"))
  48. )
  49. (command "osnap" "none")
  50. (setvar "cmdecho" 1)
  51. (setvar "blipmode" 1)
  52. )
  53.