• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

bVisual

  • Home
  • Services
    • How Visio smartness can help your business
    • Visio visual in Power BI
    • Visio Consulting Services
    • Visio Bureau Services
    • Visio Training and Support Services
  • Products
    • Visio Shape Report Converter
    • SS Plus
    • LayerManager
    • visViewer
    • Metro Icons
    • Rules Tools for Visio
    • The Visio 2010 Sessions App
    • Multi-Language Text for Visio
    • Document Imager for Visio
    • multiSelect for Visio
    • pdSelect for Visio
  • Case Studies
    • Case studies overview
    • Visualizing Construction Project Schedules
    • Visio Online Business Process Mapping
    • Nexans Visio Template
    • CNEE Projects, WorldCom
    • Chase Manhattan Bank
  • News
    • Recent news
    • News archive
  • Resources
    • Articles➡
      • ShapeSheet Functions A-Z
      • Comparing Visio for the Web and Desktop
      • Customising Visio Shapes for the Web App
      • Key differences between the Visio desktop and web apps
      • Using the Visio Data Visualizer in Excel
      • Using Visio in Teams
      • Creating Visio Tabs and Apps for Teams with SharePoint Framework (SPFx)
      • Designing Power Automate Flows with Microsoft Visio
      • Innovative uses of Visio Lists
    • Webcasts ➡
      • Visio in Organizations
      • My session and other Visio sessions at MSIgnite 2019
      • Power up your Visio diagrams
      • Vision up your Visio diagrams
      • The Visio 2010 MVP Sessions
    • Visio Web Learning Resources
    • Books➡
      • Mastering Data Visualization with Microsoft Visio
      • Microsoft Visio Business Process Diagramming and Validation
      • Visualizing Information with Microsoft Visio
  • Blog
    • Browse blog articles
    • Visio Power BI articles
    • Visio for Web articles
    • A history of messaging and encryption
  • About us
    • About bVisual
    • Testimonials
    • Bio of David Parker
    • Contact Us
    • Website Privacy Policy
    • Website terms and conditions
    • Ariba Network
You are here: Home / Visio / A Patch Panel that can be 1U too

Published on August 5, 2010 by David Parker

A Patch Panel that can be 1U too

Microsoft Visio 2007 Professional and 2010 Professional and Premium includes the Network / Rack Diagram template, which opens the Rack-mounted equipment stencil. This stencil includes the Patch Panel master which can be stretched from 2U to 25U high. However, I have often required a 1U patch Panel, so I decided to look into the Microsoft shape to see if it could be modified to allow it to be reduced to 1U without looking ridiculous.

image

I opened up the ShapeSheet of the Patch Panel master and found that the formula in the Prop.UCount.Value cell is imposing 2 as a minimum value with the BOUND() function.

I changed the formula to =BOUND(2,0,FALSE,1,25), and was then able to change the UHeight to 1U, but the 24 ports remained visible:

image

I actually wanted the number of ports to be halved to 12, so I set about exploring the sub-shapes in the master. I found that Sheet.18 contains the port shapes, and that its height is fixed at 2 Us. All of its sub-shapes have a height formula referencing this height, so I decided to modify the PinY formula to =Sheet.5!Height*0.5*(IF(Sheet.5!Prop.UCount=1,2,1)) so that it would move the lower bank of ports up into the correct position if the Prop.UCount equals 1.

image

Then it was just necessary to go through each of the sub-shapes of Sheet.18 to modify the GeometryX.NoShow formula to =Sheet.5!Prop.UCount=1 for each Geometry section which is in the upper half of the shape.

image

At this point, I could see that I had to put this formula into 12 geometry sections of 4 shapes, which is 48 copy and pastes! Therefore, I decided to write some VBA code to do this instead. This has the advantage that you can run the code on existing documents that already have the Patch panel master in it. In fact, the Patch panel master must be in the local document stencil for this code to work.

 1: Public Sub UpdatePatchPanelMaster()
 2: Dim mst As Visio.Master
 3: Dim mstCopy As Visio.Master
 4: Dim shpPatchPanel As Visio.Shape
 5: Dim shpPortGroup As Visio.Shape
 6: Dim shpPortGraphics As Visio.Shape
 7: Dim i As Integer
 8: Dim iSect As Integer
 9: Dim dHeight As Double
 10:
 11:     For Each mst In Visio.ActiveDocument.Masters
 12:         If mst.Name = "Patch panel" Then
 13:             Set mstCopy = mst.Open
 14:             Set shpPatchPanel = mstCopy.Shapes(1)
 15:             For Each shpPortGroup In shpPatchPanel.Shapes
 16:                 If shpPortGroup.Cells("Height").FormulaU = _
 17:                         "Sheet.5!User.OneUHeight*2" Then
 18:                     shpPortGroup.Cells("PinY").FormulaU = _
 19:                         "=Sheet.5!Height*0.5*(IF(Sheet.5!Prop.UCount=1,2,1))"
 20:                     For Each shpPortGraphics In shpPortGroup.Shapes
 21:                         dHeight = shpPortGraphics.Cells("Height").ResultIU
 22:                         For i = 0 To shpPortGraphics.GeometryCount - 1
 23:                             iSect = Visio.visSectionFirstComponent + i
 24:                             If shpPortGraphics.CellsSRC(iSect, _
 25:                                     Visio.visRowComponent + 1, _
 26:                                     Visio.visY).ResultIU > dHeight * 0.5 Then
 27:                                 shpPortGraphics.CellsSRC(iSect, 0, _
 28:                                     Visio.visCompNoShow).Formula = _
 29:                                     "=Sheet.5!Prop.UCount=1"
 30:                             End If
 31:                         Next i
 32:                     Next shpPortGraphics
 33:                     Exit For
 34:                 End If
 35:             Next shpPortGroup
 36:             mstCopy.Close
 37:             mst.MatchByName = True
 38:             Exit For
 39:         End If
 40:     Next mst
 41:
 42: End Sub

And there you have it … the Patch panel can now be reduced to 1 U and it looks OK!

image

If you cannot be bothered to run the code, you can download the updated Patch panel and the code from here :  click here

Related

Filed Under: Network Diagrams, ShapeSheet Formulas, VBA, Visio

About David Parker

David Parker has 25 years' experience of providing data visualization solutions to companies around the globe. He is a Microsoft MVP and Visio expert.

Reader Interactions

Comments

  1. Hernán Silva Olivares says

    July 22, 2011 at 4:08 pm

    davidjpp, great example, tanks you, from Chile.!!!

    Reply
    • davidjpp says

      July 28, 2011 at 6:15 pm

      Thanks … from England!

      Reply
  2. Benny says

    October 13, 2011 at 3:40 pm

    Thanks!!

    Reply
  3. Barny says

    October 24, 2011 at 9:07 am

    Thanks for figuring this out. Special thanks for the “If you cannot be bothered” .vsd link : )

    Reply
  4. Hasi says

    December 28, 2011 at 11:38 pm

    Thx a lot mate

    Reply
  5. clark says

    January 6, 2012 at 7:01 am

    Thanks a lot from taiwan

    Reply
  6. John Mitchell says

    January 16, 2012 at 10:04 am

    Thanks from George, South Africa!

    Reply
  7. ugandran says

    March 5, 2012 at 4:19 am

    we need data center and floor idf contaiment stencil to be download in our current visio2007

    Reply
    • davidjpp says

      March 5, 2012 at 8:06 pm

      Have you checked out the following ?
      http://www.visiocafe.com/
      http://www.nexans.co.uk/eservice/UK-en_GB/navigatepub_183256_-22013/New_Release_of_Nexans_Visio_Template_software_now_.html

      Reply
  8. Lee says

    May 19, 2012 at 8:06 pm

    I don’t know if it’s just me, but for some reason the file will only open with powerpoint, where I get an error. Visio won’t recognize the file to import. I can’t believe finding a 1U patch panel has held this thing up 4 hours. Please help.

    Reply
    • davidjpp says

      May 21, 2012 at 10:40 am

      Well, I have generated a new link for you to try :
      http://sdrv.ms/JfFKkj

      Reply
  9. Adrian James says

    October 18, 2012 at 10:57 am

    Thanks I copied it – works well

    Reply
  10. Juliana says

    November 27, 2012 at 7:11 am

    You are so kind in sharing! Thanks a lot from Sweden/Brazil

    Reply
  11. MrSaphique says

    December 4, 2012 at 11:26 am

    I get an error the PinY.
    Standard value is: (BeginY+EndY)/2 what do I need to fill in here?

    Reply
    • davidjpp says

      January 11, 2013 at 5:16 pm

      When do you get this error?
      What language are you using?
      I enter the following for English:
      =Sheet.5!Height*0.5*(IF(Sheet.5!Prop.UCount=1,2,1))
      But you may need a comma as the decimal point?
      =Sheet.5!Height*0,5*(IF(Sheet.5!Prop.UCount=1,2,1))

      Reply
  12. Jason Mottley says

    January 29, 2013 at 3:41 pm

    Thanks from Texas!

    Reply
  13. kathars1s says

    March 25, 2013 at 6:20 pm

    Download link is dead.

    Reply
    • davidjpp says

      March 25, 2013 at 6:27 pm

      I just tested it … it looks live to me.

      Reply
  14. kathars1s says

    March 25, 2013 at 6:21 pm

    How do we run this code? Where in Visio?

    Reply
    • davidjpp says

      March 25, 2013 at 6:29 pm

      Just drag the Microsoft supplied Patch Panel into a document
      Add the code into the VBA project of the document
      Run the code

      Reply
  15. damian says

    April 17, 2013 at 1:44 am

    A good workaround and I like that you’ve changed to a VSD, however to make it easy, you can simply change the ShapeSheet data ‘User-defined Cells’, ‘User.OneUHeight’ to half of what it currently is, it will drop the height down.

    This is my fix for the situation at least, it still looks like it’s a double panel, but it looks pretty 🙂

    Reply
  16. Kassa says

    June 27, 2013 at 7:53 pm

    Thank you very much this is really help me….. thank you again – From Sri Lanka.

    Reply
  17. Антон Фатеев says

    November 6, 2013 at 2:14 am

    Thanks from Tomsk, Russia.

    Reply
  18. Loc Huynh says

    February 5, 2018 at 2:09 am

    Nice .. it worked 🙂 Thanks much.

    Reply
  19. alex says

    November 28, 2018 at 9:52 am

    link is down, i need it please

    Reply
    • davidjpp says

      November 28, 2018 at 10:35 am

      Link updated! 🙂

      Reply
      • alex says

        November 28, 2018 at 3:25 pm

        Thank you so much

        Reply
  20. Norseman says

    August 2, 2019 at 3:44 pm

    Brilliant! Never ceases to amaze me how companies can miss the little things when marketing their products….don’t think it makes a difference to have the “Visual Guy” use tools branded with your logo? Think again! His Visuals sell your product to the check writers! Your sales reps can’t do that!

    Dude, thanks for this nifty tool! Couldn’t find a 24 port patch stencil anywhere! 🙂

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • LinkedIn
  • Twitter

Recent Posts

  • Update to LayerManager add-in for non-English users
  • Pushing Data Visualizer in Visio beyond its limits
  • Pushing Data Visualizer in Visio to the limits!
  • Teams Tuesday Podcast Recording about Visio
  • Linking Data to Visio Shapes in Code

Categories

Tags

Accessibility Add-Ins Connectors Containers Data Export Data Graphics Data Import Data Visualizer Educational Excel GraphDatabase Hyperlinks Icon Sets JavaScript Layers Legend Link Data to Shapes Lists MSIgnite MVP Office365 Org Chart PowerApps PowerBI PowerQuery Processes Shape Data Shape Design ShapeSheet ShapeSheet Functions SharePoint 2013 SQL Teams Themes Validation VBA Video Visio Visio 2007 Visio 2013 Visio for the Web Visio Online Visio Services Visio Viewer Webinar

Footer

bVisual Profile

The UK-based independent Visio consultancy with a worldwide reach. We have over 25 years experience of providing data visualization solutions to companies around the globe.

Learn more about bVisual

  • LinkedIn
  • Twitter

Search this website

Recent posts

  • Update to LayerManager add-in for non-English users
  • Pushing Data Visualizer in Visio beyond its limits
  • Pushing Data Visualizer in Visio to the limits!
  • Teams Tuesday Podcast Recording about Visio
  • Linking Data to Visio Shapes in Code

Copyright © 2023 · Executive Pro on Genesis Framework · WordPress · Log in