Visio stencil for data import. Addendum

Below some receptions which can be used during the work with a stencil for import of data are described.

Contents

How to make a shape with controlled fill color

Shape-importer can to transfer the integer into the target shape as a parameter.

The task contain of two parts:

  • transfer the data to the target shape;
  • display the transmitted data.

The first task is solved by a shape-importer. The shape transfers the data from the column 5 into nodes (2D shapes), and from column 6 - into connectors (1D shapes).

In both cases the "User.importP" cell is used as data receiver. If such cell is missing, the data is lost without any error message.

Columns 5 and 6 are handled only by "Draw Tree with Parameters" and "Draw Network with Parameters" functions.

The second task is solved by using a custom master shape. Such shapes are not included in the delaverable package. The user has to make own one, as required for his application.

Here is an example of manufacturing such shapes. Let the parameter specifies the number of colors in the palette (see. "Service / Color palette" menu).

The picture shows the following operations in sequence:

  • draw a shape
  • open ShapeSheet
  • add "User-defined cells" section
  • create "User.importP" cells
  • in "FillForegnd" cells insert link to "User.importP" cell
  • check color controlling
  • open Document Stencil
  • move new shape to Document Stencil
  • rename the resulting master shape
  • see the numders in palette.

If such a master shape to use when importing data, then shape-importer will transmit data to the "User.importP" cell, and the target shape will change the fill color, depending on the value of passed parameter. Value has to be in range from 0 to 23.

How to allow the use of macros

For Visio 2007

For Visio 2010

How to change the layout of shapes

The Visio has an universal built-in tool for lay out the shapes and few specialized tools for the indnvndual solutions.

Specialized tools are available only in documents based on correspoding template such "Mind Map" or "Organization chart". Universal tools are available in every documents.

Shape-importer uses only two combinations of settings of the universal tool. Directly during import it is posible to use "Compressed tree" or "horizontal block diagram". But at any time after importing you can change the layout of shapes using the universal instrument: "Figure / Layout Adjustment", "Figure / Change the position of the pieces," "Figure / Center the document."

If the shape importing used in "Mind Map" chart, you can use the menu .... In the "Organization chart" documents menu is available ....

The "Select subtree" function

The stencil also contains a "Select subtree" function, which is useful for manual adjustment of the shapes location. Best results are achieved when the master shapes contains the formula for calling this function. Here's how to make such a master shape.

The picture shows the following operations in sequence:

  • draw a shape
  • open ShapeSheet
  • add the "Actions" section
  • input '=CALLTHIS("mDrawTree.SelectSubTree","import")' into "Action" cell
  • Input "Select Subtree" into "Menu" cell
  • draw a tree and check the function's call
  • copy the shape in the Document Stencil

Mailto: Gennady Tumanov   gCroc@yandex.ru