It shouldn't take 20 minutes something not right in the algorithm or is it the dwg ? I do something to hundreds of common objects 4 tasks and takes 2 minutes. It searches no zooming just does it. Yes started coding at 36 minutes but now 2 minutes.
I will try to find time for get text, do a bounding box offset it, then use the new offset box does it touch a Pline, if so compare the end points to the insertion point of text, swap end points if required and add a point. Yes if it touches a line a problem but run Join Multi 1st to get around that.
"Polylines with different origins (when they are not simple lines)" Need a global fix. Need to find one to see what is going on.
This is what I got looking at dwg. Would use select window so no stray text.
: (sslength (ssget "X" '((0 . "LINE")(cons 410 (getvar 'ctab)))))
0
: (sslength (ssget "X" '((0 . "MTEXT")(cons 410 (getvar 'ctab)))))
3
: (sslength (ssget "X" '((0 . "TEXT")(cons 410 (getvar 'ctab)))))
318
: (sslength (ssget "X" '((0 . "LWPOLYLINE")(cons 410 (getvar 'ctab)))))
317
Have to go somewhere soon, maybe tonight.