# Thread: Automatic Extraction of Elevation Properties of Points on a Line

1. ## Automatic Extraction of Elevation Properties of Points on a Line

Registered forum members do not see this ad.

Please can anyone assist in locating a lisp program for Automatic Extraction of Elevation Properties of Points on a Line. I need this because, I need to use the elevation of points at specific intervals on a line to draw the longitudinal profile of the line.
Thank you.

Skipo

2. Using some math.
If a line has the ends at elevations Z1 and Z2 and you wish to calculate say 15 intermediate points:
DZ=(Z2-Z1)/15
Now the 3rd intermediate point will have the elevation Z1+3*DZ
The 9th point will be at Z1+9*DZ
and so on

3. I just wrote a short Lisp for you:
Code:
```;Divides a line in equal segments and write the WCS elevation for each division
; Fuccaro Miklos   March 2008
;-------------------------------------------------------------------------------
(defun c:elevations( / l ll p1 p2 p n i cont)
(defun blmaker()
(if (not (tblsearch "BLOCK" "POINTMARKER"))
(progn
(entmake '((0 . "BLOCK")(2 . "POINTMARKER")(70 . 2)(10 0 0 0)))
(entmake '((0 . "POINT")(10 0 0 0)))
(entmake '((0 . "ATTDEF")(10 0 0)(1 . "f")(2 . "fuccaro")(3 . "miklos")
(40 . 3.5)(41 . 1)(70 . 4)(72 . 2)))
(entmake '((0 . "ENDBLK")))
)
)
)
(defun blins (poz)
(entmake (list '(0 . "INSERT") '(66 . 1) '(2 . "POINTMARKER") (cons 10 poz)))
(entmake (list (cons 0 "ATTRIB")
(cons 10 poz)
(cons 11 poz)
(cons 70 8)
(cons 72 2)
(cons 40 3.5)
(cons 2 "fuccaro")
)
)
(entmake '((0 . "SEQEND")))
)

(setq cont t)
(while cont
(setq l (entsel "line?"))
(if l (setq ll (entget (car l))))
(setq cont (not (eq "LINE" (cdr (assoc 0 ll)))))
)
(setq p1 (cdr (assoc 10 ll)) p2 (cdr (assoc 11 ll)))
(setq n (getint "divisions?"))
(blmaker)
(setq i 0)
(repeat (1+ n)
(setq p (list
(+ (car p1) (/ (* i (- (car p2) (car p1))) n))
)
)
(blins p)
(setq i (1+ i))
)
(princ)
)```

4. Registered forum members do not see this ad.

Civil 3D will do this for you on a feature line. Otherwise use fuccaro's script.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts