Default formulas

H

Harry

Is it possible to define a default formula for a field's properties within a
Custom Property Set? I've tried entering a valid formula in the "Value"
field but Visio converts the formula to text by adding quotes in the Value
field of the ShapeSheet.

Can formulas be added as defaults?

Thanks in advance,
Harry
 
C

Chris Roth [MVP]

Hi Harry,

I played around with it a little bit, and tried all sorts of sneaky tricks,
but it looks like you can only get *some* evaluation of formulas to occur,
but you don't seem to be able to reference any ShapeSheet cells.

For instance, with a data-type of "number", I was able to enter the default
formula: Min(3, 1) and the property-set dialog accepted this.

But if I changed it to Min(3, Width), it didn't like it. I think that,
technically/theoretically speaking, there's no guarentee that a shape will
have a Width cell (even though the all do....)

If you created a master shape with a set of custom properties, then the
values in the master would serve as defaults, but then you couldn't apply
these to other shapes...

--
Hope this helps,

Chris Roth
Visio MVP

Free Visio shapes:
http://www.visguy.com/category/shapes
Visio programming info:
http://www.visguy.com/category/programming/
Other Visio resources:
http://www.visguy.com/visio-links/
 
V

vojo

why not use one cell as a global trigger (default or other) then have each
cell reference the global trigger cell to determine which action to take

For example, event on drop could change custome cell from 0 to 1.
Width could be If(trigger=0, default width, new super duper width).

BTW, to avoid all the i used this general type approach bring up a subset of
custom properties (0=non, 1=server, 2=network, 3=storage). then in the
storage custom cell hide cell (if (trigger =3, show, no show). Gets around
the custom property limit.
 
H

Harry

Hi Chris,
Thanks for the response; looks like I might be out of luck... Specifically, what I'm trying to do is concatenate the values in two existing fields so they're displayed as a single value on a report. All three fields exist in a custom property set (and have been assigned to all of my shape masters); two of which are populated by Visio's "Number Shapes" Add-in, the third I added with Prop.ShapeNumberText&Prop.ShapeNumber as its default value (hoping to get the two values to display as one on a report). Instead of concatenating the values I'm getting =Prop.ShapeNumberText&Prop.ShapeNumber displayed on my report (my original formula with the Visio-added equal sign).
I'll play with this a bit more and if I have any success I'll post my findings to the group.



Thanks again for trying,

Harry
 
H

Harry

Hi Vojo,
Thanks for the response; this might be a bit over my head in terms of Visio
experience but I think I get the general idea. I'm going to play with your
idea a bit and see if it solves my dilemma.

Thanks again,
Harry
 
J

John Marshall, MVP

Use a User property and define the concatenation in the value cell. Then you can reference the User property from the report.

User properties are similar to Custom Properties/Shape Data, but they do not have a UI to manipulate the values. They are useful for simplifying for cell formulas by providing a name to a function or element used throughout a shapesheet. Which would you prefer; reading User.Spacing or Geometry12.X2? Of course, my favourite is for isolating shapesheet cells from external references. If an external reference is broken Visio replaces the formula in the cell with Ref(). It is far easier to keep the formulas intact if the Ref() appears in the User section. The name of the cell should give a clue as to how to fix the reference error.

John... Visio MVP

Need stencils or ideas? http://visio.mvps.org/3rdparty.htm
Need VBA examples? http://visio.mvps.org/VBA.htm
Visio Wishlist http://visio.mvps.org/wish_list.htm
Hi Chris,
Thanks for the response; looks like I might be out of luck... Specifically, what I'm trying to do is concatenate the values in two existing fields so they're displayed as a single value on a report. All three fields exist in a custom property set (and have been assigned to all of my shape masters); two of which are populated by Visio's "Number Shapes" Add-in, the third I added with Prop.ShapeNumberText&Prop.ShapeNumber as its default value (hoping to get the two values to display as one on a report). Instead of concatenating the values I'm getting =Prop.ShapeNumberText&Prop.ShapeNumber displayed on my report (my original formula with the Visio-added equal sign).
I'll play with this a bit more and if I have any success I'll post my findings to the group.



Thanks again for trying,

Harry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top