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
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
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
It's nice to be nice, but sometimes is nicer to be evil!.
![]()
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
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 1 (rtos (caddr poz))) (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)) (+ (cadr p1) (/ (* i (- (cadr p2) (cadr p1)))n)) (+ (caddr p1) (/ (* i (- (caddr p2) (caddr p1)))n)) ) ) (blins p) (setq i (1+ i)) ) (princ) )
It's nice to be nice, but sometimes is nicer to be evil!.
![]()
Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.
Registered forum members do not see this ad.
Civil 3D will do this for you on a feature line. Otherwise use fuccaro's script.
"Constantly choosing the lesser of two evils is still choosing evil." ~ Jerry Garcia
flickr | work | blog | creed
rustysilo's tips & tutorials
Bookmarks