![]() |
Visio 2003 Developer's Survival Pack Tools and Samples |
Tool: DAVSL_Anim Animation Addon | |
![]() ![]() |
DAVSL_Anim provides a VSL Addon that eases development of simple Visio animation projects.
Filename | Description | Installation |
DAVSL_Anim.dll | VSL Addon |
See samples in "Chapter 31 Animation" to exercise this VSL. |
The addon provides eight timers for use in animation, though usually only one or two are needed.
The basic action of the addon is to increment an integer in a cell named User.Timer. You arrange other formulas in your document to refer to User.Timer in order to create movement or other changes.
Each timer associates with the User.Timer cell of a particular shape, which can be a shape on a drawing page, or a PageSheet or DocumentSheet. Your solution informs the addon which shape to associate with by using the RUNADDONWARGS function from that same sheet.
Behind the scenes, RUNADDON and RUNADDONWARGS pass Shape/Page/Document info to the addon. The Addon displays the selected sheet in using the Shape, Page and Doc cells. In the screenshot above, a timer has been associated with the PageSheet of Page-1, in document AnimAccidentScene (and the Shape column is blank).
You can hide or show the UI window using a RUNADDONWARGS call, or you can hide it with the hide button. Animation continues regardless of whether the window is visible.
Your solution controls the addon from the ShapeSheet using commands of the form:
RUNADDONWARGS("DAVSLAnim","Cmd=Enable some more args")
In the following table, only the second RUNADDONWARGS argument is shown.
RUNADDONWARGS second argument | Description |
"Cmd=Enable Intervalms=50 Mode=Counter UISHow=1" | Use the Enable command to initialize a timer the first
time, or to restart a timer after Disable. If not already done, Enable initializes a timer devoted to the shape in which the RUNADDONWARGS command resides (which may by a Shape, or a PageSheet or DocumentSheet). Then starts the timer running. Intervalms: Millisecs per increment of timer Mode: Currently Counter is the only choice |
"UIShow=1" | UIShow can be used alone or with other Cmds to show or hide the UI window. 1=show, 0=hide |
"Cmd=Disable" | Disables the timer, but keeps it dedicated to this shape. |
"Cmd=Delete" | Stops the timer and makes it forget about this shape. |
The samples for "Chapter 31 Animation" show a technique for calling RUNADDONWARGS from a Page Sheet, and using other formulas in other cells to fire those calls.
Beyond installation of DAVSL_Anim itself, you will probably want to set Visio's DrawOffScreen registry setting for much smoother animation movement. A sample reg file to do this would look like:
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Visio\Application] "DrawOffscreen"="1" |
Article Created: 2003-09-01 Last edit: Last edit:
03-10-29 Graham
Wideman
Go to:
DiagramAntics.com