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