Ok Dlanor i will wait . Thanks
Attached is revised lisp. This checks that the block is on the polyline, and within 10mm of a vertex. This should eliminate blocks on the polyline but not close to a vertex.
If the block isn't on the polyline it checks if the block is within 10mm of the polyline and 10mm of a vertex (max dist 14.14mm) This will eliminate blocks not on a vertex and not on the polyline.
This will allow for a minor misplacement of a block that perhaps should be on a polyline. Whatever happens the listed x and y coords are the coords of the closest vertex.
If you want this changing, please let me know.