AddCircle Method (ActiveX)

Creates a circle given a center point and radius.

Supported platforms: Windows only

Signature

VBA:

RetVal = object.AddCircle(Center, Radius)
object

Type: Block, ModelSpace, PaperSpace

The objects this method applies to.

Center

Access: Input-only

Type: Variant (three-element array of doubles)

The 3D WCS coordinates specifying the circle's center.

Radius

Access: Input-only

Type: Double

The radius of the circle. Must be a positive number.

Return Value (RetVal)

Type: Circle

The newly created Circle object.

Remarks

This circle is created on the XY plane of the WCS.

Examples

VBA:

Sub Example_AddCircle()
    ' This example creates a circle in model space.
   
    Dim circleObj As AcadCircle
    Dim centerPoint(0 To 2) As Double
    Dim radius As Double
    
    ' Define the circle
    centerPoint(0) = 0#: centerPoint(1) = 0#: centerPoint(2) = 0#
    radius = 5#
    
    ' Create the Circle object in model space
    Set circleObj = ThisDrawing.ModelSpace.AddCircle(centerPoint, radius)
    ZoomAll
    
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_AddCircle()
    ;; This example creates a circle in model space.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; Define the circle
    (setq centerPoint (vlax-3d-point 0 0 0)  
          radius 5)
    
    ;; Create the Circle object in model space
    (setq modelSpace (vla-get-ModelSpace doc))
    (setq circleObj (vla-AddCircle modelSpace centerPoint radius))
    (vla-ZoomAll acadObj)
)