Hi Lee,
I'm not sur to understan what the goal is but looking at your code, I can say:
(trans '(0. 0. 1.) 1 0 T) returns the normal vector of the current UCS defined in WCS coordinates. This is to be used with the 210 DXF code (or Normal COM property) to creates entities on the current UCS. It have to be used only with entities wich requires OCS coordinates (arc circle lwpolyline text ...)
You need to care of this normal for lines which are considered as 3d entities and have always their coordinates defines in WCS.
But you must use it for texts.
So here's a little corection of your code, but I don't know what you're expecting withe the triangle you draw
(defun c:ellev ( / *error* Line Text OFFSET OLDDIM P1 P2 PT TSZE X Y Z )
;; © Lee Mac 2010
(setq offset 1.5) ;; Text Offset
(defun *error* ( msg )
(and oldDim (setvar 'DIMZIN oldDim))
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **")))
(princ)
)
(defun Line ( p1 p2 )
(entmakex
(list
(cons 0 "LINE")
(cons 10 p1)
(cons 11 p2)
)
)
)
(defun Text ( pt hgt str norm )
(entmakex
(list
(cons 0 "TEXT")
(cons 10 pt)
(cons 40 hgt)
(cons 1 str)
(cons 50 (angle '(0. 0. 0.) (trans (getvar 'UCSXDIR) 0 norm t)))
(cons 7 (getvar 'TEXTSTYLE))
(cons 72 1) ; Center
(cons 73 2) ; Middle
(cons 11 pt)
(cons 210 norm)
)
)
)
(setq oldDim (getvar 'DIMZIN))
(setvar 'DIMZIN 0)
(or *scl (setq *scl 100))
(initget 6)
(setq *scl
(cond
( (getint (strcat "\nEnter Drawing Scale <" (itoa *scl) "> : ")) )
( *scl )
)
)
(setq tsze (* 0.002 *scl))
(setq norm (trans '(0. 0. 1.) 1 0 t))
(terpri)
(while (setq pt (getpoint "\rPick Elevation Line Point: "))
(setq pt (trans pt 1 0)) ; UCS->WCS
(setq x (car pt) y (cadr pt) z (caddr pt))
(setq p1 (list (- x (/ tsze 2)) (+ y tsze) z)
p2 (list (+ x (/ tsze 2)) (+ y tsze) z))
(mapcar (function (lambda ( x ) (line pt x))) (list p1 p2))
(line p1 p2)
(setq pt (trans pt 0 norm) x (car pt) y (cadr pt) z (caddr pt))
(Text
(list x (+ y (* offset tsze)) z)
tsze
(strcat (if (<= 0 y) "+" "") (rtos y 2 2) "m")
norm
)
)
(setvar 'DIMZIN oldDim)
(princ)
)