Here is the commented code because most of the vla stuff confuses me.
;; CAB added to code & comments to code by Jeff M. to get the angle of the segment
(defun c:geta ()
(setq pline (entsel))
(setq pick (cadr pline))
;; convert ename into a vla object, although this is not needed with the
;; vlax-curve is in keeping with the other methods using vla objects
(setq plObj (vlax-ename->vla-object (car pline)))
;; get a point exactly on the object as entsel may not return the exact point needed
(setq pick2 (vlax-curve-getclosestpointto plobj pick))
;; get parameter, it is vertex # plus percent to next vertex, that ia mu understanding of it
;; so a point mid way between vertex 3 & 4 would have a parameter of 3.5
(setq param (vlax-curve-getparamatpoint plObj pick2))
;; get point at vertex, (fix 3.5) = 3
(setq p1 (vlax-curve-getpointatparam plObj (fix param)))
; get point at next vertex, (fix (1+ 3.5)) = 4
(setq p2 (vlax-curve-getpointatparam plObj (fix (1+ param))))
;; I'm sure you figured this one out
(princ (angle p1 p2))
(princ)
)
To get information about commands available look at this picture of the VLIDE editor.
1. highlight the command or in this case part of the command
2. click on the apropos button to bring up the dialog box
3. Highlight the command you want info on
4. Click on the ? help button.
There you have it.