News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Glue shapes to stay together when shape width changes by shape data

Started by kiler40, April 12, 2024, 09:41:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kiler40

Hello Visio Guru Team,
Long time i have been lost from the Visio universe and now i am struggling to remember how to glue 2 rectangle corners together, so when i change the width of one, the other one to move with the first.

Generally - I have N number of shapes, each of them have a width linked to a shape data. Each shape is snaped to the previous. The whole purpose of this is SMED visualization and the width is representation of "time"
Most probably there is a topic about it but i cannot find it.

Any help please?

Yacine

There will be dozens of possible implementations.
One that came immediately in my mind is Junichi's chaining formula, for 1D-Shapes. In your case they are 2D, but you'll certainly manage this hurdle.
BeginX = guard(SETATREFEXPR([P]!EndX)
BeginY = guard(SETATREFEXPR([P]!EndY)
Where [P] needs to be replaced by the proper parent references (sheet.x!)

Less code based and less robust are glue points.
https://www.youtube.com/watch?v=hMI-bhf1Nqk&ab_channel=WhyGe
Mind that it will always be a master/slave relationship. Slave glued to Master and slave will follow master but not the other way around.
Yacine

wapperdude

There is a "trick" you can use with normal gluing.  Let's say shape B is to the right of shape A, and shape C is to the right of shape B.  Assume that shape A is glued to shape B, and shape B is glued to shape C.

Shape C's width can change without any problems.  But, change shape B, and it becomes unglued from C.  Likewise, A would unglue from shape B.

To prevent ungluing, for this configuration, a simple shapesheet change is needed.  Change LocPinX = width*1.  What this does is keeps the shape's right edge as reference, so that edge doesn't move with changes in width.  Once this change is made, then glue A to B, then B to C.  Now when width changes, because the right edge is stable, the shapes remain glued.

A similar trick could be applied vertical direction with LocPinY.

Beyond that, solutions are more difficult and involve using code.  Not trivial.  Since the widths represent time, why not use timeline shapes.  As I recall, these can be ganged together.  Just a thought.
Visio 2019 Pro

kiler40

Thanks Both,
I will try provided direction.

One quesiton:
"Since the widths represent time, why not use timeline shapes.  As I recall, these can be ganged together."
Since i am representing seconds, by some reason i cannot adjust it to so small steps.

kiler40

I got in a strange situation.
I cannot glue nothing.... I have a simple rectangle and i cannot glue it to anything. What did i do wrong?

Yacine

Yacine

kiler40

You are absolutely right :)
I have selected everything - and i cannot glue 2 rectangles together.
I am trying all glue options one by one, and then all together. still nothing.

https://drive.google.com/file/d/1vsIkSFsphdXqe-sTXKcAqs_6PIs4XSUK/view?usp=drive_link

wapperdude

Funny thing.  On way to repair shop I bumped into Yacine as he was leaving.  We chatted for awhile...

> which version of Visio?
> do you have gluing enabled for geometry shapes?
> do the shapes have glue points? 
> both inny and outy?  An inny point likes to glue to an outy.  Inny = type 0, outy = 1. For example, place inny pts on left side, outy pts on right side (or visa versa).  When you grab shape to drag it, place mouse near conn pt of interest as Visio will focus on pt nearest to where mouse grabs the shape.  Drag shape such that an inny aligns to an outy.

@Yacine:  shop owner thinks my crystal ball may not be repairable.  How about you?

Visio 2019 Pro

Yacine

Quote from: wapperdude on April 15, 2024, 03:10:01 PM@Yacine:  shop owner thinks my crystal ball may not be repairable.  How about you?

Maybe it's time for a new approach! Forget the crystal ball, I'm channeling the future from now on. Ask me anything!
Yacine

kiler40

Hi Again,

> which version of Visio?
  - Microsoft® Visio® Plan 2 MSO (Version 2308 Build 16.0.16731.20542) 64-bit
> do you have gluing enabled for geometry shapes?
  - Not sure how to do this for "geometry shapes"? Also google it. could not find specific topic.
> do the shapes have glue points?
  - Yes, If i use the "Line" it is working without problem.
> both inny and outy? ...
  - This i did not understand.

Snap function is working perfectly and shapes snaps exactly where they should snap. but not gluing.

P.S. I have fixed the access to the screenshot. (i think)

https://drive.google.com/file/d/1vsIkSFsphdXqe-sTXKcAqs_6PIs4XSUK/view?usp=drive_link

Surrogate

Hi, again!

You really use Dynamic grid or/and Drawing aids?
I am usually disable these options...

Visio Guy

The Visio Radial Grid v2 video has info on doing the "2D connection points" about 2/3 of the way through:

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

kiler40

I have fixed it with the https://www.youtube.com/watch?v=hMI-bhf1Nqk&ab_channel=WhyGe
I adjusted a little bit the points position so they can be exactly at the corners and now it works.
Strange for me... but it works :)

Thank you all for the help ;)

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 394 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1233KB.
Tokens: post-login.
Cache hits: 13: 0.00241s for 26,764 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]