API Documentation > CorelDRAW > 2025-v26 > Shape > IVGShape
Shape.CreateBoundary method
Creates a boundary shape around the Shape object
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 boundary object in front of the shapes. A value of True places the boundary object in front of the shapes.
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 circle and retrieves a user-specified point. If the point is valid, a boundary is created relative to the circle and is filled with red.
Sub Test()
Dim shpEllipse As Shape, shpBound As Shape
Dim x As Double, y As Double
Set shpEllipse = ActiveLayer.CreateEllipse2(0, 0, 6, 4)
b = ActiveDocument.GetUserClick(x, y, 0, 10, False, cdrCursorEyeDrop)
If b=0 Then
  Set shpBound = shpEllipse.CreateBoundary(x, y, False, False)
  shpBound.Fill.UniformColor.RGBAssign 255, 0, 0
End If 
End Sub