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

Glueing edges of rectangles together - is this even possible?

Started by foxpertise, September 17, 2023, 05:38:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

foxpertise

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

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)

foxpertise

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

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

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

Visio 2019 Pro

foxpertise

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

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

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?
Yacine

foxpertise

Quote from: wapperdude on September 17, 2023, 09: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
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

Quote from: Yacine on September 18, 2023, 06: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?

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

@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

Quote from: wapperdude on September 17, 2023, 09: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
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

👍. Makes perfect sense.  Good to hear problem solved.
Visio 2019 Pro

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: 417 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1276KB.
Tokens: post-login.
Cache hits: 13: 0.00238s for 26,750 bytes (show)
Cache misses: 2: (show)
Queries used: 16.

[Show Queries]