Visio Guy

Visio Discussions => Programming & Code => Topic started by: Evgenyy on February 19, 2013, 07:59:12 AM

Title: Defining the properties of Shapes connected across the Dynamic connector
Post by: Evgenyy on February 19, 2013, 07:59:12 AM
Hi!
I'm not speak English, but need your help.

There is a set of Shape's that the user connects to each other using "Dynamic connector".
Can I get the software features of these Shape's?

You to understand the user's actions, I recorded Macro:


    Application.Windows.ItemEx("file.vsd").Activate
    Application.ActiveWindow.Page.Drop Application.Documents.Item("C:\file.vsd").Masters.ItemU("111"), 6.25, 7.55

    Application.Windows.ItemEx("file.vsd").Activate
    Application.ActiveWindow.Page.Drop Application.Documents.Item("C:\file.vsd").Masters.ItemU("222"), 7.25, 5.87

    Application.Windows.ItemEx("в подвале.vsd").Activate
    Application.ActiveWindow.Page.Drop Application.Documents.Item("C:\file.vsd").Masters.ItemU("Dynamic connector"), 0#, 0#


Thank you for help and Google translator for the translation ::)
Title: Re: Defining the properties of Shapes connected across the Dynamic connector
Post by: Surrogate on February 19, 2013, 08:16:47 AM
Do you speak Russian ?
Quote
    Application.Windows.ItemEx("file.vsd").Activate
    Application.ActiveWindow.Page.Drop Application.Documents.Item("C:\file.vsd").Masters.ItemU("111"), 6.25, 7.55
' there you selected master named "111" in file "C:\file.vsd", and drop this master to coordinates 6.25 in, 7.55 in
     ' здесь вытаскивается на лист мастер "111" из файла "C:\file.vsd", в точку с координатами  6.25 in, 7.55 in  
   
QuoteApplication.Windows.ItemEx("file.vsd").Activate
    Application.ActiveWindow.Page.Drop Application.Documents.Item("C:\file.vsd").Masters.ItemU("222"), 7.25, 5.87
' there you selected master named "222" in file "C:\file.vsd", and drop this master to coordinates 7.25 in, 5.87 in
     ' здесь вытаскивается на лист мастер "222" из файла "C:\file.vsd", в точку с координатами  7.25 in, 5.87 in  
   
QuoteApplication.Windows.ItemEx("в подвале.vsd").Activate
' activated file "в подвале.vsd", WARNING i think there is broken file path
      ' Активируем файл "в подвале.vsd", ВНИМАНИЕ здесь может быть битая гиперссылка !  
   
QuoteApplication.ActiveWindow.Page.Drop Application.Documents.Item("C:\file.vsd").Masters.ItemU("Dynamic connector"), 0#, 0#
' there you selected master named "Dynamic connector" in file "C:\file.vsd", and drop this master to coordinates 0 in, 0 in
     ' вытаскиваем "Dynamic connector" из файла "C:\file.vsd", и кидаем в точку 0 in, 0 in
Title: Re: Defining the properties of Shapes connected across the Dynamic connector
Post by: Evgenyy on February 19, 2013, 09:19:50 AM
Yes, of course I speak Russian, but I read in English  ;)

Yes, think there is broken file path...
I changed the code, not to meet Russian words, not everything has changed.  ::)

I know what does the  Macro .
It was written for you to understand the user.
The question is, what to add in a line to get the names and properties of the Shape's that are connected to the Dynamic connector
Title: Re: Defining the properties of Shapes connected across the Dynamic connector
Post by: Surrogate on February 19, 2013, 09:38:10 AM
ok, but i cann't speak English. Only write and read  :-\

are you sure that shapes from masters have these properties ?
which of properties are you mean: shapedata or user-defined cells ?

About two year ago i write macro which get shapedata from shapes with connected dynamic connectors. i'll find this macro on all my computers
Title: Re: Defining the properties of Shapes connected across the Dynamic connector
Post by: Evgenyy on February 19, 2013, 10:07:48 AM
Maybe I did not need the Dynamic connector. I want the user to visually connecting Shape's and the code could get the properties connected Shape's.
Title: Re: Defining the properties of Shapes connected across the Dynamic connector
Post by: Surrogate on February 19, 2013, 10:44:32 AM
In this attachment you can see drawing with some network devices. You may reconnect dynamic connectors to ports (which you can see above green rectangles).

Macro in this file created table of connections. It create new Excel file named like as "T5_auto_T5_v027.xls", and fill this table there

Hyperlink for unregistred users (https://surrogate-tm.github.io/surrogate/docs/T5_auto.vsd)