Previous Document Next Document
Layer.CreateConnector

Function CreateConnector(Start As SnapPoint, End As SnapPoint) As Shape

Member of Layer

The CreateConnector method creates a connector line.

See also the CreateFreeConnector method.

Parameters
Description
Start
Specifies the starting point of the connector line object
End
Specifies the ending point of the connector line object

The following code 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 code example creates a rectangle and an ellipse and draws a connector line that joins the center of each object. You can also use the Application.CreateSnapPoint function to create a free snap point 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 

Previous Document Next Document Back to Top

Copyright 2007 Corel Corporation. All rights reserved.