Shape.Name Like "Dynamic connector*" identification

  • Thread starter Ðиколай Клиначёв
  • Start date
Ð

Ðиколай Клиначёв

I use figure Visio for programming a mathematical kernel
of the simulating program (such as VisSim or Simulink).
http://www.vissim.nm.ru/simkernel.html
(for translation use a GB flag in a bottom of page).

I should supervise rules of creation of the block diagram.
How to correctly identify occurrence in figure of the
communication line?
Please correct my code:

Private Sub Document_ShapeAdded(ByVal Shape As Visio.IVShape)
If Shape.Name Like "Dynamic connector*" Then
' ... rules
End If
End Sub

--
Regards,
Nikolay Klinachyov
educator of Electrical engineering department
and Computer science department
South-Ural State University (Russia)
 
A

Al Edlund

I would suggest that rather than focus on the object being added, you
consider how it interacts (since this is often the ultimate goal). Consider
this as an alternative
Al

Private Sub pagObj_ConnectionsAdded(ByVal Connects As Visio.IVConnects)

Dim iConCt As Integer
Dim vsoShape As Visio.Shape
Dim strPrompt As String

' Iterate through the connects collection passed to us
For iConCt = 1 To Connects.Count
' Do something with the info
With Connects(iConCt)
' get the name of the shape
Set vsoShape = Connects(iConCt).FromCell.Shape
strPrompt = "check Properties ? "
' if the vsoshape.name is some kind of connector then
If MsgBox(strPrompt, vbOKCancel) = vbOK Then
' then do some work
End If

End With
' MsgBox "connector added"
Next
End Sub
 

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

Similar Threads


Top