Loading shapes based on user input

Started by DanW, September 18, 2008, 06:41:02 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DanW

Hi everyone,

I'm currently doing a lot of schematic drawings that are similar with slight differences. 

I'm wondering if it's possible to set up a shape that, when dropped on the page would come up with a list of options, and based on the user input, would load one of many premade shapes. 

For instance If I could create a shape called central plant that would come up with a list that said "number of boilers", "number of pumps", etc and based on what was entered would load a premade shape with those parameters.  I tried linking my shapes to a database and changing the record but, it only altered the current shapes dimensions and didn't create a new shape as I hoped.

Anyone have any ideas for making this work, or if its even possible?

wapperdude

Well, just to get the ball rolling, yes, that ought to be possible.  The easy part is setting up the dropping the shape and asking for user input.  That can be handled by right click shape > data > shape data.  Using that info get the desired config is more work.  There are two approaches.  The elegant approach would be to invoke some VBA code, use the values, and place the desired number of boilers or whatever.  The clutsy way would be to predefine your shape with maximum number of boilers, etc.  Each boiler could either be a separate Geometry section of the main shape, or could be group of shapes.  The user entry would be used to hide and unhide each piece as necessary.   :P  This could all be done in the shape sheet.  The selection box probably gets all weird though.   :o

To get started with the VBA approach, you might check out this link regarding automation:  http://msdn.microsoft.com/en-us/library/aa201767(office.10).aspx

Well, I hope this gets you started until programmer guys have a crack at this.

Wapperdude
Visio 2019 Pro

DanW

Thanks for the response.  I appreciate it. 

Initially I started out trying to create this using the clutsy solution, but like you say,  it would end up too messy and not very practical for transferring it over to other shapes I might want to customize similarily.   I'll look some more into VBA solutions for Visio and see what can be done with that approach.  Thanks for the link it's very helpful. 

I never realized until undertaking this how powerful and in depth visio can be.  I've discovered many great features that would prove very useful in my work.  After I get a handle on using VBA code in my shapes I see many possibilities opening up for making my work more efficient.

As always, Im grateful for the help and direction.

-Dan

wapperdude

Yes, the depth of Visio!   :o

That's why these forums are so nice.  Many topics, many contributors.

As you did into Visio more, here are a couple of more useful links:

Shapesheets:  http://msdn.microsoft.com/en-us/library/ms427031.aspx

Developing Solutions:  http://msdn.microsoft.com/en-us/library/aa245244(office.10).aspx

Visio Public Forum:  http://www.microsoft.com/office/community/en-us/default.mspx

That ought to give you a good start.

Wapperdude

Visio 2019 Pro

vojo

before you go too far...play with the following:
1. define a few custom properties
     - num of boilers
     - location of plant
     - etc
2. in the shapesheet....in event on drop add docmd(1312)

voila....I use this often to tailor shapes on drop