Network Rack Connections

Started by w9nl, September 02, 2010, 06:48:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

w9nl

I have a rack shape that has connection points for each RU.  This shape also has custom properties that show the Rack Name, and Location along with other properties.  If I have another shape with custom properties as well, lets say a 1RU blank panel, how can I pull the connection location from the rack to properly reflect the RU location of the blank panel? 

Example:
Say my rack has a location of 101.01
If I place a 1RU black panel at RU20, how can I pull information from the Rack shape to show in the custom properties of the Blank RU that it is in fact at location 101.01.20?

When I look at the shapesheet of the blank RU it shows as connected to the connection points for RU20 (looking at EndX and EndY)

I'm not sure if I can add a shapesheet formula to the 1RU blank panel or if I need some VBA code to do this.  I have many other uses for this besides this example, but they all revolve around connecting shapes to other shapes and essentially showing what is connected to what, and where. 

Thanks, I hope I explained this in a way that is understood.

aledlund

A variation of the question, how do I track where my connections are? When you drop your rack component into the rack, Visio will update the (if the shape is a 1D) 1d connection points with formulas that point to the shape parent (rack) connection points.

In this example the connection points in the rack shape were manually named (in the master shape). The rack name on the page is "6183_2" and the connection points are name "slot_49_x" where 49 was the physical slot. David Parker has an example in his book on how you could programmatically determine the slot of the generic rack shape that comes with the microsoft stencil (basically a modulus 2 check of the connection number).

=PAR(PNT('6183_2'!Connections.slot_49_2.X,'6183_2'!Connections.slot_49_2.Y))

al
w9luv

w9nl

Here is a real simple drawing of what I'm try to do here.  What I'm trying to do is show the custom property location of the 1RU Blank panel to be 101.05 as it is shown attached to that RU connection point.  Essentially pulling the location and RU from the rack and populating the 1RU blank panel when attached to a RU connection point.

aledlund

if you check your drawing. Using the shapesheet you will see that your rack is named sheet.3. Then if you check the shapesheet of 1ru blank panel

=PAR(PNT(Sheet.3!Connections.05.X,Sheet.3!Connections.05.Y)) it shows the panel is attached to the connections section of sheet.3 at line 05.
The rest is just reading the 1d section of the shapesheets and parsing out the correct connection point.

al


Visio Guy

More on finding out the name/id of your shape here: What's My Shape's ID?
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

w9nl

Quote from: aledlund on September 03, 2010, 03:15:58 AM
if you check your drawing. Using the shapesheet you will see that your rack is named sheet.3. Then if you check the shapesheet of 1ru blank panel

=PAR(PNT(Sheet.3!Connections.05.X,Sheet.3!Connections.05.Y)) it shows the panel is attached to the connections section of sheet.3 at line 05.
The rest is just reading the 1d section of the shapesheets and parsing out the correct connection point.

al



I get what you are saying except for your last sentence which is my question.  How do I translate =PAR(PNT(Sheet.3!Connections.05.X,Sheet.3!Connections.05.Y)) in the 1RU panel when is is connected to the rack to its named address of 101.01.5?  If you look at sheet.3 I have a formula for each connection point, in the case of Connection.5 it is =Sheet.1!Prop.Location&Connections.05.A.  This formula results in naming that connection point as 101.01.5

aledlund

What shows up in the shape cell is not the formula from Rack Shapes connection, but rather the connection point name. The default connection point name is "Connections.X" where the X is the connection point row number in the Connections Section of the ShapeSheet. The problem I was running into was that different stencil/master providers weren't consistent in how those connection points were named. To make it more interesting some times the racks rather than numbering from bottom-to-top, numbered them from top-to-bottom, so I couldn't use a one-size-fits-all piece of code to just get the connection points row number and do a little math to figure out what shelf it was. I used something like this when I went to parse out field information in vba.
al




                    ' two possible headers have been observed when
                    ' dropping shapes onto a each other for autoconnect
                    strConnDel = "!Connections."
                    strXDel = ".X,"
                    strYDel = ".Y"
                    Dim strHeader
                    strHeader = Left(strFront, 18)
                    If strHeader = "PNTX(LOCTOPAR(PNT(" Then
                        intHeader = 18
                    End If
                    strHeader = Left(strFront, 8)
                    If strHeader = "PAR(PNT(" Then intHeader = 8
                   
                    ' get the first half of the connection point (x)
                    intConnDel = InStr(1, strFront, strConnDel)
                    strParent1 = Mid(strFront, intHeader + 1, intConnDel - intHeader - 1)
                    arrReturn(1) = strParent1
                    ' in the rack master shapes (i.e. a custom stencil)
                    ' this only works because we manually renamed the connection points
                    intStart = intConnDel + Len(strConnDel)
                    strSlot1 = Mid(strFront, intConnDel + Len(strConnDel), intXDel - intStart)
                   
                    arrReturn(2) = strSlot1