Hey all,
I 'm trying to make this lisp better, insert the text in the midpoint.
Anybody Can help me help, please?
Thanks in advance
(defun c:incl(/ pv1 pv2 y1 y2 x1 x2 h l l1 i inc ang ang1 ptx1 texto)
(command "layer" "s" "inclinação" "")
(SETQ pv1(getpoint "\nSaida:"))
(SETQ pv2(getpoint "\nChegada:"))
(SETQ Y1(NTH 1 PV1))
(SETQ Y2(NTH 1 PV2))
(SETQ X1(NTH 0 PV1))
(SETQ X2(NTH 0 PV2))
(SETQ H(- Y1 Y2))
(SETQ L(- X2 X1))
(SETQ L1(* 10 L))
(SETQ I(/ H L1))
(SETQ INC(RTOS I 2 4))
(SETQ ANG (angle PV1 PV2))
(SETQ ang1 (angtos ang 4 4))
(SETQ PTXT1 (getpoint "\nInclinação:"))
(SETQ TEXTO (Strcat "i=" INC))
(command "text" "s" "incl" "c" PTXT1 ANG1 texto)
)