API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateRectangle2 method
Creates a rectangle by specifying its bottom corner, width, and height
Syntax:
Function CreateRectangle2(ByVal x As Double, ByVal y As Double, ByVal Width As Double, ByVal Height As Double, Optional ByVal RadiusUL As Double = 0, Optional ByVal RadiusUR As Double = 0, Optional ByVal RadiusLR As Double = 0, Optional ByVal RadiusLL As Double = 0) As Shape
Parameters:
Name Type Description
x
Double
y
Double
Width
Double
Height
Double
RadiusUL
Double
Specifies the actual corner radius measurement of the upper-left corner.
RadiusUR
Double
Specifies the actual corner radius measurement of the upper-right corner.
RadiusLR
Double
Specifies the actual corner radius measurement of the lower-right corner.
RadiusLL
Double
Specifies the actual corner radius measurement of the lower-left corner.
Remarks:
The CreateRectangle2 method creates a rectangle, at a specified location on a layer, by using the coordinates for the upper-left corner, the width, the height, and the corner radii.
Examples:
The following VBA example creates a blend between two rectangles. The intermediate blend objects are rotated by 360° during the progression.
Sub Test()
Dim s1 As Shape, s2 As Shape
Set s1 = ActiveLayer.CreateRectangle2(0, 0, 3, 1)
s1.Fill.UniformColor.RGBAssign 255, 0, 0
Set s2 = ActiveLayer.CreateRectangle2(4, 4, 3, 1)
s2.Fill.UniformColor.RGBAssign 255, 255, 0
With s2.CreateBlend(s1).Blend
  .Loop = False
  .Angle = 360
End With 
End Sub