Author Topic: Dynamic Text in visio  (Read 10260 times)

0 Members and 1 Guest are viewing this topic.

MasonNation

  • Newbie
  • *
  • Posts: 2
Dynamic Text in visio
« on: August 21, 2008, 12:46:16 PM »

First Question

Is it possible for the custom property value of a shape to be automatically displayed in the shapes text box? For example one shape has a cost property value of 50. I want that "50" to be displayed as text in the shapes text box. So when I update the property value the text changes.

Second Question

Is it possible to multiply the property value of one shape by the property value of another shape and have that result be evaluated and stored in as the property value of a third shape?  What I am trying to do it create a material balance flow map.

Any help is greatly appreciated.

Thanks

Mason

vojo

  • Hero Member
  • *****
  • Posts: 1528
Re: Dynamic Text in visio
« Reply #1 on: August 21, 2008, 01:14:43 PM »
1:   select box==>insert==>field==>custom property
2:   if all 3 shapes in a group, yes but you need to define the relationship at design time
      ie....1+2*3==>4 is the designed in algorithm....1*2+3==>4 is an entirely different shape
      (if you want to get real slick...you might try 2007 and do the user defined functions...aka some
      custom properties to define how all the shape values are brought together).

      if not in a group, this this gets a whole lot more complicated if not impossible.
      There is no real nice way for 2 unrelated shapes to become aware of each other without writing VBA or
      C code.   You could do some special stuff just for your solution...but would be tediuos and only
      for that solution.   for example, some template with a bunch of shapes and VBA just to make the
      unrelated shapes work together.

      Another way is tie drawing to excell and work thru excell against the unrelated shapes then pipe
      result back into drawing.

      good luck

Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Dynamic Text in visio
« Reply #2 on: August 21, 2008, 02:17:04 PM »
Hi Mason,

You can reference values in other shapes via the ShapeSheet. You have to do this by hand or using code, there's no easy user interface to set this up. In the ShapeSheet, the formula might look something like this:

Prop.InflowTotal = Sheet.1!Prop.Outflow + Sheet.15!Prop.Outflow

where Sheet.1 and Sheet.15 are the IDs of two other shapes that are supplying the target shape with material.

Junichi Youda has a free download that is similar to what you want to do. Take a look at his Shapes for Visual Calculation: http://www.geocities.com/visualcalculation/

Let us know how you get along. I think Visio could do a really nice job at solving these types of problems, it just needs a few utilities to help users get going.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

MasonNation

  • Newbie
  • *
  • Posts: 2
Re: Dynamic Text in visio
« Reply #3 on: August 21, 2008, 02:45:25 PM »
Thanks for the adivce, I feel like I am almost there. Where can I find the Shape IDs for the shapes I want to reference? I assume its displayed in the shape sheet window somewhere.

Thanks so much for the help

Mason


Visio Guy

  • Administrator
  • Hero Member
  • *****
  • Posts: 1718
  • Smart Graphics for Visual People...n' Stuff
    • Visio Guy
Re: Dynamic Text in visio
« Reply #4 on: August 21, 2008, 03:28:11 PM »
Hi Mason,

You can find the Shape ID under the Format > Special dialog. If you're using Visio 2007, it gets slightly more tricky.

See the following article for details, and look for Reason #8:

Top 9 Reasons for Turning-on Developer Mode
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Paul Herber

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2955
    • Paul Herber's website
Re: Dynamic Text in visio
« Reply #5 on: August 21, 2008, 05:04:53 PM »
All the IDs are also visible in the Drawing Explorer
menu View -> Drawing Explorer Window

Electronic and Electrical engineering, business and software stencils and applications for Visio -

https://www.paulherber.co.uk/