Try this, see comments in code.
(defun c:PTstations (/
p1 p2 L c
step dist #pts ang idx
Xt Yt x a y
)
(if (and (setq p1 (getpoint "\nPick first point."))
(setq p2 (getpoint "\nPick second point."))
(setq L (getreal "\nWhat is low point? "))
(setq c (getreal "\nWhat is High point? "))
)
(progn
(setq step 1000
dist (distance p1 p2)
#pts (fix (/ (/ dist step)2))
ang (angle p1 p2)
idx 1
)
(repeat #pts
(setq Xt (/ dist 2)
Yt (- l c)
x (- Xt (* idx step))
a (/ Yt (* Xt Xt))
y (+ (* a (* x x)) c)
yr (round y 5)
;; these don't belong here
;; #pts (fix (/ (/ dist step)2))
;; ang (angle p1 p2)
;; idx 1
)
(command "_Point" "_non" (polar p1 ang (* idx step)))
;; text height is 20, offset from line is 40
(MakeText (rtos yr 2 0) (polar (polar p1 ang (* idx step)) (* pi 1.5) 40) "0" 20)
(command "_Point" "_non" (polar p2 ang (- (* idx step))))
(MakeText (rtos yr 2 0) (polar (polar p2 ang (- (* idx step))) (* pi 1.5) 40) "0" 20)
(setq idx (1+ idx))
)
)
)
(princ)
)
(defun round ( number by )
; http://www.theswamp.org/index.php?topic=3076.0;all
(if (zerop by) number
(+ (* (fix (/ number (setq by (abs by)))) by)
(if (< (* 0.5 by) (rem number by)) by 0 )))
)
;; pre set to Middle Center
(defun MakeText (str pt lyr ht)
(entmakex (list (cons 0 "TEXT") ;***
(cons 1 str) ;* (the string itself)
(cons 6 "BYLAYER") ; Linetype name
(cons 7 "STANDARD") ;* Text style name, defaults to STANDARD, not current
(cons 8 lyr) ; layer
(cons 10 pt) ;* First alignment point (in OCS)
(cons 11 pt) ;* Second alignment point (in OCS)
(cons 39 0.0) ; Thickness (optional; default = 0)
(cons 40 ht) ;* Text height
(cons 41 1.0) ; Relative X scale factor, Width Factor, defaults to 1.0
(cons 50 0.0) ; Text rotation ange
(cons 51 0.0) ; Oblique angle
(cons 62 256) ; color
(cons 71 0) ; Text generation flags
(cons 72 1) ; Horizontal text justification type
(cons 73 2) ; Vertical text justification type
(cons 210 (list 0.0 0.0 1.0)))))