API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateEllipse2 method
Creates an ellipse by specifying its center and radius
Syntax:
Function CreateEllipse2(ByVal CenterX As Double, ByVal CenterY As Double, ByVal Radius1 As Double, Optional ByVal Radius2 As Double = 0, Optional ByVal StartAngle As Double = 90, Optional ByVal EndAngle As Double = 90, Optional ByVal Pie As Boolean = False) As Shape
Parameters:
Name Type Description
CenterX
Double
CenterY
Double
Radius1
Double
Radius2
Double
Specifies, in document units, the measurement from the y-coordinate of the center point to the circumference.
StartAngle
Double
Specifies the degree of the start angle for the ellipse.
EndAngle
Double
Specifies the degree of the end angle for the ellipse.
Pie
Boolean
Specifies whether the ellipse is a pie.
Remarks:
The CreateEllipse2 method creates an ellipse, at a specified location on a layer, by using the coordinates of the shape's center, the horizontal radius, and (if desired) the vertical radius.
Examples:
The following VBA example creates a yellow circle in the middle of the page and a green ellipse above it.
Sub Test()
Dim s As Shape
Dim lr As Layer
Set lr = ActiveLayer
ActiveDocument.DrawingOriginX = 0
ActiveDocument.DrawingOriginY = 0
Set s = lr.CreateEllipse2(0, 0, 1)
s.Fill.UniformColor.RGBAssign 255, 255, 0 'Yellow
Set s = lr.CreateEllipse2(0, 2, 2, 1)
s.Fill.UniformColor.RGBAssign 0, 255, 0 'Green 
End Sub