SETATREF-SETATREFEVAL-SETATREFEXPR ShapeSheet Guru challenge!

Started by Visisthebest, October 02, 2023, 09:02:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

I have a complex challenge for the real shapesheet gurus out there.

I have a specific need for this formula to get one shape to move with the other:

SETATREF(User.PinX,SETATREFEVAL(SETATREFEXPR(746.1 mm)+SETF(GetRef(TheOtherShape.21!PinX),SETATREFEXPR(746.1 mm))))

In this solution, using GUARD() does not work Visio blows the guards off the specific type of shape (list container) I use.

I also want to set a MIN() and MAX() formula in a way that restricts the movement of the shape by the user along the X axis, or another way to restrict between which points on the X axis the user can move (absolute positions on the page).

If I put even just MIN() around the formula above, it breaks the connection with the shape that should move along (TheOtherShape).

How can I solve this challenge?
Visio 2021 Professional

Surrogate

I am not SETATREF-SETATREFEVAL-SETATREFEXPR Guru!
Very rarely use function SETATREF...

To set limits I suggest to look at the BOUND function.

Visisthebest

#2
Already better than using MIN() & MAX() together thank you Surrogate!

Creating combinations with a SETATREF-SETATREFEVAL-SETATREFEXPR formula is a challenge hopefully someone has an idea of how to keep them working as they should while applying a BOUND() function so the shape cannot move beyond a range specified with BOUND!

To be sure, the shape I am pushing the PinX value in to should get the same bounded value as the shapes with this formula in its PinX cell.

(by the way, was the forum server not working optimally in the past hour, was very hard to post a response)
Visio 2021 Professional


wapperdude

Didn't you already ask a similar question?

Wrt this post, you don't really spell out your end game.  You kinda allude to list container, but that's about it.  Oh also mention limiting range of movement.  From that, I conclude that the list container is being moved, within some defined min / max range.  Then, the list members need to track the container location and maintain there relative position to each other and the container.  Is that correct?
Visio 2019 Pro

Visisthebest

#5
My previous question was the basis for this follow-up more complicated question.

Yes but the list members track the container automatically, I just need the container to track the shape and stay within the same limits.
Visio 2021 Professional

Visisthebest

Visio 2021 Professional

Yacine

Yacine

Visisthebest

Not there yet it doesn't work, but will upload it when it is solved, of course!
Visio 2021 Professional

wapperdude

Quote from: Visisthebest on October 03, 2023, 03:10:56 AM
My previous question was the basis for this follow-up more complicated question.

Yes but the list members track the container automatically, I just need the container to track the shape and stay within the same limits.

Track the shape???  Which shape?  A member shape???
Visio 2019 Pro

Visisthebest

Visio 2021 Professional

wapperdude

Ah!  I see.  The container is a member of this other shape.  Doesn't that create problems for the container?  How do you add shapes to it?  The List Container paradigm expects it to be a toplevel shape.  This defeats that and prevents addition of future list shapes.
Visio 2019 Pro

wapperdude

There is a way to do this, by slaving the movement without actually grouping.  It does use SETATREF fcns.  The attached has examples of doing it two ways.  The best performance on my laptop occurs when the SETATREF resides in the List Container.  This is counter-intuitive.  As it is the "slave", you would expect the formula to reside in the "master" shape, which happens to be the yellow oval in my attachment.  But, doing so, resulted in somewhat quirky, unpredictable location.  Whereas, as suggested, using List Container to hold the formula, you can still select and drag the oval with the list following in-tow.  Very smooth, predictable.

Ooops.  Forgot to check copy/paste.  Yep.  Formula gets blown away in the better performing implementation.  Sorry about that.
If the formula is in the yellow oval shape, then functionality is preserved with copy/paste.

Visio 2019 Pro

Visisthebest

Thank you Wapperdude very nice :) , this master-slave behavior is what I have already implemented. But you have reversed where you put the formula for the master-slave behavior, I have the SETATREF-SETATREFEVAL-SETATREFEXPR in the master. Your way might work better for my use case I will experiment with the right order of formulas to see what works best and is simplest (although nothing is really simple at this point).

I am running in to several challenges trying to get different behaviors of how shapes move and are restricted in moving, but haven't found the right combination with my use case.

I will share my solution as well once I think it is solid, including how it restricts the movement of shapes. Thank you!

Visio 2021 Professional

Visisthebest

By they way, I have tried several prompts in GPT-4 to see if it can come up with a solution, but it can't come up with something that actually works in Visio with respect to SETATREF-SETATREFEVAL-SETATREFEXPR-formulas , let alone what I actually want to achieve.
Visio 2021 Professional