Arc

Arc

Anonymous
Not applicable
328 Views
4 Replies
Message 1 of 5

Arc

Anonymous
Not applicable
I want to draw arc using VBA. For this required input is center, radius, start and end angles.

But in my case I have Start point,end point and radius. I can draw arc using theses parameters in Autocad, but don't know how i can draw arc in VBA using these given parameters.

Does any wany suggest me way to do so ??

regards
0 Likes
329 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Some basic math may help here. Unless one of the points is tangential and you also specify CW/CCW order of the points, there are mutiple arcs that can be drawn with start/end point and the radius. Try it in AutoCAD and you will see what I mean. -- egc - Sudden Supernumerary For Sale Cheap. Dick Cheney's Best Seller "Obtaining Government Contracts - You Too Can Make a Killing" ------------------------------------------------------------------------ egc's Profile: http://www.vbdesign.net/expresso/member.php?action=getinfo&userid=1023 View this thread: http://www.vbdesign.net/expresso/showthread.php?threadid=59852
0 Likes
Message 3 of 5

Anonymous
Not applicable
hello, thanks for reply
my arc is drawn in counter clock wise and I could not find multiple arcs in Vba. Can you give me more hints about it?

details
0 Likes
Message 4 of 5

Anonymous
Not applicable
This might help you. (No error checking at all): Public myarc As AcadArc Public Const pi As Double = 3.14159265358979 Public Sub DrawArcSER(sp As Variant, ep As Variant, rad As Double) Dim h As Double Dim b As Double Dim ls As Double Dim mp As Variant Dim cp As Variant Dim sa As Double Dim ea As Double b = ThisDrawing.Utility.AngleFromXAxis(sp, ep) ls = Sqr((sp(0) - ep(0)) ^ 2 + (sp(1) - ep(1)) ^ 2) mp = ThisDrawing.Utility.PolarPoint(sp, b, ls / 2#) h = Sqr(rad ^ 2 - (ls / 2#) ^ 2) cp = ThisDrawing.Utility.PolarPoint(mp, b + (pi / 2#), h) sa = ThisDrawing.Utility.AngleFromXAxis(cp, sp) ea = ThisDrawing.Utility.AngleFromXAxis(cp, ep) Set myarc = ThisDrawing.ModelSpace.AddArc(cp, rad, sa, ea) End Sub 'example of how to use the DrawArcSER sub Sub DARC() Dim spoint As Variant Dim epoint As Variant Dim radius As Double spoint = ThisDrawing.Utility.GetPoint(, "Arc Start Point:") epoint = ThisDrawing.Utility.GetPoint(spoint, "Arc End Point:") radius = ThisDrawing.Utility.GetDistance(spoint, "Arc Radius:") Call DrawArcSER(spoint, epoint, radius) End Sub -- Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica (sorry, phony e-mail, SPAM made me do it) "Kumar" wrote in message news:8130509.1077988642819.JavaMail.jive@jiveforum1.autodesk.com... > I want to draw arc using VBA. For this required input is center, radius, start and end angles. > > But in my case I have Start point,end point and radius. I can draw arc using theses parameters in Autocad, but don't know how i can draw arc in VBA using these given parameters. > > Does any wany suggest me way to do so ?? > > regards
0 Likes
Message 5 of 5

Anonymous
Not applicable
If Jorge's example [nice one:)] doesn't help, check out http://vbdesign.net. ___________________________ Mike Tuersley CADalyst's AutoCAD Clinic Rand IMAGINiT Technologies
0 Likes