Well, assuming that by "poles" you mean "texts", try this:
(defun c:pp( / txt points delete)
(setq precision 300)
(setq pl (entsel "Select the polyline"))
(princ "\nselect TEXTs to align")
(setq txt (ssget '((0 . "TEXT"))))
(princ "\nselect the polyline (again)\n")
(setq elast (entlast))
(command "divide" pause precision)
(setq points nil delete nil)
(repeat (- precision 3)
(setq elast (entnext elast)
delete (cons elast delete)
points (cons (cdr (assoc 10 (entget elast))) points))
)
(repeat (setq i (sslength txt))
(setq tx1 (ssname txt (setq i (1- i)))
a10 (cdr (assoc 10 (setq el (entget tx1))))
dist 1e5
closest 0
j -1)
(repeat (length points)
(setq d1 (distance a10 (nth (setq j (1+ j)) points))
dist (if (> dist d1) (setq closest j dist d1) dist))
)
(entmod (subst (cons 50 (angle a10 (nth closest points))) (assoc 50 el) el))
)
(foreach del1 delete (entdel del1))
)
It is not mathematical accurate, but I think it does the job. The precision is set to 300 (see the 2nd program line), it can be raised to about 32000, but it will slow down the program.
Waiting to your feed-back!