Published: April 1, 2000
For the latest information, please see http://office.microsoft.com/home/office.aspx?assetid=FX01085798
On This Page
Introduction
Start Simple, Then Expand as You Go
A Gallery of Custom Solutions
Assembled drawings for use as the final solution, or as part of a larger context
For Developers Only: Choices for Packaging Your Automation Code
Have Some Fun
Solution Evolution: Building Incremental Solutions
Additional Information
Introduction
The Microsoft Visio 2000 product line has established itself as the preferred set of tools for creating business diagrams and technical drawings. People everywhere are taking advantage of the Visio 2000 platform's power, ease of use, and flexibility by using these elements to model and improve company processes, business structures, and information flow; to diagram ideas, products, and space plans; and to collaborate with others on myriad technical and non-technical drawings—all with drag-and-drop drawing ease.
But that's only half the story. Another factor in the Visio 2000 software success story is the product line's ability to be customized. No off-the-shelf product can meet every company's every need, so Visio 2000 software comes with built-in customization capabilities that enable individuals, teams, departments, and corporations to tailor and extend the software to solve their particular graphic problems. You too can do this by using the tools that come with the Visio 2000 platform.
By creating custom solutions with Microsoft Visio 2000 products, you not only create drawings that are better suited to your particular business needs, you also create drawings that have greater value to your company. Whether you are sharing drawings across departments, analyzing process flow data, creating bills of material from configuration drawings, or compiling code from visual programming flowcharts, your Visio 2000 graphics are much more than pretty pictures.
The Microsoft Visio 2000 customization tools are flexible and easy to use—and they come right in the box. You use Visio 2000 drawing tools to create symbols, the ShapeSheet interface to turn your graphics into SmartShapes symbols, and the built-in Microsoft Visual Basic for Applications (VBA) to manipulate your drawing and link it with other applications via Automation. Furthermore, these tools allow you to develop your solution incrementally. That is, you can continually add features and functionality over time to take your graphics solution from simple illustrations to data-containing models that integrate with other applications and processes within your business.
Start Simple, Then Expand as You Go
Customization capability can be a double-edged sword. You can build exactly the tool that your business needs, but, of course, you have to build it. Luckily, when you customize Microsoft Visio 2000 software, you can incrementally add functionality to your solution. Add features as time and money permit. The answer to today's particular need may take the simplest tweak to an existing Visio 2000 shape. Tomorrow's challenge may require a full-blown, custom-made package that uses Automation to knit together Visio 2000 drawings, databases, and Microsoft Office or other applications. No matter which features you choose to implement, you increase the value of your drawings (Figure 1).
Figure 1: Incremental Development at Your Own Pace. No matter what the diagramming need, Visio 2000 technology lets you start small and build up solutions as you go. The more you add, the more value your models gain across your enterprise.
Microsoft Visio 2000 software offers a number of techniques and technologies for customization. You can work with one at a time, or mix and match many to suit the current need. For example:
Create symbols specific to
your
business. The Microsoft Visio 2000 platform comes with thousands of pre-drawn, intelligent SmartShapes symbols for diagramming in dozens of disciplines and industries. But if your own special fastener, manufacturing detail, or modeling component isn't there, adding it to the collection is easy. You can easily draw your own symbols in Visio 2000 or import existing symbols from other graphics applications.
Make your shapes
smart.
Microsoft Visio 2000 symbols can be much more than common clip art. Through the use of SmartShapes technology, you can attach data to shapes or build in "smart" behavior. The ShapeSheet interface, which is like a typical spreadsheet, is the tool you use to do this. Shapes can be parametrically and conditionally designed to have "intelligence" that enables them to change appearance based on the data they contain, the context in which they are used, or how the user manipulates them.
Package and distribute shapes and drawings. Once you have a set of shapes, they can be organized into libraries that are specific to a task, discipline, purpose, or department. In Microsoft Visio 2000 software, you arrange related shapes into libraries called stencils. Stencils can be used over and over and freely passed among co-workers either as separate files or as part of a template. Visio 2000 templates let you offer your users a drawing environment that is ready to go for the task at hand. The template opens stencils that contain shapes you need for the particular drawing type, and the drawing page is set up with elements such as title blocks, company logos, or a modifiable skeleton of the drawing to be made.
Go deeper with Automation. The Visio 2000 Automation interface enables you to write code that can manipulate shapes, analyze drawings, link shapes to external data, or integrate Visio 2000 technology with other applications. Automation programming is accessed via VBA, which comes with Microsoft Visio 2000 products, or via other Automation-capable languages such as C++ and Visual Basic. Automation allows you to tie together, into one solution, the myriad components that are at your disposal—from SmartShapes symbols and drawings to databases, applications, and toolkits.
A Gallery of Custom Solutions
What can you do when you start "thinking beyond the box" in Microsoft Visio 2000 products? Lots. Here are just a few Visio 2000 solutions that customers have dreamed up to meet their needs.
Product Configurations
Hewlett-Packard's network consultants commissioned a set of Visio 2000 shapes that represented equipment in HP's product line. Using these custom shapes with network shapes included with Visio 2000 software, HP consultants provide pre-sales support to field representatives and resellers by creating network diagrams that illustrate how HP products can be connected into efficient solutions for specific customers. The representatives, in turn, produce accurate illustrations and quotes of the systems, right at the customer's site, using laptop computers and Visio 2000 products (Figure 2).
Figure 2: Show Me the Network. Hewlett-Packard created dozens of SmartShapes objects and stencils to represent its unique computer-product shapes. The stencils and the configuration drawings created from them are shared freely among resellers, sales reps, and employees.
In-field Diagramming
The team at Virginia-based Synergetics Systems used OLE technology to embed a Visio 2000 drawing as a single page within its Law Enforcement Mobile Information System for on-site accident reporting. Officers at the scene write up the details and add a scaled drawing using custom Visio 2000 SmartShapes symbols (roads, sidewalks, signs, overturned cars, callouts, dimension lines, and so on). The scenes are accurate enough to be used in court and for insurance claims (Figure 3).
Figure 3: Just the Facts, Ma'am. The portable, pen-based accident-reporting system by Synergetics Systems has a specially designed Visio 2000 module with Smart-Shapes symbols for highway signs, streets, markings, and vehicles. By dragging symbols from custom stencils, police officers quickly capture exact details of an accident while still at the scene.
Control Engineer's Toolkit
A Microsoft Visio 2000 tool originally built for engineers at Johnson Controls has evolved into a vital part of their enterprise-wide processes. This solution started life as a set of Visio 2000 SmartShapes symbols for all their HVAC (heating, ventilation, and air conditioning) equipment, instruments, and cabling. Each Visio 2000 shape represents an entire class of shapes, such as temperature sensors. Underlying smart behavior lets users control the drawing parameters they need for each occurrence of the symbol. For instance, when a sensor symbol is dropped onto a page, Visio 2000 software prompts the engineer to specify its sub-class using pop-up menus and dialog boxes. Some properties affect the look of the shape, while others specify data values, such as part numbers and pricing, for a bill of materials that gets generated later. Because the symbols are hooked to scores of databases and other applications through VBA programming automation, Visio 2000 software is now an integral part of the company's processes, from pre-sales diagrams to inventory records (Figure 4).
Figure 4: SmartShapes Symbols with Class. The 800 engineers at Johnson Controls went from a time-consuming, 4,000-symbol Autodesk AutoCAD design process to a simplified, 200-symbol Visio 2000 diagramming process thanks to symbols that were made smart enough to change their appearance and behavior based on how they are being used.
Visual Programming
Programming HVAC control logic at Siebe Environmental Controls has been a lot less tedious since engineers began doing it pictorially in Microsoft Visio 2000 software. Rather than work from text-based code, they use custom Visio 2000 symbols to chart how a system should look. Each box represents a function of microcode and has parameters that represent system inputs and outputs. Through "visual programming," engineers connect these boxes and set the parameters to match the desired climate. Once the diagram is complete, Visio 2000 technology analyzes the drawing for syntax errors and generates the control logic code. The foundation is a set of detailed SmartShapes objects and connectors that are loaded with extra smarts. Automation also lets engineers download the results into their system controller and plug it into another Visio 2000 drawing, which serves as a data display (Figure 5).
Figure 5: An Engineer's Dream. Siebe Environmental Controls blends custom-built SmartShapes symbols with database connections and VBA Automation so that engineers can graphically program HVAC control logic. Using the data and connections behind each symbol, the structure of the drawing is analyzed, and machine code is generated and downloaded into the actual controllers.
Power Plant Simulation
Proto-Power, an engineering services company for the power industry, uses Visio 2000 software to help calculate and analyze heat transfer and other attributes at nuclear power plants. Using only standard Visio 2000 SmartShapes objects (pipes, valves, heat exchangers, and so on), the company built data input fields behind each symbol in the VBA programming language. A double-click on a shape brings up an input screen in which the engineer adds or modifies data for each scenario under analysis. Microsoft Visio 2000 software sends that data to a custom program called Proto-Flo, which calculates the plant's capability based on the input. The outcome—a stream of raw data—is then captured graphically in a Visio 2000 drawing that's based on the original schematic but set up for analysis. Whichever components are affected by the simulation change color and thickness in the drawing (Figure 6).
Figure 6: Existing Symbols Meet Smart Behavior and Automation. Proto-Power started with in-the-box Visio 2000 shapes and programmed them so that nuclear plant engineers can receive real-time visual feedback on their water service systems. They can also generate 2-D schematic drawings of a particular system direct from raw data collected under normal and abnormal operating conditions.
Assembled drawings for use as the final solution, or as part of a larger context
Now that you've seen some interesting and valuable examples of custom Visio 2000 solutions, let's talk about the tools you have at your disposal for creating them.
|
This Tool
|
Lets you create these solution components
|
|
ShapeSheet Interface
|
SmartShapes symbols, with properties and data behind them
|
|
VBA IDE Automation Interface
|
Code that analyzes drawings Code that manipulates shapes and drawings automatically Code that links Visio 2000 drawings to other applications Code that integrates the Visio 2000 application with(in) other applications and toolkits Tools, macros, add-ons, or wizards that help in the creation of shapes, stencils, and drawings Code that customizes the Visio 2000 user interface (toolbars and menu items)
|
|
Visio 2000 File Formats
|
Stencils Templates Drawings
|
|
Visio 2000 User Interface(drawing tools, drag-and drop interface, etc.)
|
Custom shapes drawn and programmed to your specification Assembled drawings for use as the final solution, or as part of a
|
|
Import/Export Filters
|
Existing symbols converted to Visio 2000 shapes
|
Microsoft Visio 2000 software comes with a number of tools and features for creating components of your own graphics-based custom solutions (see the table above). Most notable are the ShapeSheet interface and the Automation programming interface. The Visio 2000 file formats, user interface, and import/export capabilities also play important roles in custom solution development.
Drawing Your Own SmartShapes Symbols
Ninety percent of a good Microsoft Visio 2000 solution lies in having the right shapes. The best shapes closely represent the components of what the user is trying to model: a space plan, an organization chart, a schematic, a software design, steps in a process, and so on.
All Visio 2000 shapes are created directly in Visio 2000 and stored in master stencils (.VSS files) that you name and save. There's no limit to the number of shapes or stencils you can have, and stencils can be easily distributed as attachments in e-mail or as part of Visio 2000 templates or documents. Information you assign to SmartShapes symbols can make them respond within their model in very "smart" ways. (See "Making Symbols Smart—the ShapeSheet Environment" on page 6.)
Draw the symbols you need, or modify existing ones. In Microsoft Visio 2000 software there's almost no limit to the kind of symbols you can produce. Draw shapes from scratch using Visio drawing tools; tweak copies of existing shapes that are close to what you want; or incorporate the ones we've supplied as part of your own. You can even add directly to the stencils that we ship with Visio 2000 products.
Convert AutoCAD or other legacy symbols. If you've already invested in a collection of symbols from other programs, don't worry. You rarely have to redraw the wheel with Visio 2000 software. You can import and convert symbols in most vector and bitmap formats, including AutoCAD, ABC Flowcharter, BMP, CorelFlow by Corel, EPS/AI, CGM, IGES, JPEG, Macintosh PICT, PCX, TIFF, and WMF. When you convert CorelFlow and ABC FlowCharter drawings, certain symbols will be matched with their smarter Visio 2000 SmartShapes counterparts, and AutoCAD symbols retain their custom attributes upon conversion.
Use Automation to make symbols in batches. When you need to produce a slew of similar Visio 2000 symbols, Automation can help (see "VBA, Automation, and the Visio 2000 Object Model" on page 9). Just put Visual Basic, C/C++, VBA, and the like, to work and create your own development tools to help you perform repetitive tasks. This is ideal for jobs like adding the same custom text behavior, complex ShapeSheet formulas, or data attributes to a large group of similar shapes, or for automatically creating a set of furniture shapes by having Visio 2000 software read through a database of available sizes, colors, and model numbers.
Making Symbols Smartthe ShapeSheet Environment
What makes your custom SmartShapes symbols so great is that you can make them be more than just clip art graphics. They can be made smart enough to react to behind-the-scenes data or to user adjustments and input. You add this kind of intelligence using a built-in, spreadsheet-like interface called the ShapeSheet environment. There's no secret or hard-to-use program language or shape compiler. (In fact, it's the same tool we use to create all the shapes we ship with Microsoft Visio 2000 products.)
The cells of a ShapeSheet page let you enter formulas that give shapes conditional, or parametric, behavior. These control hundreds of characteristics: a shape's appearance, location, text labels and placement, connections to other shapes, and so on (Figure 7). Because you can plug in specific values and units of measure, your Microsoft Visio 2000 drawings can model whatever you need them to model.
Figure 7: Easy Smarts Through the ShapeSheet Interface. The spreadsheet-like ShapeSheet environment allows you to govern hundreds of parameters for a shape using formulas that are similar to those in familiar spreadsheet applications like Microsoft Excel.
The ShapeSheet environment lets you do things like:
-
Lock shapes against movement, formatting, text editing, geometry editing, deletion, and more.
-
Make an object's color, fill, shape, or other attributes automatically change based on input, such as shape size, location, or data values, that the user adds.
-
Make a shape contain or point to data that is related to what the shape represents (such as a computer monitor symbol that's linked to its serial number, date of purchase, assigned em-ployee, maintenance schedule, and amortization schedule).
-
Link objects to other pages, documents, and Web sites.
-
Access ShapeSheet cells through Automation routines, so you can manipulate minute details of a shape through a macro, a Visio 2000 add-on, or another program. This sophisticated technique lets you build your own tools or even automate the creation of a custom ShapeSheet section.
ShapeSheet content can also be used to describe and control entire Visio 2000 pages and documents, in addition to Visio 2000 shapes. The following pages give you an idea of the many types of custom intelligence that are available.
Text Control
Microsoft Visio 2000 shapes all have text by default. Using the ShapeSheet environment, you can enhance the way your text behaves. For instance, text can be programmed to:
-
Stay level when its shape is rotated.
-
Increase/decrease its font size to match changes in the shape's size.
-
Display various data, such as document information, date and time information, or data contained in the shape itself, such as dimensions, job titles, part numbers, or prices.
-
Respond to a control handle for easy repositioning.
-
Intelligently reposition itself relative to the shape as the amount of text grows, so as not to obscure the shape (or, alternatively, the shape could resize around the text) (Figure 8).
-
Automatically report on the results of real-time data from outside sources.
-
Enter text editing mode when the user double-clicks the shape.
Figure 8: Smart Text for a Monitor Shape. With just a few ShapeSheet formulas, this symbol's text knows to jump down below the shape when it becomes too large to fit within the monitor's screen.
Parametric Geometry
Figure 9: Geometry That Keeps to the Point. Here, a user-defined parameter stored in the "User.Point-Length" cell controls the sharpness (length) of the shape's point. A constant value of three-fourths of an inch keeps the point the same no matter how much the shape is stretched. Were this shape a piece of clip art, the point would stretch and shrink as the shape was adjusted.
Of course, you can draw and group most geometric shapes to construct Microsoft Visio 2000 objects: lines, arcs, curves, boxes, and so on. But by using the ShapeSheet environment, which resides behind every shape, you can build shapes parametrically, so that they can have features of exact sizes that can be changed at any time (Figure 9). You can also insert conditional statements to control how (and whether) these elements respond to underlying data, user input, and user operations (such as dragging handles around). For instance, you might want to:
-
Turn off or limit actions such as flipping, rotation, and resizing—say, to keep a grand piano symbol from being flopped, or to lock arc percentages into 5-degree increments.
-
Make objects dynamically change their line weight, shape, fill, color, and other attributes.
-
Produce "multi-shapes" that hide and show parts of themselves in context with their usage (for example, a bolt symbol that scales and adjusts to specific measurements and thread count).
Customizable Right-Mouse Shortcut Menus
All standard Microsoft Visio 2000 shapes have right-mouse menus with standard choices like Copy and Format. You can change this menu in the ShapeSheet interface to allow users to:
-
Change the look or meaning of a given shape.
-
Link or jump to other pages, documents, and Web pages from the shape.
-
Access a dialog box to select or enter shape-specific data that's stored either in the shape or in a linked database.
-
Access a dialog box to control the appearance of the shape.
-
Run Automation code such as add-ons, VBA macros, or utilities that analyze or manipulate the shape, its data, or the drawing.
Connection Points
Microsoft Visio 2000 technology has a class of shapes called connectors that typically represent arrows, flowchart lines, or wires in a diagram. Connection points allow users to "glue" connectors to any part of other shapes. Custom connection points can be programmed and individually named. This lets you do things like help guide users to attach connectors to the proper locations on shapes. You can also write Automation code that can check connections for technical accuracy—such as verifying that a cable has been connected to the "out" port on one piece of equipment and to the "in" port on another.
Data Links with Shapes
A special section of the ShapeSheet environment called Custom Properties lets you attach real-world data (such as vendor names, prices, part numbers, inventory codes, resources, or locations) to shapes for tracking, updating, or analyzing information. The data can control the look and behavior of the shape, or the shape can control the content of the data fields. For instance, a shape in a heat-monitoring diagram might be defined to turn yellow if its real-time data value exceeds a certain temperature rating. Similarly, the items in a materials database for a retail shelving diagram may be updated to reflect additions, deletions, and dimension alterations of the components in a diagram (Figure 10).
Figure 10: Data-driven Desk. This desk shape is linked to the database in two ways. The non-physical data such as Manufacturer, Model No., and Price are stored as Custom Properties. The actual dimensions of the desk are then linked to the geometry of the shape. The Manufacturer and Model No. values also serve as keys into the data table for getting the rest of the values.
Like other SmartShapes attributes, Custom Properties can be assigned data types, formats, names, and so on, so that users can do things like:
-
Select from ready-made lists of elements, such as window sizes of 24 in, 30 in, 36 in, 48 in, and so on, in a construction diagram.
-
Interactively choose from lists generated from live links to databases.
-
Receive prompts to enter a value when a symbol is dropped into a drawing.
-
Use a shape's right-mouse shortcut menu to make choices or call up a dialog box.
Control Handles
By default, shapes have little green handles that allow you to resize an object's width and height using the mouse. Control handles are extra handles you can add to control other features of the shape, such as text, line segments, and connection points. By also specifying ToolTips for your control handles, you can help users figure out each handle's purpose (Figure 11).
Figure 11: Dimension Lines Under Control. Lots of control handles allow this single shape to contain four baseline dimensions. The control handles position the locations of the leader lines, as well as control the height and spacing between them. Note the ToolTip under the cursor explaining the control handle's function.
Here are some of the ways control handles can be put to work:
-
Reposition a shape's text block more quickly.
-
"Pull out" the drawer on a file cabinet shape to see if there's enough clearance to open it.
-
Drag out the desired angle for a pie-chart wedge.
VBA, Automation, and the Visio 2000 Object Model
While you've seen that you can make shapes behave intelligently in many ways, such smarts have so far been confined to SmartShapes symbols. To move all this intelligence into the broader world—to unite shapes, drawings, and applications into one marvelous, seamless custom solution—takes one more step: automating Microsoft Visio 2000 actions (events) from either inside or outside of Visio 2000 (Figure 12).
Unlike some applications that allow access to their command interpreter only through a proprietary programming language, Visio 2000 software lets you manipulate its entire internal object model through any OLE-compliant Automation Controller, such as Visual Basic, VBA, C++, Delphi, Visual FoxPro, or PowerBuilder. Such solutions can run as built-in macros (add-on VBA code), as linked files (DLLs or VSLs), or as stand-alone add-on programs (.exe files). All add-on code can manipulate drawings and go outside the Visio 2000 environment to talk to other applications and data.
Automation lets you get under the hood of a Microsoft Visio 2000 drawing to do things like:
-
Make Visio 2000 software generate drawing inventories.
-
Trace and document object connections.
-
Tie Visio 2000 drawings to other applications such as Microsoft Word or Microsoft Excel.
-
Customize the Visio 2000 user interface for a particular document, or permanently for the application (for example, adding or removing toolbar buttons, menus, and menu items to increase the product's offerings or to simplify the user interface or limit the available functionality).
-
Create live, round-trip links between a Visio 2000 drawing and a Microsoft Access database or a Microsoft Excel spreadsheet to pictorially capture the structure of a database or to produce a database from a Visio 2000 drawing.
-
Generate drawings from a list of estimated or configured systems.
-
Embed Visio 2000 drawings into Microsoft Office documents or e-mail messages, or insert them as OLE objects that don't need Visio 2000 software to be viewed.
-
Embed files from other applications into a Visio 2000 drawing.
-
Insert hyperlinks to URLs, or to locations within other documents, into Visio 2000 diagrams.
The Convenience of Built-in VBA
We've built VBA into Microsoft Visio 2000 products so that you can use the same Automation interface to access the Visio 2000 innards as you do to program external add-ons. Its implementation is quite similar to that of Microsoft Excel, Word, and Access, both in its programming language and in the way you work with projects and modules to create a Visio 2000 VBA solution.
Figure 12: Fast VBA Coding. Thanks to the IntelliSense technology built into VBA, you don't have to memorize or repeatedly search documentation for scads of properties, methods, and events. Just start by typing the object you're working with, and a drop-down list of properties, methods, and events for that object will appear. In this example, the area of any shape dropped into the Visio 2000 drawing will be reported in a message box. With just a few more lines of code, the shape's name and associated data could be added to an inventory list, or a syntax check could be run to see that the shape was dropped in the correct location on the page.
VBA is convenient for other reasons, too. It comes in the box and is an "easy" language to use. (It's virtually identical to Visual Basic, which is generally easier to program in than C++.) Because VBA runs in-process with Microsoft Visio 2000 software, it is also very fast. VBA supports ActiveX controls within a Visio 2000 document and provides many built-in events for Visio 2000 drawings such as DocumentOpened and ShapeAdded.
The VBA in Visio 2000 products comes with a fully integrated development environment for creating and tracking projects, classes, and so on, in various windows, and it lets you step through code as you work. Microsoft IntelliSense technology provides on-the-fly assistance in accessing the properties, methods, and events in the Visio 2000 type library, as well as those of other applications and objects.
Moreover, VBA code stays with the Visio 2000 document, eliminating the need to create and distribute separate dynamic link libraries (DLLs), executable programs (.exes), setup programs, and so on, with custom drawings. Your source code can be password-protected, if desired.
Want to Program Your Symbols? We'll Show You How.
The ShapeSheet formulas that make symbols smart are quite easy to master: just look at the ShapeSheet pages of existing symbols to see how they are constructed. Save yourself time by copying and pasting attributes.
The Visio Developer Network (VDN) is the place to go for all your development resource needs. The VDN (www.msdn. microsoft.com/visio) provides rich content, demos, and sample code that will help you in creating your customized solutions. Registered members have access to additional resources, such as special articles, the online reference Developing Visio Solutions , and live Internet Webcasts on a variety of customization topics.
Developing Visio Solutions tells all about the ShapeSheet interface and automation programming. Developing Visio Solutions is available as a printed book, a PDF file included on each Visio 2000 product's CD, and an online reference at the Web site. You might also pop a question up to the Visio Developer Forum or read answers to other people's questions. This is a good place to get ideas and help from Visio 2000 technical services and other users.
Additional resources include:
For Developers Only: Choices for Packaging Your Automation Code
When writing Automation code for your custom solution you have a number of tools to choose from. These include VBA, Visual Basic, and C/C++, as well as other Automation controllers. You also have a choice in how to package your Automation code. You can create .exe files, DLLs, or in-document VBA code. Some considerations that might affect your choice: performance of execution, file distribution requirements, allotted development time and effort, life of the documents involved, and whether the code will be used by a specific drawing type or shared by many different documents. Regardless of the way the code is compiled, it can be called from Visio 2000 SmartShapes symbols, from the Visio 2000 add-on menu, or by adding your own custom menu item.
Although .exe files are typically written in Visual Basic or C++, they can be created in any language capable of producing an Automation controller. Consider .exe files a good choice for making quick Visual Basic add-ons that show up in the Microsoft Visio 2000 interface, and for producing multi-product "wrapper" solutions that run outside of Visio software yet integrate Visio 2000 drawings into other software tools or documents. Since .exe files run outside of the Visio 2000 process space, you can expect some performance and load-time penalties when they are called from the Visio 2000 user interface.
DLLs, or, in Visio 2000 parlance, VSLs, are usually written in C++. On the upside, they provide exceptional performance because they can be loaded and executed in the Visio 2000 process space. On the downside, they can be more difficult to develop and debug, and cannot be written in Visual Basic 4.0 or 5.0.
VBA code is written and stored right in a Microsoft Visio 2000 document and requires no compilation. VBA programs execute as fast as VSLs and can be quickly and easily developed. No separate components need to be distributed, because the code resides in the document. Moreover, others are able to look at, learn from, and modify the code, unless it is password-protected. Since the code is replicated with every drawing, and updating code in older documents can be hard to manage, storing VBA code in stencils is an option for avoiding these problems.
If you are writing a generic tool, utility, or wizard that would be useful for many document types, then VSLs and .exe files are likely choices. Simply place them in Visio 2000 software's "Solutions" directory, and they will be available to any document via the "Add-ons" menu. VBA code can be invoked only when the document containing the code is open, so this approach is not as useful for all-purpose add-ons.
In some cases, a hybrid architecture can be the best. Current development tools (C++ 4.2 and later, Visual Basic 4.0 and later) make it easy to create custom Automation servers (.exe files or DLLs) that can be loaded and called from Visio 2000 software's built-in VBA. These servers can "wrap" legacy code and data-access libraries. When called from VBA, such functionality can be available almost as easily as the Visio 2000 object model. In this way, you use a small amount of VBA code to load external code, and run it from within the Visio 2000 process space. Updates can easily be made by replacing the Automation server with a newer version, but without having to update existing VBA code that accesses it.
We Use It Too!
To further illustrate the power and versatility of Automation, it is worth noting that Microsoft Visio 2000 products are shipped with several wizards and add-ons. Written in Visual Basic and C++, these components use Visio 2000 software's Automation interface to extend Visio 2000 functionality. These programs not only help users create more useful drawings more quickly and aid developers in the creation of SmartShapes symbols, they also serve as great examples of what you can create for your own custom solutions.
Just a few of the add-ons that come with Visio 2000 products include:
-
Network Wizard— Analyzes the data that describes the structure of a network and automatically creates a representative network diagram.
-
Web Diagram Wizard— Generates a diagram of a World Wide Web or intranet site. You can control which links the diagram includes and its layout and format.
-
SmartShapes Wizard— Adds SmartShape behaviors such as text positioning, hidden notes, and built-in connectors, to user-created shapes, without requiring users to do any ShapeSheet programming.
-
Property Reporting Wizard— Generates inventory reports such as bills of materials or equipment and furniture inventories, and numeric reports such as cost totals or averages, from shapes that store data in their custom-property fields.
-
Stencil Document Wizard— Generates a catalog of the masters on a selected stencil.
-
Database Wizard— Links custom properties of a shape to records within a database table or query to provide a graphical view of the information so users can visualize the intent or content of the database.
-
Organization Chart Wizard— Creates organization charts from a database of names and reporting structure, or from a database of financial information.
-
Print ShapeSheet Wizard— Lets you document your SmartShapes symbols by printing user-selected sections of the ShapeSheet window.
Microsoft Visio 2000 Templates Save Steps
Visio 2000 templates (.vst files) play a role similar to Microsoft Word templates (.dot files). They help promote corporate standardization and save time by starting users with a preconfigured drawing environment. A well-built template will open with a drawing page that has the correct size, orientation, and scale, along with any backgrounds, borders, title blocks, company logos, styles, and layers that may be needed. The set of stencils necessary to complete the specific drawing type will also be opened. A template can even be set up to run a VBA macro or other add-on when it is opened. Such code might load the most recent data from a linked database, add custom menu items to the user interface, or prompt the user to specify additional settings for the drawing.
Have Some Fun
This document illustrates only a smattering of the thousands of types of custom solutions you can create in Microsoft Visio 2000 products. From simple to sophisticated, each Visio 2000 solution begins with a visualization challenge to be solved, a little know-how about Visio 2000 technology, and a willingness to extend your imagination to where Visio 2000 software can take you.
The rest is waiting for you in the Visio 2000 box. Start with built-in shapes, or draw and import your own symbols. Then maybe add some smarts with Visio 2000 wizards and add-ons. Get more mileage from your SmartShapes objects by using the ShapeSheet interface to give your symbols a level of intelligence that's far above what clip art can offer. Finally, add Automation code to manipulate drawings or to link shapes or drawings to other applications and data.
So go ahead—draw outside the box. Microsoft Visio 2000 software's proven power and versatility will see you through each phase of your solution's growth.
Solution Evolution: Building Incremental Solutions
Any Microsoft Visio 2000 solution can be built incrementally to meet different levels of complexity at different times of its life. It's mostly a matter of where you want to draw the line, so to speak, on the extent of your custom solution. A typical evolution might go something like these two scenarios.
How an Office Furnishing and Purchase Plan Solution Might Evolve
Space planning is a perpetual challenge in today's fast-growing businesses. Keeping track of people, equipment, furnishings, and communications hookups is a full-time job that Microsoft Visio 2000 technology can help streamline in a small or big way. Hypothetical Company A, for instance, wants employees to help with their own office layout and furnishing. Here's how their Visio 2000 solution expands with their growing business.
For starters, employees receive a set of shapes representing available office equipment, accurately drawn-to-scale, in a Microsoft Visio 2000 stencil. Working from a new, blank drawing, they arrange wall segments, furniture, lamps, computers, and so on, to their liking. A slightly more sophisticated solution includes the same stencil as part of a Visio 2000 template that has the office walls already drawn. Employees merely furnish their allotted space, without manipulating the walls at all. This drawing is used for simple office rearrangement planning by the employees and is made available to workers making office moves. Adding some Automation, database links, and smarts to the shapes would make the drawing valuable to even more people. In this case, employees select their own office space by name from a template that's linked to the corporate space plan. They also view dimensions, descriptions, and color choices for each item. With the help of the Visio 2000 Database Wizard, they pull up pricing information from a live link to a Microsoft Excel spreadsheet (based on model numbers extracted from the symbols) to help them decide whether their department's budget has room for that snazzy chair plus that extra filing cabinet.
Once their choices are final and approved (done by passing the Visio 2000 document to a signatory), they click an ActiveX "Order Now" button built into the Visio 2000 template. This button calls a built-in VBA macro to produce and send out a purchase order and inventory report from Microsoft Word, complete with small Visio 2000 pictures of all ordered components. This report can be organized by employee, floor, or department, and later becomes a checklist for distribution of delivered goods. It also serves as a record that's tied to corporate inventory, to more easily track where equipment ends up as it's relocated from office to office.
Retail Space Configuration and Ordering
Configuration systems for PCs, networks, retail shelving, storage spaces, and the like commonly benefit from custom Microsoft Visio 2000 solutions, too. At Company B, for instance, a Visio 2000 solution is needed for field sales representatives who sell retail display shelving and racks. Here's how their small start blossoms into an enterprise-wide solution.
They begin with a set of custom SmartShapes symbols representing each component in the system. Appropriate intelligence makes sure that modular units are never mismatched and that items that come only in certain sizes can't be resized. Using a portable computer, the sales reps drag and drop components to "build" the space setup right on site with the client. (Alternatively, Automation lets the salesperson or client check off items from a Microsoft Excel or Microsoft Access list and then have that program create the configuration within the Visio 2000 program.)
Further database linkages and Automation generate purchase orders from the configuration and return reports to the customer on the spot. Once approved, the order is sent to Manufacturing for fulfillment and to Accounts Receivable for billing.
With inventory information attached to each symbol, Manufacturing can use the same Visio 2000 diagram to generate a list of all sub-components required for the system. For instance, if a customer wants a four-foot, free-standing rack, background data indicates how many fasteners, bolts, shelves, and footpads the unit takes. This list is in turn sent to an inventory management database to become both a checklist of parts to complete the delivery and a method of inventory countdown.
Additional Information
To see Visio 2000 in action, visit http://office.microsoft.com/home/office.aspx?assetid=FX01085798