Visio Guy

Visio Discussions => General Visio => Topic started by: JustMyUsername on September 30, 2010, 08:00:16 AM

Title: Create Automatic columns/cells from User-entered Data
Post by: JustMyUsername on September 30, 2010, 08:00:16 AM
Hi Peeps

What I want to do is this:

The user drags a custom shape onto the canvas. The shape is just a collection of rectangles all arranged vertically and grouped.
When the user double clicks the shape a pop-up box (or area at the bottom of the screen) appears that allows the user to enter data.
The user enters two sets of data, and depending on what they enter determines the amount of rectangles produced for the shape.

So for example, if they entered 4 bits of data for Set 1, and 5 bits of data for Set 2 there would be 9 rectangles vertically arranged, each showing the text of the data entered by the user, and each set would have its own colour.

Is this possible in Visio 2010?
If so what ‘search terms’ should I be looking at?

Will it all be in VB, so should I be just be messing with macros etc?
Or is there a smarter way to do it?

I’m proficient with coding, have done Pascal, C, JAVA, C#, Access, Excel, PLC’s, Control Systems etc, so I’m not a numpty – I don’t need someone to spoon feed me the answer and how to do it as there would be no fun in that and I wouldn’t learn anything.

I’m just not sure what search terms I should be looking for, so far my trawls of the web have pulled up nothing directly related to what I want to do, so I know I’m not looking for the right things.

So if you have any ideas please let me know!

TIA

;)
Title: Re: Create Automatic columns/cells from User-entered Data
Post by: vojo on September 30, 2010, 01:39:34 PM
quite feasible:

If you are willing to start with the max blocks in the group, you can do this all in shapesheet (no VBA)
   - Form a group of max blocks
   - Create 2 custom properties
   - Use user cells in shapesheet to set true false....something like user.block3enable = if(props.1stcustom >2, true, fales)
   - in each block, geometry section....show cells.   Show = sheet.1!user.block3enable

In essence, the custom props will determine which blocks are shown.

Note this approach implies you are not moving or spacing the blocks.

If you want to do richer things, then need VBA
    - Could use custom props to define inputs
    - Task VBA either from action button (shapesheet actions definition)....user right clicks and selects
    - Need to pass the custom props to VBA
    - VBA parses and builds what you want (a really trivial view of the heavy lifting) ;D
    - exit out

This will allow you to be much more creative on this....but does require some up front learning (how to pass parms between shapesheet and VBA)
Also, I think you need to make the whole thing a template if you want other to use.   For me, its be problematic to ship VBA in a stencil.

Title: Re: Create Automatic columns/cells from User-entered Data
Post by: JustMyUsername on September 30, 2010, 01:48:51 PM
Ohooooooo!

Excellent, thanks for your response, much appreciated.

I will get down to playing about with that soon.

Thanks again

:)
Title: Re: Create Automatic columns/cells from User-entered Data
Post by: Visio Guy on September 30, 2010, 02:49:18 PM
Hi JMU,

You might check out these articles. The downloads do something (that I think is) similar to what you want:

Automatic Chevron Process Shape (http://www.visguy.com/2009/08/04/automatic-chevron-process-shape/)
Design Web Pages With This Visio Breadcrumbs Shape (http://www.visguy.com/2009/02/03/design-web-pages-with-this-visio-breadcrumbs-shape/)

The shapes work such that if you enter a semi-colon separated in the (hidden) text block of the shape, they get divided up and inserted into shapes that appear magically.

So for example, you type "one;two;three" into a shape and see three blocks appear:

[one][two][three]
Title: Re: Create Automatic columns/cells from User-entered Data
Post by: JustMyUsername on September 30, 2010, 05:20:00 PM
Excellent, thanks for that I shall have a play!

Ta

8)