Author Topic: Get text from multiple connections to a custom prop in shape  (Read 164 times)

0 Members and 1 Guest are viewing this topic.

Lucali

  • Newbie
  • *
  • Posts: 4
Get text from multiple connections to a custom prop in shape
« on: February 14, 2020, 03:53:45 PM »
Hi to all  :). Thanks to this forum, I was able to make a first part of what I need (I am not a programmer, but I try to understand how far I can) and I need help with the following, which I do not know if it can be done from Shape Sheet or if it is better via code .

I have rectangles with custom cells, and they can receive one or more connections.

So my idea was that the connector receives the text I need from the output rectangle. Once with that data, the input rectangle, read the field obtained in the connection.

The problem is that a table can probably have 10 inputs, I'm only interested in the inputs.
How can I do, as for each input that receives the shape, place the FromName text of the connector, in the corresponding field Input1, Input2, Input3 (up to 10 at least they will be)
Is it feasible in any way?
Thanks in advance

Lucali

  • Newbie
  • *
  • Posts: 4
Re: Get text from multiple connections to a custom prop in shape
« Reply #1 on: February 16, 2020, 11:05:17 PM »
Hi Guys, seeing this post http://visguy.com/vgforum/index.php?topic=8116.msg35112#msg35112 , where Wapperdude recommend some links, i can do the following

Public Sub GetIncomingShapes()
'Use Shape.ConnectedShapes to get the shapes that are incoming connections to a shape
    Dim shp As Visio.Shape
    Dim shpIDs() As Long
    Dim i As Integer

    If ActiveWindow.Selection.Count = 0 Then
        MsgBox ("select a shape with connections")
        Exit Sub
    Else
        Set shp = ActiveWindow.Selection(1)
    End If

    shpIDs = shp.ConnectedShapes(visConnectedShapesIncomingNodes, "")
    Debug.Print "Incoming shapes"
    For i = 0 To UBound(shpIDs)
        Debug.Print ActivePage.Shapes.ItemFromID(shpIDs(i)).Name
    Next
End Sub

In this way, debug print show me all incoming for "selected" shape.

May be exist a way to go through each shape of the active page, and, for each shape (including those in a group), retain in variables, the names of the posibles inputs and then look for the custom property of each input retained in variable, and after write it in the custom property of the shape that It is being analyzed?

Regards
Zule

-
-