Connecting to a Specific Point

K

Ken K.

How do I make sure I use a specific connection point? For a basic flow chart box I want to connect to the bottom connector (X3?) and to the top of the next box (X4?). When I use the show shape sheet, I can see the connection point I want but I can not get it to connect using the following code. I pulled the example from the SDK.

Thanks,

Ken


Public Sub ConnectWithDynamicGlueAndConnector( _
vsoShapeFrom As Visio.Shape, _
vsoShapeTo As Visio.Shape)

' Parameters
' vsoShapeFrom The shape from where the dynamic
' connector begins
'
' vsoShapeTo The shape from where the dynamic
' connector ends

Dim vsoApplication As Visio.Application
Dim vsoStencil As Visio.Document
Dim vsoMaster As Visio.Master
Dim vsoConnector As Visio.Shape
Dim vsoBeginX As Visio.Cell
Dim vsoEndX As Visio.Cell

On Error GoTo ConnectWithDynamicGlueAndConnector_Err

' Get the Application object from the shape.
Set vsoApplication = vsoShapeFrom.Application

' Access the Basic Flowchart Shapes stencil.
Set vsoStencil = vsoApplication.Documents.OpenEx( _
"Basic Flowchart Shapes (US units).vss", _
visOpenDocked)

' Get the master on the stencil by its universal name.
Set vsoMaster = vsoStencil.Masters.ItemU( _
"Dynamic Connector")

' Add connector to the page.
Set vsoConnector = vsoApplication.ActivePage.Drop( _
vsoMaster, 0, 0)

' Connect the begin point to the PinX of a 2-D shape.
Set vsoBeginX = vsoConnector.CellsSRC( _
visSectionObject, visRowXForm1D, vis1DBeginX)

vsoBeginX.GlueTo vsoShapeFrom.CellsSRC( _
visSectionObject, visRowXFormOut, visXFormPinX)

' Connect the end point to the PinX of another 2-D
' shape.
Set vsoEndX = vsoConnector.CellsSRC( _
visSectionObject, visRowXForm1D, vis1DEndX)

vsoEndX.GlueTo vsoShapeTo.CellsSRC( _
visSectionObject, visRowXFormOut, visXFormPinX)

Exit Sub

ConnectWithDynamicGlueAndConnector_Err:
MsgBox Err.Description

End Sub
 
A

Al Edlund

after inserting named connection points into the object, I use something
like this...

Set objConnector = objPage.Drop(objMaster, 0, 0)
' put connection text in for debug
objConnector.Text = intLNode & "_" & intRNode
Set objBeginX = objConnector.CellsSRC( _
visSectionObject, visRowXForm1D, vis1DBeginX)
objBeginX.GlueTo objLeftShape.Cells("connections.right")
Set objEndX = objConnector.CellsSRC( _
visSectionObject, visRowXForm1D, vis1DEndX)
objEndX.GlueTo objRightShape.Cells("connections.left")

Ken K. said:
How do I make sure I use a specific connection point? For a basic flow
chart box I want to connect to the bottom connector (X3?) and to the top of
the next box (X4?). When I use the show shape sheet, I can see the
connection point I want but I can not get it to connect using the following
code. I pulled the example from the SDK.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top