API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreatePolygon method
Creates a polygon by specifying coordinates
Syntax:
Function CreatePolygon(ByVal Left As Double, ByVal Top As Double, ByVal Right As Double, ByVal Bottom As Double, ByVal Sides As Long, Optional ByVal SubPaths As Long = 1, Optional ByVal Complexity As Long = 1, Optional ByVal Star As Boolean = False, Optional ByVal StarComplexity As Long = 50, Optional ByVal MaxComplexity As Long = 100) As Shape
Parameters:
Name Type Description
Left
Double
Top
Double
Right
Double
Bottom
Double
Sides
Long
SubPaths
Long
Specifies the number of subpaths in the polygon.
Complexity
Long
Star
Boolean
Specifies whether the polygon appears as a star shape.
StarComplexity
Long
MaxComplexity
Long
Remarks:
The CreatePolygon method creates a new polygon at a specified location on a layer.
Examples:
The following VBA example creates a star on the active layer.
Sub Test()
ActiveLayer.CreatePolygon 0, 3, 3, 0, 5, 1, 1, True 
End Sub