API Documentation > CorelDRAW > 2025-v26 > Shape > IVGShape
Shape.Clone method
Clones the shape and returns a reference to the cloned shape
Syntax:
Function Clone(Optional ByVal OffsetX As Double = 0, Optional ByVal OffsetY As Double = 0) As Shape
Parameters:
Name Type Description
OffsetX
Double
Specifies the horizontal distance to offset the cloned shape.
OffsetY
Double
Specifies the vertical distance to offset the cloned shape.
Remarks:
The Clone method clones a shape and returns a reference to that clone.
Examples:
The following VBA example creates a red rectangle, clones it, and then changes the fill of the clone to green.
Sub Test()
Dim rs As Shape, cs As Shape
Set rs = ActiveLayer.CreateRectangle2(0, 0, 4, 2)
rs.Fill.UniformColor.CMYKAssign 0, 100, 100, 0
Set cs = rs.Clone(0, 3)
cs.Fill.UniformColor.CMYKAssign 100, 0, 100, 0 
End Sub