API Documentation > CorelDRAW > 2025-v26 > ShapeRange > IVGShapeRange
ShapeRange.CreateBoundary method
Creates a boundary shape around the items in the ShapeRange
Syntax:
Function CreateBoundary(ByVal x As Double, ByVal y As Double, Optional ByVal PlaceOnTop As Boolean = False, Optional ByVal DeleteSource As Boolean = False) As Shape
Parameters:
Name Type Description
x
Double
y
Double
PlaceOnTop
Boolean
Specifies whether to place the boundaryobject in front of the shapes. A value of True places the boundary object in front of the shape range.
DeleteSource
Boolean
Specifies whether to delete the object upon which the boundary is based. A value of True deletes the original object.
Remarks:
The CreateBoundary method creates a closed Bézier curve based on the specified shapes and a user-specified bias point. If the bias point lies outside of the extent of the specified shapes, the boundary object is the common outline of the specified shapes. If the bias point lies within one or more of the specified shapes, the boundary object is the internal outline of the union of the specified shapes at the bias point. If the operation fails, Nothing is returned.
Examples:
The following VBA example creates a shape range consisting of a circle and a rectangle, and it retrieves a user-specified point. If the point is valid, a boundary is created relative to the shapes in the shape range and is filled with red.
Sub Test()
Dim sr As New ShapeRange, shpBoundary As Shape
Dim x As Double, y As Double
sr.Add ActiveLayer.CreateEllipse(3, 5, 6, 2)
sr.Add ActiveLayer.CreateRectangle(5, 6, 7, 4)
If ActiveDocument.GetUserClick(x, y, 0, 10, False, cdrCursorEyeDrop) = 0 Then
  Set shpBoundary = sr.CreateBoundary(x, y, True)
  shpBoundary.Fill.UniformColor.RGBAssign 255, 0, 0
End If 
End Sub