API Documentation > CorelDRAW > 2025-v26 > ShapeRange > IVGShapeRange
ShapeRange.Clone method
Clones the ShapeRange and returns a reference to the range
Syntax:
Function Clone(Optional ByVal OffsetX As Double = 0, Optional ByVal OffsetY As Double = 0) As ShapeRange
Parameters:
Name Type Description
OffsetX
Double
Specifies the horizontal distance to offset the cloned shape range.
OffsetY
Double
Specifies the vertical distance to offset the cloned shape range.
Remarks:
The Clone method clones each shape in a shape range and returns a new shape range containing all of the clones.
Examples:
The following VBA example creates two rectangles and clones them.
Sub Test()
Dim sr As New ShapeRange
Dim srClone As ShapeRange
sr.Add ActiveLayer.CreateRectangle(0, 0, 1, 1)
sr.Add ActiveLayer.CreateRectangle(2, 0, 3, 1)
sr.ApplyUniformFill CreateRGBColor(255, 0, 0)
Set srClone = sr.Clone(0, 2)
sr.ApplyUniformFill CreateRGBColor(0, 0, 255) 
End Sub