Author Topic: Glueing edges of rectangles together - is this even possible?  (Read 1007 times)

0 Members and 1 Guest are viewing this topic.

foxpertise

  • Jr. Member
  • **
  • Posts: 10
Glueing edges of rectangles together - is this even possible?
« on: September 17, 2023, 12:38:18 PM »
I have three rectangles from the Basic Shapes stencil, all initially the same height and width and arranged vertically with the left edges aligned. I want to glue the bottom edge of the top rectangle to the top edge of the middle rectangle, and the bottom edge of the middle rectangle to the top edge of the bottom rectangle.  This is not a question about grouping BECAUSE what I an trying to achieve is this:
Changing the height of the middle rectangle will cause the top and bottom rectangles to adjust their positions so as to remain glued to the middle rectangle.  Is this even possible?  I have searched for a solution but nothing I have found so far seems to cater for what I am trying to do.
Any help or suggestions will be much appreciated.

Nikolay

  • Hero Member
  • *****
  • Posts: 1285
    • UnmanagedVisio
Re: Glueing edges of rectangles together - is this even possible?
« Reply #1 on: September 17, 2023, 01:52:22 PM »
Connecting one 2D shape to another 2D shape at two points at once using the user interface only is not possible AFAIK.
You can connect 1D to 2D at two points at once though (check out the built-in "rack" shape as an example), but not 2D to 2D (why, btw?)
You can also connect one 2D shape to another 2D shape at one point (the connection point they have should have inbound/outbound for this to work, by default they are inbound)

We could discuss workarounds, though, if you could provide a bit more information regarding the shape you are trying to build.
Is there a specific reason you exclude grouping from the consideration? Or, maybe you are just not sure how to use it to build a shape like this?
Would something like a container+list work? (check the "Database" built-in diagram template for example)
« Last Edit: September 17, 2023, 01:55:53 PM by Nikolay »

foxpertise

  • Jr. Member
  • **
  • Posts: 10
Re: Glueing edges of rectangles together - is this even possible?
« Reply #2 on: September 17, 2023, 02:21:28 PM »
Many thanks for your reply and suggestions.  I have really only dabbled with Visio over the years, so I am a bit out of my depth.  I am going to try to attach a drawing which is almost what I would like but I want to try to set it up in such a way that I can adjust the height, and possibly the width of the rectangles whose dimensions are presently 2.625" wide by 1.625" high and everything else adjusts accordingly.

Nikolay

  • Hero Member
  • *****
  • Posts: 1285
    • UnmanagedVisio
Re: Glueing edges of rectangles together - is this even possible?
« Reply #3 on: September 17, 2023, 03:09:50 PM »
Thank you, now it's much clearer. I have no idea how to do it exactly, though. But you are right, it seems that grouping won't work.

Maybe you could add a page property like "width" and "height" and then use these for width/height in the rectangles.
Then, a row can be a list of shapes. The whole box can be a list of rows.

Another option could be to update the diagram programmatically using VBA.

Anyway, this whole thing looks like a lot of work, maybe there is a better approach and others can suggest something better.

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4837
  • Ideas Visio-lized into solutions
Re: Glueing edges of rectangles together - is this even possible?
« Reply #4 on: September 17, 2023, 04:11:24 PM »
Whoa!  That is a lot of work.  Seems there's two major issues:  gluing 2d shapes and efficiently constructing the diagram.

WRT gluing: 
  >>  Discussion regarding 2D to 2D:  http://visguy.com/vgforum/index.php?topic=10026.msg46079#msg46079
  >>  Attached is simple 3 shapes.  The top and bottom are each glued to the center.  To simplify, only In/Out connection points used.  The dirY is important setting.  Open shapeshape sheets to see what's used.  Moving center (orange) shape will cause all 3 to move.  Similarly, horizontal connections can be done.  Connection points are not provided in this test file.

Alternative to gluing to 2D shapes together would be to place guide lines and glue shapes to the guides.

WRT efficiency:  there is another alignment tool that might be beneficial.  It does adjacent face to face butt alignment.  Does not glue.  But you could use it to get, say, a row built.  Then go back and "wiggle" a shape to get it glued; work your way across the row.  Once set, group the row, duplicate as many as necessary and then align.  That still does not solve the gluing issue.  http://visguy.com/vgforum/index.php?topic=8870.msg38936#msg38936
Visio 2019 Pro

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4837
  • Ideas Visio-lized into solutions
Re: Glueing edges of rectangles together - is this even possible?
« Reply #5 on: September 17, 2023, 04:19:13 PM »
Ah.  Found Visio Guy article I was looking for: http://www.visguy.com/2019/09/11/hex-snap-glue-shapes/
Visio 2019 Pro

foxpertise

  • Jr. Member
  • **
  • Posts: 10
Re: Glueing edges of rectangles together - is this even possible?
« Reply #6 on: September 17, 2023, 04:40:23 PM »
Thank you (both). There's a lot to think about and play around with - and I've got plenty of other (non-Visio) stuff on hand at the moment so it will take me a while before I can report back on how I get on. 

My initial effort was to create six horizontal rectangles with protected height of 1/8".  I then spaced these equally in a vertical stack and grouped them all together (hoping that increasing the height of the group would increase the spacings between the rectangles and leave the heights of the rectangles at 1/8"). Alas, the "protected" height of the rectangles changes with the height of the group

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4837
  • Ideas Visio-lized into solutions
Re: Glueing edges of rectangles together - is this even possible?
« Reply #7 on: September 17, 2023, 04:53:15 PM »
Go into shapesheet of your rectangles and look at the height cell.  It probably references the group top level shape.  Simple fix is to replace the formula with desired, literal value.  Might want to put a guard fcn around the value.  Now the height won't change as the group size is changed.

And as one additional reference on gluing multiple objects together, similar to the Visio Guy article, but less info:  http://visguy.com/vgforum/index.php?topic=8042.msg34734#msg34734
Visio 2019 Pro

Yacine

  • Hero Member
  • *****
  • Posts: 3208
Re: Glueing edges of rectangles together - is this even possible?
« Reply #8 on: September 18, 2023, 01:27:52 AM »
I haven't read yet thoroughly your posts, but I'll give nevertheless my first thoughts.

Gluing is always unidirectional. That means there are always items being masters, that won't follow but are followed by others. It doesn't go in both directions. So to keep a certain comfort in editing, I would suggest a ghost shape - e.g. a guide to glue the other shapes to.

Even better, since you have many shapes to coordinate, I highly recommend my "Sharem" tool. http://visguy.com/vgforum/index.php?topic=6914.msg38314#msg38314

It can (among others) control both the position and the size of the beams in your drawing.


PS:
1) Is it correct that on the right side there are red reinforcements, but not on the left side?
2) Will all the gaps have always a same value, or do you wish to vary them along one rack?
« Last Edit: September 18, 2023, 02:12:26 AM by Yacine »
Yacine

foxpertise

  • Jr. Member
  • **
  • Posts: 10
Re: Glueing edges of rectangles together - is this even possible?
« Reply #9 on: September 18, 2023, 08:38:57 AM »
Go into shapesheet of your rectangles and look at the height cell.  It probably references the group top level shape.  Simple fix is to replace the formula with desired, literal value.  Might want to put a guard fcn around the value.  Now the height won't change as the group size is changed.

And as one additional reference on gluing multiple objects together, similar to the Visio Guy article, but less info:  http://visguy.com/vgforum/index.php?topic=8042.msg34734#msg34734
In the shapesheet the height is shown as =Sheet.1195!Height*0.0499.  I tried replacing that with a literal value but it didn't seem to work (the value changed to 0).  Will try again when I have some more time.  I am definitely have no idea about putting a guard fcn (function?) around the value.
I have downloaded the drawing from the article you referenced and will take a look, again, when I can find some time.  Thanks again

foxpertise

  • Jr. Member
  • **
  • Posts: 10
Re: Glueing edges of rectangles together - is this even possible?
« Reply #10 on: September 18, 2023, 08:45:25 AM »
I haven't read yet thoroughly your posts, but I'll give nevertheless my first thoughts.

Gluing is always unidirectional. That means there are always items being masters, that won't follow but are followed by others. It doesn't go in both directions. So to keep a certain comfort in editing, I would suggest a ghost shape - e.g. a guide to glue the other shapes to.

Even better, since you have many shapes to coordinate, I highly recommend my "Sharem" tool. http://visguy.com/vgforum/index.php?topic=6914.msg38314#msg38314

It can (among others) control both the position and the size of the beams in your drawing.


PS:
1) Is it correct that on the right side there are red reinforcements, but not on the left side?
2) Will all the gaps have always a same value, or do you wish to vary them along one rack?

Thanks for your input.  I will have a look at "Sharem".  In answer to your questions, (1) I will probably modify the design such that the left side uses "reinforcements" like the right side and (2) the gaps (vertical and horizontal) will always be the same.

Thomas Winkel

  • Sr. Member
  • ****
  • Posts: 259
Re: Glueing edges of rectangles together - is this even possible?
« Reply #11 on: September 18, 2023, 09:40:51 AM »
@Yacine:
Really impressive your Sharem tool, the examples are awesome.

@foxpertise:
Although this can be done in Visio with some effort, I would still prefer a real CAD tool for this task.
For example I use Fusion 360 for 3D printing, and parametric modeling is an integrated feature.
In Visio I would also do it with ShapeSheet formulas.
Maybe in combination with VBA, if also the number of columns and rows must be dynamic.

foxpertise

  • Jr. Member
  • **
  • Posts: 10
Re: Glueing edges of rectangles together - is this even possible?
« Reply #12 on: September 18, 2023, 05:22:39 PM »
Go into shapesheet of your rectangles and look at the height cell.  It probably references the group top level shape.  Simple fix is to replace the formula with desired, literal value.  Might want to put a guard fcn around the value.  Now the height won't change as the group size is changed.

And as one additional reference on gluing multiple objects together, similar to the Visio Guy article, but less info:  http://visguy.com/vgforum/index.php?topic=8042.msg34734#msg34734
I got the height set to a literal value of 0.125", so I ended up with a group of six horizontal rectangles stacked vertically.  Having set the height of the rectangles to the literal value of 0.125" means that I can now adjust the height of the group so that the height of the rectangles remains at 0.125" and only the vertical distance between the rectangles changes.  Hope that makes sense.
I then did something similar for the verticals so that I can adjust the width of that group with the individual widths staying fixed and the horizontal spacing between them changing.
Great stuff!  Many thanks!!

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4837
  • Ideas Visio-lized into solutions
Re: Glueing edges of rectangles together - is this even possible?
« Reply #13 on: September 18, 2023, 10:28:51 PM »
👍. Makes perfect sense.  Good to hear problem solved.
Visio 2019 Pro