Author Topic: How do I set up a Shape Data Set with fields with formulas?  (Read 1278 times)

0 Members and 1 Guest are viewing this topic.

chelmite

  • Jr. Member
  • **
  • Posts: 27
How do I set up a Shape Data Set with fields with formulas?
« on: August 16, 2018, 08:19:19 PM »
I want to define my shape data once, including formulas for some of the fields, and then copy to specific shapes on the page.
One of 2 things happens now...
Either the formula ends up a string, which is not evaluated on the target shapes,
or the formula is evaluated and the value ends up in the target shapes' fields.

Visio 2016 Pro.

Surrogate

  • Hero Member
  • *****
  • Posts: 1087
    • ShapeSheet™ Knowledge Base
Re: How do I set up a Shape Data Set with fields with formulas?
« Reply #1 on: August 17, 2018, 02:49:37 AM »
IMHO, it is  not forum on telepathy  :)
We need more details!

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3855
  • Ideas Visio-lized into solutions
Re: How do I set up a Shape Data Set with fields with formulas?
« Reply #2 on: August 17, 2018, 11:19:23 AM »
@Surrogate:  are you sure?  You seemed to have read my thoughts pretty accurately!   :o  ;D  ;D
Visio 2019 Pro

chelmite

  • Jr. Member
  • **
  • Posts: 27
Re: How do I set up a Shape Data Set with fields with formulas?
« Reply #3 on: August 17, 2018, 01:30:27 PM »
Sorry for not having enough detail...

I have a formula, =TheDoc!User.WireTypes, that I am trying to use as a the value in a Shape Data Set:
I want:
  • Document User.WireTypes="Cable;Camera;Double Smurf;Internet;Security;Telephone"
  • Document User.CableColors="rgb(192,0,0); rgb(245,157,86); rgb(98,205,242); rgb(0,112,192); rgb(224,0,0); rgb(0,0,0)"
  • Click on Developer/Show ShapeSheet for Document
  • Under User-Defined Cells,
  • Set User.WireTypes="Cable;Camera;Double Smurf;Internet;Security;Telephone"
  • Set User.CableColors="rgb(192,0,0); rgb(245,157,86); rgb(98,205,242); rgb(0,112,192); rgb(224,0,0); rgb(0,0,0)

I want ShapeData, WireType, for certain Connectors. When I create a connector, I edit its ShapeSheet:
  • Under Shape Data:
     
    • Prop.WireType:
      • Format=TheDoc!User.WireTypes
      • Value=INDEX(1,Prop.WireType.Format)
       
    • under Line Format
      • LineColor=THEMEGUARD(INDEX(LOOKUP(Prop.WireType,Prop.WireType.Format),TheDoc!User.CableColors))
       
    The connector acts as I want. I can change the connector's WireType in the Shape Data window, and the connector's color changes appropriately.

    The problem is that I don't want to have to edit each Connector's ShapeSheet separately. I should be able to copy the Shape Data from one Connector to others. However, if I copy the Connector, with ctrl-d or ctrl-left-click-drag, the copied Connector has altered Shape Data fields.
    • User.WireType.Format="=TheDoc!User.WireTypes;=THEMEGUARD(INDEX(LOOKUP(Prop.WireType,Prop.WireType.Format),TheDoc!User.CableColors))"
    • LineColor=RGB(0,112,192)
    instead of what I set those fields to in the original Connector.
    If I try to use Shape Data Sets:
    • Right click on Shape Data window
    • Select Shape Data Sets
    • Select a Shape Data Set (In my case, I called it WireTypes.)
    • Select an existing or create a new shape data set
    • Click Define
      • Create a property
        • Label=WireTypes
        • Name=WireTypes
        • Type=Number
        • Format=Fraction w/ Units
        • Value=TheDoc!User.WireTypes
         
       
    • Then select a Connector
    • Select "Apply checked shape data sets to: Shapes selected in drawing"
    Instead of the selected Connector shapes' Shape Data WireType being a selector for "Camera","Internet", etc, the WireType field in the Shape Data has the value =THEMEGUARD(INDEX(LOOKUP(Prop.WireType,Prop.WireType.Format),TheDoc!User.CableColors))

Yacine

  • Hero Member
  • *****
  • Posts: 2713
Re: How do I set up a Shape Data Set with fields with formulas?
« Reply #4 on: August 17, 2018, 01:47:00 PM »
Your explanation is confusing, please find nevertheless enclosed a drawing with the connector - capable of being copied.
Cheers,
Y.
Yacine

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3855
  • Ideas Visio-lized into solutions
Re: How do I set up a Shape Data Set with fields with formulas?
« Reply #5 on: August 17, 2018, 04:29:12 PM »
@Yacine:  you do very well when you're confused.   ???   ;)
Visio 2019 Pro

Yacine

  • Hero Member
  • *****
  • Posts: 2713
Re: How do I set up a Shape Data Set with fields with formulas?
« Reply #6 on: August 17, 2018, 04:33:54 PM »
Yes, but I had to rely on the telepathic waves. ;)
Yacine

chelmite

  • Jr. Member
  • **
  • Posts: 27
Re: How do I set up a Shape Data Set with fields with formulas?
« Reply #7 on: August 17, 2018, 06:39:34 PM »
Never mind...

I made a copy for you, tested it, and it works the way it's supposed to. I have no idea what's different, why it's working now, and wasn't before.

Yacine

  • Hero Member
  • *****
  • Posts: 2713
Re: How do I set up a Shape Data Set with fields with formulas?
« Reply #8 on: August 18, 2018, 07:19:51 AM »
Thank you.
Yacine