Extending an example given by Jeff M. to get this.
(setq pline (entsel))
(setq pick (cadr pline))
(setq plObj (vlax-ename->vla-object (car pline)))
(setq pick2 (vlax-curve-getclosestpointto plobj pick))
(setq param (vlax-curve-getparamatpoint plObj pick2))
(setq p1 (vlax-curve-getpointatparam plObj (fix param)))
(setq p2 (vlax-curve-getpointatparam plObj (fix (1+ param))))
(princ (angle p1 p2))
CAB...your code working well...since re-installing AutoCAD 2005..
now, when using this..
(setq plObj (vlax-ename->vla-object (car pline)))
the conversion do not seem to work anymore..i got this error message.
Select object to offset: ; erreur: Le serveur ActiveX a renvoyé une erreur:
Erreur lors du chargement de la bibliothèque/DLL du type
(sorry cause we have all AutoCAD french here so i don'T know what is exactly the message in english)
do i need to load something before ? DLL ?