How to Convert Arc into Serie of lines or Polylines.

How to Convert Arc into Serie of lines or Polylines.

Anonymous
Not applicable
1,869 Views
2 Replies
Message 1 of 3

How to Convert Arc into Serie of lines or Polylines.

Anonymous
Not applicable
I have a problem in my project, i need create the a drawing with severals acadobject(Lines,Polylines and Arcs) that i obtained from other drawing, well i have a Gerber Cutter Machine and this machine doesn´t accept Arcs the machine only accept Polyline, not curves, if i convert the arc with pedit into polyline the machine send me an error, so i need to create a series of lines and that lines represent the arc, well if some body knows a VBA Code for convert Arc into series of lines or Polylines, please help me or if any body have an idea of how to resolve this problem



I working in Arc Equation the arc is a section of circle, i want to use numerical integration method for find points in to arc. Like Newton Raphson, Simpson 3/8 but is very complex..



Or used



Chords were used extensively in the early development of trigonometry. The first known
trigonometric table, compiled by Hipparchus, tabulated the value of the Chord
function for every 7.5 degrees.



The chord function is defined geometrically as in the picture to the left.
The chord of an angle is the length of the chord between two points on a
unit circle separated by that angle



Im Lost in this issue




0 Likes
1,870 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
{code}
Sub arc2lines()

Dim myArc As AcadArc
Dim objSel As AcadEntity
Dim myPL As AcadLWPolyline
Dim mypolarpoint
Dim bulge() As Double
Dim legs As Integer
Const PI = 3.14159265358979
Dim delta As Double

ThisDrawing.Utility.GetEntity objSel, returnObj, "Select Arc:"
If objSel.ObjectName = "AcDbArc" Then
Set myArc = objSel
delta = myArc.EndAngle - myArc.StartAngle
If delta < 0 Then delta = delta + (2 * PI)
Dim numOfSegments As Integer
Dim points() As Double
'adjust below for reality
numOfSegments = CInt(myArc.ArcLength) ' length of segment = 1, last segment = remainder
ReDim points(0 To 2 * numOfSegments + 1)
ang = 1 / myArc.radius
points(0) = myArc.StartPoint(0)
points(1) = myArc.StartPoint(1)
adir = ang
For x = 2 To UBound(points) - 2 Step 2
mypolarpoint = ThisDrawing.Utility.PolarPoint(myArc.Center, myArc.StartAngle + adir, myArc.radius)
adir = adir + ang
points(x) = mypolarpoint(0)
points(x + 1) = mypolarpoint(1)
Next x
points(UBound(points) - 1) = myArc.EndPoint(0)
points(UBound(points) - 0) = myArc.EndPoint(1)
Set myPL = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
myPL.Update
End If

End Sub
{code} Edited by: cadger on Jan 6, 2009 2:25 PM
0 Likes
Message 3 of 3

Anonymous
Not applicable
Hello Cadger thanks very much the code it's I need. Happy New Year and thanks again I appreciate to much your help.
0 Likes