API Documentation > CorelDRAW > 2025-v26 > Layer > IVGLayer
Layer.CreateConnector method
Creates a connector on a layer
Syntax:
Function CreateConnector(ByVal Start As SnapPoint, ByVal End As SnapPoint) As Shape
Parameters:
Name Type Description
Start
End
Remarks:
The CreateConnector method creates a connector line at a specified location on a layer. See also the Layer.CreateFreeConnector method.
Examples:
The following VBA example creates a rectangle and ellipse on the active layer and draws a connector line between them.
Sub Test()
Dim rect As Shape, ell As Shape
Dim lr As Layer
Set lr = ActiveLayer
Set rect = lr.CreateRectangle(0, 0, 3, 3)
Set ell = lr.CreateEllipse2(5, 5, 1, 1)
lr.CreateConnector rect.SnapPoints(9), ell.SnapPoints(5) 
End Sub
The following VBA example creates a rectangle and an ellipse and draws a connector line that joins the center of each object.
Sub Test()
Dim r As Shape, e As Shape
Set r = ActiveLayer.CreateRectangle(0, 0, 3, 3)
Set e = ActiveLayer.CreateEllipse2(5, 5, 1, 1)
ActiveLayer.CreateConnector r.SnapPoints(r.SnapPoints.Count), _
  e.SnapPoints(e.SnapPoints.Count) 
End Sub