This is not how I would prefer to post my first message, but I have a problem…
I am trying to come up with a lisp function that takes two arguments: an LWPolyline and a point on that object. The return value should be the DXF code for the line or arc segment that contains the point.
For example, given an LWPolyline with vertices (0, 0), (1, 0), (1, 1), and (0, 1) and a point of (1, 0.5), the function should return: ((10 1.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 1.0 1.0)).
I have a lengthy (and messy) solution that involves exploding the polyline, then using Nentselp to select the segment, and finally extracting the points and bulge information. However, this only works if the polyline has a constant width (since individual line widths are lost when exploded.)
One additional quirk: this needs to work in AutoCAD 14.
Any ideas?