Hi,
Give this a shot and let me know.
(defun c:Test (/ text_ inc int sel ent get ins rot ang ctr)
;; Tharwat - 02.Dec.2018 ;;
(defun text_ (ins str rot clr lay)
(entmake
(list '(0 . "TEXT")
(cons 8 lay)
(cons 62 clr)
(cons 10 ins)
'(40 . 1.1543)
(cons 1 str)
(cons 50
(if (and (> rot (* pi 0.5)) (< rot (* pi 1.5)))
(+ rot pi)
rot
)
)
'(41 . 1.0)
'(71 . 0)
'(72 . 1)
(cons 11 ins)
'(73 . 2)
)
)
)
(if (setq inc 0
int -1
sel (ssget '((0 . "INSERT")))
)
(while (setq ent (ssname sel (setq int (1+ int))))
(setq get (entget ent)
ins (cdr (assoc 10 get))
rot (cdr (assoc 50 get))
ang (+ rot (* pi 1.5))
inc (1+ inc)
)
(mapcar 'text_
(list (polar ins ang 1.97715)
(polar ins ang 3.96145)
(setq ctr (polar ins ang 7.0083))
)
(list (strcat "X:" (rtos (car ins) 2 2))
(strcat "Y:" (rtos (cadr ins) 2 2))
(if (< inc 10)
(strcat "0" (itoa inc))
(itoa inc)
)
)
(list rot rot rot)
'(2 2 1)
'("Coordenada" "Coordenada" "N_Postes")
)
(entmake (list '(0 . "CIRCLE")
'(8 . "N_Postes")
(cons 10 ctr)
'(62 . 1)
'(40 . 1.5)
)
)
)
)
(princ)
)