![]() |
![]() ![]() |
|
Named Connections As if we haven't had enough of named
connections of various kinds! In Visio however, named connections can work to your
professional advantage without raising questions or inspiring front page news. Greetins an weel met!!! Grand tae be
bak wi ye again
Let's take a wee bit of time to look at a problem that many
o ye folk face when creating connected diagrams. In earlier versions of Visio, if you were to look into a SmartShapes ShapeSheet you would see a Connection Points section with a row for each connection point that has been established on the shape. Programmatically, you could use Visios FromCell and ToCell properties of the Connects Object to ascertain what Cell Shape "A" had connected to on Shape "B", but that was all. Under Visio 5.0, you now have the ability to name each connection row in a ShapeSheets Connection Points Section, and furthermore, you can store additional information in the A through D cells of that named row. Now, by default, when you create a new connection point on a shape, there are only the older default X and Y cells shown. To enable the advanced features, select the row in the ShapeSheet, and then right-clicking, select the "Change Row Type" short-cut menu item. This will enable the naming of the row and add the A through D data storage cells to the Connection Point row. With this feature now enabled you may store whatever data is appropriate in the 4 storage cells. A typical case might be to store the IP address, and other Network connection information on a PC being connected to a network in the connections row of that Network Equipment shape for that particular connection. Another connection point on that piece of equipment might be reserved for connection power input, which might carry information such as voltage and cycle settings for international use. Of course it would be illegal, and quite possibly hazardous to the equipment to attempt to connect the network cable to the power input port, and therefore you will want to validate that the equipment is properly connected. The example that I am going to share with you is illustrated below: All information discussed here is included in a downloadable Visio drawing file. As you work with the drawing and glue and unglue the control handle to and from the connection points on the adjacent shape note how the Source Shapes text continually reflects the validity and status of the glued connection. For this example, I have attached two Custom Properties to the Target Shape. The Connection Points "A" Cells take their values from a reference to these Custom Property Cells. The User can set the values for each of the Custom Property items and this will be associated with the applicable Connection item. The automation code in the FindGlueItem() Subroutine is triggered whenever the value of the Source Shapes Control Handles "X" cell is changed. This is accomplished by the following line of code in one of the Source Shapes User Cells: =DEPENDSON(Controls.X1)+RUNADDON("FindGlueItem"). The mechanism is this Whenever the user moves the Source Shapes Control Handle, the User Cell User.TriggerChange is evaluated and then the VBA function FindGlueItem() is executed. The code for this function is listed below.
The key to making this work seamlessly is that when the code is triggered, the code looks for the Source Shape by name, gets its Connects Collection, and looks to see if a valid glue has been established. If it has, then the appropriate row is found and the "A" cell is queried for its value. This value is then passed back from the Target Shape to the Source Shape and the Text on the Source Shape, which takes its value from the User.GluedTo Cell, is updated. If no valid glue is present then the default "<Not connected>" string is passed back. "And Now For Something Completely Different "I just recently returned from Microsofts Business Applications Conference in Las Vegas, Nevada. In addition to a the grand information that was delivered to the attendees, the second keynote showed a Demo of the Visio and Great Plains interoperability functionality. Subsequent to that showing, the Visio booth was bedlam. The theme of the conference was "No App Is An Island" and this interoperability demo hit the nail "richt upon the heed"!!! Remember that the applications tha you create should not only be designed to increase your productivity within the Visio environment, but should be designed to solve the larger business challenges that you and your enterprise face every day! Your solutions should take full advantage of Visios scalable architecture. Begin with a wee bit o customisation within the ShapeSheet environment. Modify existing shapes. Create your own shapes. Maximise what you can do within the SmartShape symbols. Then dig in there an begin tae sling a wee bit o VBA code. Its no as hard as ye micht think!!! After you have Visio really hummin, then look at ways tae pass that intelligent information in your Visio Diagrams oot tae sey Excel, oor Access, oor Word!!! Imagine a full sales proposal system automated from within Visio, sending the final documents out through Word with a quick detour through Excel to generate financial analysis an a layoer in Access to look up the business rules for the configuration. Folks!!! This is verra powerfu stuff!!! And you have the complete toolkit to make it happen. Visio, MS Office, and the VBA built in to all of them!!! Weel till the next time I bid ye mak the most o the tools tha ye hae an . "Haste ye back." Dave "The Auld Scotsman" Edson
|
|
|
Copyright © 1998-2007 DBM & others | Disclaimer | Privacy | Re-publication | Trademarks | Webmaster | Home |