API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateRectangle method
Creates a rectangle by specifying coordinates
Syntax:
Function CreateRectangle(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, Optional ByVal CornerUL As Long = 0, Optional ByVal CornerUR As Long = 0, Optional ByVal CornerLR As Long = 0, Optional ByVal CornerLL As Long = 0) As Shape
Parameters:
Name Type Description
Left
Double
Top
Double
Right
Double
Bottom
Double
CornerUL
Long
Specifies the roundness measurement of the upper-left corner of the rectangle. Values range between 0 and 100.
CornerUR
Long
Specifies the roundness measurement of the upper-right corner of the rectangle. Values range between 0 and 100.
CornerLR
Long
Specifies the roundness measurement of the lower-right corner of the rectangle. Values range between 0 and 100.
CornerLL
Long
Specifies the roundness measurement of the lower-left corner of the rectangle. Values range between 0 and 100.
Remarks:
The CreateRectangle method creates a rectangle at a specified location on a layer. This method uses the coordinates of the upper-left and lower-right corners of the rectangle as parameters and, optionally, the roundness of each corner. When you round the corners of a rectangle, CorelDRAW splits each corner node in two and draws an arc between each of these two new nodes.
Examples:
The following VBA example creates a 5" square with 20% corner roundness (that is, a corner radius of 0.5").
Sub Test()
ActiveLayer.CreateRectangle 0, 0, 5, 5, 20, 20, 20, 20 
End Sub