Area / Radius properties example

Sub Area_Example()
' This example adds a circle to the drawing and returns it's Radius and Area.
' It the modifies the radius and returns modified values.
    Dim cenPt(0 To 2) As Double: cenPt(0) = 4: cenPt(1) = 2: cenPt(2) = 0
    Dim dRadius As Double: dRadius = 2.5
    'Add the arc to the .dwg
    Dim myCircle As AcadCircle
    Set myCircle = ThisDrawing.ModelSpace.AddCircle(cenPt, dRadius)
    Dim dArea As Double
    dArea = myCircle.Area
    dRadius = myCircle.radius
    MsgBox "Area = " & dArea & Chr(13) & "dRadius = " & dRadius
    ' modify the radius
    myCircle.radius = 5#
    myCircle.Update
    MsgBox "Area = " & myCircle.Area & _
    Chr(13) & "Radius = " & myCircle.radius & _
    Chr(13) & "Diameter = " & myCircle.Diameter
End Sub

© Bricsys NV. All rights reserved.