Dynamic Connector Direction

M

Mike

Hi I have a diagram using boxes and dynamic connectors, one end of the
connector has a large arrow head. What I want to achieve is to know which en
is which at the ConnectionAdded event so that I can stop the connection if it
is not valid. This will be determined by some busic logis and the type of
shape its being connected to.

Have trapped the event and got the connect object but cannot tell which end
this is for from the code.

Regards

Mike
 
J

JuneTheSecond

I happened to have a sample that i hope may help.
Private WithEvents myPage As Visio.Page
Private myShape As Visio.Shape

Private Sub Document_DocumentOpened(ByVal doc As IVDocument)
Set myPage = ActivePage
End Sub

Private Sub Document_DocumentSaved(ByVal doc As IVDocument)
Set myPage = ActivePage
End Sub

Private Sub myPage_ConnectionsAdded(ByVal Connects As IVConnects)
Set myShape = ActivePage.Shapes(Connects.FromSheet.Index)
If Not myShape.Cells("BeginX").Formula Like "*mm" Then
myShape.Cells("BeginArrow").FormulaU = "13"
End If
If Not myShape.Cells("EndX").Formula Like "*mm" Then
myShape.Cells("EndArrow").FormulaU = "0"
End If
End Sub

Private Sub myPage_ConnectionsDeleted(ByVal Connects As IVConnects)
Set myShape = ActivePage.Shapes(Connects.FromSheet.Index)
If myShape.Cells("BeginX").Formula Like "*mm" Then
myShape.Cells("BeginArrow").FormulaU = "0"
End If
If myShape.Cells("EndX").Formula Like "*mm" Then
myShape.Cells("EndArrow").FormulaU = "0"
End If
End Sub
 
M

Mike Weston

Hi

Have had a play with your code and unless I am missing something I do not
think it achieves exactly what I want, essentially the problem I see is
this code allows you to detect which end is connected for the first
connection but on the second connection you will not be able to tell?

Regards

Mike
 
B

bobotan

Hi !

That's exactly what i want to do but i can't dowload the zip...
it asks for a login/pass and since i don't know japanese can u help me?

Thank u
 

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