Author Topic: SETATREF() formulas in glued cells, cannot find them  (Read 1296 times)

0 Members and 1 Guest are viewing this topic.

Visisthebest

  • Hero Member
  • *****
  • Posts: 863
SETATREF() formulas in glued cells, cannot find them
« on: April 12, 2023, 05:46:25 AM »
In Microsoft's SETATREF documentation: https://learn.microsoft.com/en-us/office/client-developer/visio/setatref-function

it says this:

"If shapes are glued, Visio follows the SETATREF reference chain within the same sheet and places glue formulas in the referenced cell."

When I glue shapes in Visio 2019/2021 desktop (gluing them together on one of the connectors of each shape), there are no SETATREF formulas however there are formulas like this:

=LOCTOPAR(PNT(Square.2!Connections.X1+20 mm,Square.2!Connections.Y1+20 mm),Square.2!EventXFMod,EventXFMod)

Maybe this changed between Visio versions, or:

Do you maybe get SETATREF() formulas when you glue shapes to their respective geometries, haven't ever used that however.
« Last Edit: April 12, 2023, 05:52:23 AM by Visisthebest »
Visio 2021 Professional

Surrogate

  • Hero Member
  • *****
  • Posts: 1803
    • ShapeSheet™ Knowledge Base
Re: SETATREF() formulas in glued cells, cannot find them
« Reply #1 on: April 12, 2023, 05:57:24 AM »
Code
=LOCTOPAR(PNT(Square.2!Connections.X1+20 mm,Square.2!Connections.Y1+20 mm),Square.2!EventXFMod,EventXFMod)
Visio application engine prescribes such formulas. It can replace user's hand-written formulas.

I try to avoid using the SETF/SETATREF functions in the geometry-related or Glue Info sections
« Last Edit: April 12, 2023, 06:02:12 AM by Surrogate »

Visisthebest

  • Hero Member
  • *****
  • Posts: 863
Re: SETATREF() formulas in glued cells, cannot find them
« Reply #2 on: April 12, 2023, 06:26:02 AM »
Why do you try to avoid using the SETF/SETATREF functions in the geometry-related or Glue Info sections?

I kinda like these formulas are very resistant to changes made to shapes by either the user or Visio, but no full understanding of the disadvantages these are some of the hardest formulas to wrap my head around!
Visio 2021 Professional

Surrogate

  • Hero Member
  • *****
  • Posts: 1803
    • ShapeSheet™ Knowledge Base
Re: SETATREF() formulas in glued cells, cannot find them
« Reply #3 on: April 12, 2023, 06:56:49 AM »
This is all my humble personal opinion based on a little experience with it! I've only had a couple of attempts in which I failed to create a change-resistant formula.
My personal score is Visio engine - Surrogate 2:0  :o

Interesting to hear about the positive experiences of users in our community

Visisthebest

  • Hero Member
  • *****
  • Posts: 863
Re: SETATREF() formulas in glued cells, cannot find them
« Reply #4 on: April 12, 2023, 08:31:34 AM »
In my experience SETATREF() is resistant enough for a lot of uses.
Visio 2021 Professional

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4837
  • Ideas Visio-lized into solutions
Re: SETATREF() formulas in glued cells, cannot find them
« Reply #5 on: April 12, 2023, 10:35:47 AM »
Quote
When I glue shapes in Visio 2019/2021 desktop (gluing them together on one of the connectors of each shape), there are no SETATREF formulas however there are formulas like this:

Visio doesn't add SETATREF formulas.  It "honors" pre-existing formulas.  In your "glue" example, that is the standard glue formula structure.  As there was no pre-existing SETATREF, there is no subsequent SETATREF.

For more examples, see forum post:  http://visguy.com/vgforum/index.php?topic=6383.msg26308#msg26308
Visio 2019 Pro