Radius!

Discussion in 'AutoCAD' started by fazzini, Mar 4, 2004.

  1. fazzini

    fazzini Guest

    Can i get the radius (not bulge), or the center of the arc entity into a polilyne?
    Thx to help.
     
    fazzini, Mar 4, 2004
    #1
  2. James Belshan, Mar 4, 2004
    #2
  3. fazzini

    Bill Wright Guest

    Here are a couple of functions that I put together based on some other functions I
    found on the internet.

    Private Function GetBulgeRadius(ByVal bulge As Double, ByVal chord As Double) As
    Double
    'dimension locals
    Dim Ang As Double
    Dim IsoAng

    Ang = Atn(bulge) * 4
    IsoAng = Ang / pi * 180
    If IsoAng < 0 Then
    IsoAng = (IsoAng + 180) / 2
    Else
    IsoAng = (180 - IsoAng) / 2
    End If
    IsoAng = IsoAng / 180 * pi
    GetBulgeRadius = (chord / 2) / Cos(IsoAng)
    End Function

    Public Function GetCenterPt(ByVal p1 As Variant, ByVal p2 As Variant, ByVal bulge As
    Double) As Variant
    'dimension locals
    Dim Lin1 As AcadLine
    Dim Ang As Double
    Dim IsoAng As Double
    Dim Radius As Double
    Dim ClockWise As Boolean
    Dim RadAng As Double
    Dim trigtool As New CTrigTools

    Set Lin1 = ThisDrawing.ModelSpace.AddLine(p1, p2)
    Ang = Atn(bulge) * 4
    IsoAng = Ang / pi * 180
    If IsoAng < 0 Then
    IsoAng = (IsoAng + 180) / 2
    ClockWise = True
    Else
    IsoAng = (180 - IsoAng) / 2
    End If
    IsoAng = IsoAng / 180 * pi
    If ClockWise Then
    RadAng = Lin1.Angle + IsoAng + pi
    Else
    RadAng = Lin1.Angle - IsoAng + pi
    End If

    Radius = (Lin1.Length / 2) / Cos(IsoAng)
    GetCenterPt = ThisDrawing.Utility.PolarPoint(p2, RadAng, Radius)
    Lin1.Delete
    End Function
     
    Bill Wright, Mar 4, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.