01-07-2021
02:09 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
01-07-2021
02:09 AM
Not really sure why your code works with "total distance"... this not make sense to me.
But try this code?
(defun c:TextDist (/ done p1 p2)
(or *TD-Scale* (setq *TD-Scale* 1.))
(or *TD-Height* (setq *TD-Height* 1.))
(while (progn
(setq done nil)
(while (not done)
(princ (strcat "Current setting: Scale " (rtos *TD-Scale*) " Height " (rtos *TD-Height*)))
(initget "Scale Height")
(setq p1 (getpoint "\nSpecify a point or [Scale/Height]: "))
(cond ((= p1 "Scale") (initget 3) (setq *TD-Scale* (getdist "\nScale factor: ")))
((= p1 "Height") (initget 3) (setq *TD-Scale* (getdist "\nText height: ")))
((setq done T))))
p1)
(if (setq p2 (getpoint p1 "\nSecond point: "))
(entmake (list (cons 0 "TEXT")
(cons 10 (trans p2 1 0))
(cons 7 (getvar 'textstyle))
(cons 40 *TD-Height*)
(cons 1 (rtos (/ (distance p1 p2) *TD-Scale*)))
(cons 50 (angle '(0 0 0) (getvar 'ucsxdir)))
))))
(princ)
)