Use
(setq p_param (vlax-curve-getparamatpoint ent (red cross coords)))
this will return the polyline parameter at that point (each vertex is a whole number parameter)
Then
(setq pre_param (fix p_param) ;the parameter of the vertex before
post-param (1+ pre_param) ;the vertex after
pre_vtx (vlax-curve-getpointatparam ent pre_param) ;gets the coords of the vertex before
post_vtx (vlax-curve-getpointatparam ent post_param) ;the coords of the vertex after
)
Find this line
(equal (car (setq l (mapcar a 2p))) (cadr l) 1.0e-
it is missing the final integer and the closing brace
The brace is easy but the final integer (8) is a guess as this was an error that occured when the system software was upgraded. See reason for edit
(equal (car (setq l (mapcar a 2p))) (cadr l) 1.0e-8)