
I have worked on the code since asking my question and I think I'm almost there. this is what I have right now.
(vl-load-com)
(defun c:AUTODIM ( / en1 en2 int len stt len pt1 pt2 prefix linty new dim newdimvalue)
(if (and (setq en1 (car (entsel "\nSelect 1st polyline (dim from): ")))
(= "LWPOLYLINE" (cdr (assoc 0 (entget en1))))
(setq en2 (car (entsel "\nSelect 2nd polyline (dim to): ")))
(= "LWPOLYLINE" (cdr (assoc 0 (entget en2))))
(setq int (getdist "\nInterval: "))
(setq len (vlax-curve-getDistAtParam en1 (vlax-curve-getEndParam en1)))
(not (initget 4))
(setq stt (cond ((getreal "\nDistance at the beginning <0>: "))
(0)))
(not (initget 4))
(setq len (cond ((getreal (strcat "\nDistance at the end <Use the entire polyline = " (rtos len 2 2) ">: ")))
(len)))
(setq prefix "<>' ")
(setq linty (cond ((getstring T "\nWhat are you measuring to? <R/W>: "))
("R/W")))
)
(while (and (<= stt len)
(setq pt1 (vlax-curve-getPointAtDist en1 stt))
(setq pt2 (vlax-curve-getClosestPointTo en2 pt1)))
(command-s "_.DIMALIGNED"
"_none" (trans pt1 0 1)
"_none" (trans pt2 0 1)
"_none" (polar (trans pt1 0 1)
(+ (* 1.5 pi)
(angle (trans pt1 0 1) (trans pt2 0 1)))
1.5))
(setq newdim (entlast))
(setq newdimvalue (strcat prefix linty))
(command "dimedit" "n" newdimvalue newdim "")
(setq stt (if (= stt (min (+ stt int) ; if next point is beyond the end length
len))
(+ stt int) ; then use the beyond len which (while) does not pass
(min (+ stt int) ; else use middle point or max
len))))
(princ "\nWrong selection. Two LWPolylines are required.")
)
(princ)
)
My issue right now is that I would like to round the dimension to the nearest .5 and change the comma in the result to a decimal point. Also, when I don't input a string for my notation, rather than the R/W printing it just adds the footage mark.
Thank you for the swift reply.