im use DTM.VLX to make 3D FACE the command is "DTM" and i use "DTMZ" command displays estimated elevations (Z-coordinates) of X-Y points (plan) picked in the area of the previously generated DTM model. but i want point xyz and text in plan. so im used
;*********************************************************************
; GET-Z - Lisp command to interpolate Z elevations from a 3D face *
; ===== using the plane equation. *
; *
;*********************************************************************
(defun c:GETZ3 ( / ENT P1 P1 P3 X Y X1 Y1 Z1 X2 Y2 Z2 X3 Y3 Z3 A B C D Z)
(setq ENT (car (entsel "\nSelect 3DFace ")))
(setq P (getpoint "\nSelect location > "))
(setq P1 (cdr (assoc 10 (entget ENT)))
P2 (cdr (assoc 11 (entget ENT)))
P3 (cdr (assoc 12 (entget ENT)))
)
(setq X (car P)
Y (cadr P)
X1 (car P1)
Y1 (cadr P1)
Z1 (caddr P1)
X2 (car P2)
Y2 (cadr P2)
Z2 (caddr P2)
X3 (car P3)
Y3 (cadr P3)
Z3 (caddr P3)
)
; Add check here to determine if the point (P) is within the triangular
; 3dface, if so process the following code.
(setq A (+ (* Y1 (- Z2 Z3)) (* Y2 (- Z3 Z1)) (* Y3 (- Z1 Z2)) ))
(setq B (+ (* Z1 (- X2 X3)) (* Z2 (- X3 X1)) (* Z3 (- X1 X2)) ))
(setq C (+ (* X1 (- Y2 Y3)) (* X2 (- Y3 Y1)) (* X3 (- Y1 Y2)) ))
(setq D (- (- (* A X1)) (* B Y1) (* C Z1) ))
(setq Z (- (- (* (/ A C) X)) (* (/ B C) Y) (/ D C) ))
(command "point" P)
(command "change" "l" "" "p" "e" (rtos Z 2 3) "" )
(command "text" "j" "bl" P "0.20" "90" (rtos z 2 3) )
(command "change" "l" "" "p" "e" (rtos Z 2 3) "" )
(princ)
)
;*********************************************************************
I have a problem to choose select 3dFace and point out 3dface can still have value. should have no value. thanks