Author Topic: Group Shape Master Formulas Not Evaluating When Dropped  (Read 905 times)

0 Members and 1 Guest are viewing this topic.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4477
  • Ideas Visio-lized into solutions
Re: Group Shape Master Formulas Not Evaluating When Dropped
« Reply #15 on: August 24, 2022, 09:21:24 AM »
Ooops!!!  Well that was interesting.  3rd times a charm.  This time the end point failed.  The formula remained in tact, but the value does give REF#.

Converted to Croc's technique.  That performs better, but, as he mentioned, the End lbl doesn't track with line end movement.  It appears the formula is not updating after drop.

Haven't gone any further.
Visio 2019 Pro

Croc

  • Sr. Member
  • ****
  • Posts: 330
    • Visioport
Re: Group Shape Master Formulas Not Evaluating When Dropped
« Reply #16 on: August 24, 2022, 09:40:47 AM »
Quote
...as he mentioned, the End lbl doesn't track with line end movement.
This refers to the original version, which does not work well.
The second master, in which the function is moved to the group, works fine.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4477
  • Ideas Visio-lized into solutions
Re: Group Shape Master Formulas Not Evaluating When Dropped
« Reply #17 on: August 24, 2022, 10:02:53 AM »
@Croc:  Ah. Yes.  Well, looks like I independently confirmed your discovery.  Here's my version.  The differeence that I can tell is that I set the label box size to be based upon the txt size.
« Last Edit: August 24, 2022, 10:10:57 AM by wapperdude »
Visio 2019 Pro

Croc

  • Sr. Member
  • ****
  • Posts: 330
    • Visioport
Re: Group Shape Master Formulas Not Evaluating When Dropped
« Reply #18 on: August 24, 2022, 12:22:36 PM »
By the way, after a little effort, I found out that the idea with EventDrop also works. But the reference to the group has to be calculated through the ID() function. That is, to get a "Sheet.4" link, you will have to write "Sheet."&ID()
Then the formula for the end point will look like
Code
EventDrop = SETF(GetRef(Sheet.7!PinX),"PNTX(POINTALONGPATH(Sheet."&ID()&"!Geometry1.Path,Sheet."&ID()&"!User.Label_B_Distance))")
+SETF(GetRef(Sheet.7!PinY),"PNTY(POINTALONGPATH(Sheet."&ID()&"!Geometry1.Path,Sheet."&ID()&"!User.Label_B_Distance))")
Two more SETFs will have to be added to serve the begin point of the connector. I'm not going to write this so as not to confuse readers :)
In the attached .vsdx file, this is implemented in the "drop" master.
---
This is the method that I suggested at the very beginning, referring to the article. But the example in the article is designed for a permanent reference like TheDoc, and in this case the reference should lead to a group. And the name of the group changes when the master is copied to the drawing page. But the inheritance mechanism does not take this into account in the POINTALONGPATH function argument. Therefore, we have to calculate the name yourself using the ID() function.
« Last Edit: August 24, 2022, 12:32:45 PM by Croc »

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4477
  • Ideas Visio-lized into solutions
Re: Group Shape Master Formulas Not Evaluating When Dropped
« Reply #19 on: August 24, 2022, 01:12:55 PM »
@Croc:  Some nice discoveries.  However, it would seem that the simpler method is more appropriate than this latest solution.

Changes to the simpler approach could be to a have a more efficient method of modifying the location of the label and possibly  the LocPin assignments.  The location improvement could be as simple as using shape data, or a more freeform using control points.
Visio 2019 Pro

efowler

  • Newbie
  • *
  • Posts: 6
Re: Group Shape Master Formulas Not Evaluating When Dropped
« Reply #20 on: August 24, 2022, 05:36:29 PM »
You guys are talking way above my head, but I did try putting the Pin formulas in the master user section and referencing those cells from the label Pin cells, and it worked perfectly. Still have no clue why that's required, but happy to have it working. Thank you both for your help!