No time for a full program, but here's enough to get you well on your way to a finished product.
Thanks to Jürg Menzi for the code to calc bulge data.
(setq osmode (getvar "osmode"))
(setvar "osmode" 512)
(if (and (setq pt (getpoint "\nSelect pline: "))
(setq pline (nentselp pt))
)
(progn
(setq oPline (vlax-ename->vla-object (car pline)))
(setq param (fix (vlax-curve-getparamatpoint
oPline
pt
)
)
)
(setq bulge (vla-getbulge oPline param))
(setq begincurve (vlax-safearray->list
(vlax-variant-value
(vla-get-coordinate oPline param)
)
)
endcurve (vlax-safearray->list
(vlax-variant-value
(vla-get-coordinate oPline (1+ param))
)
)
)
;|-----------------------------------------------------------
Used by permission from Jürg Menzi
; -- Function CalcBulge
; Returns the geometric informations from a polyarc.
; Copyright:
; 2001 MENZI ENGINEERING GmbH, Switzerland
; Arguments [Typ]:
; Vx1 = Start vertex of p'arc [LIST]
; Vx2 = End vertex of p'arc [LIST]
; Blg = Bulge [REAL]
; Return [Typ]:
; > '(CenterPoint Radius IncludedAngle) [LIST]
; Notes:
; IncludedAngle in radians
|;
(defun CalcBulge (Vx1 Vx2 Blg / ArcRad CenDir HlfAng)
(setq HlfAng (* 2 (atan Blg))
CenDir ((if (< Blg 0)
-
+
)
(- (angle Vx1 Vx2) HlfAng)
(/ pi 2)
)
ArcRad (abs (/ (/ (distance Vx1 Vx2) 2.0) (sin HlfAng)))
)
(list
(polar Vx1 CenDir ArcRad)
ArcRad
(* (abs HlfAng) 2.0)
)
)
(setq bulgedata (calcbulge begincurve endcurve bulge))
;;the bulgdata will hold the RadiusPt coordinates, the radius and the Internal angle in Radians
;;;;
;;and now that you have the start, end & radius pts the begin & end angles are easily calc'ed
)
)