help with process modelling, shape data

Started by stuman, May 07, 2009, 01:00:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stuman

Hi, I would like to know if it is possible to do the following. Say I have a silo shape, I can add a the following custom data {properties} to it, Silo Total Volume, Inlet flow rate, Outlet flow rate. Am I able to connect other shapes to the Inlet flow rate property of the silo shape, and based on the difference between inlet and outlet flow rates, determine how much volume is left in the silo? I know it would have to be a time based dynamic analysis, calculating the volume every 1 minute or so, but can it be done, in visio, graphically I mean? I know this is very simple in excel as I have done it many times before, but can this be done in visio and of so how?

Thanks
Stu

rodsoares101

If you already know how to do the "math" in excel automatically, why don't you link the drawing to the spreadsheet and program it to auto update every minute. Check out the Tools > Add-on > Visio Extras > Database Assistant... than choose to link to a spreadsheet... it's very simple... try it out.

stuman

The issue is that I would like to keep much of the smarts away from the users. By using a graphic environment with the smarts ( not that silo % full is a proprietry algorithm ) inbuilt into the shape and not exposed in excel as a formula, I could begin to build a shape library that we could use for basic manufacturing process simulation. Can anyone give me an example of how to do this?

Thanks
Stu

wapperdude

Visio has a "timing" function, now(), that updates every 60 seconds, from the instant that it was activated.  You might be able to adapt that to do your calculations.  If you want something with smaller increments, VBA has a "timing" function, Timer.  But, while it runs, it interrupts the rest of the Visio activities -- at least that's how its behavior seems to me.  Those are the only two functions that I'm aware of.

However, I don't think using Visio is more "secure" than, say, Excel.  Excel, at least, tries to give you password protection.  Visio does not. 

An example of the VBA timer function, it is used to animate a lava lamp:  http://visguy.com/vgforum/index.php?topic=521.0

HTH
Wapperdude
Visio 2019 Pro

Yacine

Great hint from Wapperdude  ;D,
process animation as a pre-step to simulation is an interesting field.
I used Wapperdudes animated lava lamp to animate the level in silos. Have a look at the attachment.

Stuman,
the example is realised with hard coded formulas. To avoid your users to edit them, you'll probably work better with connectors, which will put the values of the pumps automatically in the silo's shapesheet. The connectors would be connected to prepared inlet and outlet connections. The level formula can then stay constant as the sum of all negative inlets and positive outlets.

Have a look at visio guy's article about connectors
http://www.visguy.com/2009/04/22/analyze-connectivity-between-process-flows/
and Junichi Yoda's calculation shapes:
http://www.geocities.jp/visualcalculation/english/calexapl1.htm

The disadvantage of my example, is that the state depends on the time elapsed from start, instead of the previous status. I got struggling how to write the dx in the formula (value=value+dx) without hard coding the dependicies in VBA.
Yacine

stuman

Yacine,
          thanks for that, you pointed me to some great stuff I was not aware of. It will take some time to digest it all, but thanks. My next task is to try and get some bidrectional data translation between excel - visio - excel happening. I will start a new post for that one.

Thanks
Stu

vojo

my animation template I posted about 6-9 months ago might help

If nothing else...might help you in dealing with arcs and such in animation

vojo

as far as incrementals goes...you might want to consider the following:

For each shape you want to move based on previous state, build an array of the shapes
(I did this using a user cell that said whether a shape was animiation or not....allows to intermix static shapes with animation shapes on a given sheet).  After you tick the timer, call a routine that walks that array and puts "results" in some other user cell.  During each animation step, take previous result, operate with it, make the move for each shape.

You will run into 2 problems you need to think about.  First, for a given previous state, what exactly should be done for next state (if its a simple formula...np...but if its a more non linear behavior then you will need to set the behavior somehow ....things like show / hide....jump to a location...etc).  Second, if you want to make this handle many shapes with large number of iterations, the VBA will be complex (much much much more than you got so far).  Either you set up cells per shape that track the desired behavior (what I did) or you have to build a VBA array per shape and for non linear behaviors, you will need to sync with timer (for example, dont do anything until 3rd tick....0,0,do something, 0, 0 ,0  kind of thing)

Also, you will probably want to think about a full screen view during actual animation for a better user experience.   After all, you are doing this to help the creator convey something to an audience.

FYI...the way I handled this was to have a shape that I moved manually to key points and right clicked to set parameters.   This allowed different shapes to move at different speeds or increments during animation.
This approach allowed you bind static shapes to the motion shape (add to group)...so the static shapes followed the animation shape.   The dashboard in my template controlled all this stuff (reset, single step forward, single step back, run, help).

The upside is that the template supports arcs and straight line movement as well as hide/show and some
other behaviors as well as giving you a dashboard and fullscreen operation.   The downside of the template is that each animation shape has about 20 steps that can be set.

Fill free to use the template I posted any way you want.   Again, the tough nut to crack is how to enumerate the animation steps you want for a given shape.

Good luck.

BTW, this kind of thing, to me at least, makes a case for visio and PPT to be much more interrelated
(PPT does animation nice but not able to add rich shapes and details natively....visio is real powerful for shapes but doesnt lend itself well to actually presenting stuff natively to an audience - visio is more static in nature where you put a static visio picture into PPT).