"it depends on which "direction" the polylines are drawn" the code above is almost there, what I use and have done so for like 30+ years, is pick an object end, this returns 3 points the pick point, start & end you compare the distance of pt->end pt->start and can then work out if need to reverse the line or pline, NOTE Bricscad does not have Reverse, have not checked V25.
Reverse "This is not a BricsCAD command. Have you tried PEDIT with the suboption Reverse direction?"
An example this would be a line answer.
(setq ent (entsel "\nPIck object near end Enter to exit "))
(setq pt (cadr ent))
(setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car ent)))))
(setq obj2 (vlax-ename->vla-object (car ent)))
(setq start (vlax-curve-getstartPoint obj2))
(setq end (vlax-curve-getendPoint obj2))
(setq d1 (distance pt start))
(setq d2 (distance pt end))
(if (> d1 d2)
(setq tmp start
start end
end tmp
)