Home > SI5 Documentation > User Guide > Visio Interface > Tips Tricks > Custom Visio Shapes

Custom Visio Shapes

Creating Your Own SI5 Visio Shapes

This post will show how to create a basic custom SI5 shape that is linked to your SI5 database and displays the chosen property fields for the product associated with the shape. Instructions are written for Visio 2010 but notes will indicate if something is different for Visio 2007 users.

You will want to be show your Developer menu option for this exercise. To do this, select File->Options, then click on Customize Ribbon. Check the box for “Developer”:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/developer_menu.jpg

Note: In Visio 2007, select Tools->Options then click the Advanced tab and check the "Run in developer mode" box.
 
  1. Create a stencil to store your shape in. In the Shapes window, click More Shapes then select New Stencil, either US unit or Metric.

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/create_new_stencil.jpg

Note: In Visio 2007 select File->Shapes->New Stencil.

  1. The new stencil will appear in the Shapes window and will already be open for edit, indicated by the red asterisk:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/new_stencil.jpg

  1. Right-click in the stencil and select New Master... and then name the shape in the window that opens:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/new_master_shape.jpg

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/name_shape.jpg

 

  1. Right-click on the shape and select Edit Master->Edit Master Shape:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/edit_master_shape.jpg

  1. When the shape opens for edit, it will look like a blank document. Use the drawing tools in Visio to create your shape and add a Text box. In this example, I created a purple box w/ a green circle and added the word “Text” to the textbox so it is visible.

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/drawing_tools_and_text_box.jpg

  1. Hit Ctrl + A to select all and then right-click and choose Group->Group:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/group_your_shape.jpg

 

  1. Right-click the grouped shape and select Show Shapesheet:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/show_shapesheet.jpg

  1. Maximize the ShapeSheet window and then right-click in any section and select “Insert Section…”:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/insert_section.jpg

 

  1. On the Insert Section form that opens, check “User-defined cells” and “Shape Data” then click OK.

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/insert_section_form.jpg

 

  1. In the Shape Data section, click in the left cell (the one with red text) and type “Category” (without the quotes). When you tab out of the cell it will display Prop.Category in red text. Type “Category” (with the quotes this time) in the Value cell:

 

adding shape data to grouped shape.jpg

 Note: The table below lists the available fields that you can add to SI5 shapes:

 

 

Property Name

ComponentID

Manufacturer

Model

Type

Category

Height

Width

Depth

CustomProperty1

CustomProperty2

CustomProperty3

CustomProperty4

CustomProperty5

CustomProperty6

CustomProperty7

CustomProperty8

CustomProperty9

CustomProperty10

SKU

Keyword1

Keyword2

Keyword3

UnitCost

UnitPrice

UnitLaborHrs

ProductDescription

InstallPrice

Voltage

Amps

BTU

Hyperlink

IPAddress

SerialNumber

ClientDescription

Location

Zone

MSRP

Phase

Weight

 

  1. To add another field, right-click where Prop.Category is displayed and select “Insert Row”

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/insert_row.jpg

 

  1. Repeat step 10 and 11 for whatever other values of the product you wish to display. In this example I added Model and ComponentID:

 

additional fields in shape data.jpg

 

  1. In the User-defined Cells section, click in the left cell (the one with red text) and type “Text” (without the quotes). When you tab out of the cell it will display User.Text in red text. In the Value cell, type the following: Prop.Category&CHAR(10)&Prop.Model&CHAR(10)&Prop.ComponentID

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/user_defined_cells_multiple.jpg

 

Note:  In this example I wanted to show three different properties: Category, Model, ComponentID. If you only want to show one field, say ComponentID, in the Value cell you would enter the following: Prop.ComponentID
 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/user_defined_cells_single.jpg

  1. Close the ShapeSheet window and you will be taken back to the window with your grouped shape.
  2. Click once on the text box so that just it is selected then right-click and select Show ShapeSheet:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/text_box_show_shapesheet.jpg

  1. Repeat steps 8-9 to insert a new section, except on step 9 you only need to check User-defined cells.
  2. In the User-defined Cells section, click in the left cell (the one with red text) and type “Text” (without the quotes). When you tab out of the cell it will display User.Text in red text. In the Value cell, type the following: Sheet.8!User.Text
 
Note: the number following “Sheet.” will vary. Just make sure that the number matches the number in the Shape Transform section:
 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/user_defined_cells_for_text_box.jpg

  1. Close the ShapeSheet. 
  2. While the text box is still selected, click on the Insert menu and then click “Field”:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/insert_field.jpg

 

  1. On the Field form, select “User-defined Cells” and then click OK:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/field_form.jpg

 

  1. The fields you set in step 13 now appear in the text box:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/properties_displaying_on_shape_overlap.jpg

 

Note: if your text overlaps your shape as shown above, do not ungroup the shape to correct! This will wipe out all the work you did in steps 8-18. Instead, while the text box is still selected (vs. the entire grouped shape), simply move the box where you want it.
 
  1. Close the Master Shape window and when prompted to update the shape, choose Yes:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/update_shape.jpg

 

  1. Back in the Shapes window of the main Visio interface, save your stencil. In order for this new stencil to appear in your SI5 Stencil Tree, you must save it to the following location:
 
Win7/Vista: C:\ProgramData\D-Tools\SI5\Visualizations\Stencils
XP: C:\Documents and Settings\All Users\Application Data\D-Tools\SI5\Visualizations\Stencils
 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/saving_the_stencil.jpg

 

  1. Drag your shape over to an SI5 Visio drawing page. You will be prompted to select a product from your SI5 database. Once you select a product, the properties will display on the shape:

 

File:Si5Wiki/SI5/08Visio_Interface/zTips_Tricks/Custom_Visio_Shapes/finished_shape.jpg

Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.