Visio Guy

Visio Discussions => General Visio => Topic started by: schub542@gmail.com on July 25, 2017, 01:44:25 PM

Title: How to permanently align shapes?
Post by: schub542@gmail.com on July 25, 2017, 01:44:25 PM
I can't figure out how to keep an alignment constraint constant. It seems to be a temporary constraint. For example if I want to align two shapes horizontally by their origin, I select align by middle. But if I move one shape, their alignment breaks. How can I avoid this and have it so that if I move that shape, the other shape moves to keep them aligned by middle.
Title: Re: How to permanently align shapes?
Post by: metuemre on July 25, 2017, 01:48:05 PM
You can group two shapes after you align them so that they will act like a single shape
Title: Re: How to permanently align shapes?
Post by: schub542@gmail.com on July 25, 2017, 01:57:15 PM
I realized this right after I posted this. Funny how things work like that. For now that's what I'll do but does any one know any other ways to achieve this? Thank you.
Title: Re: How to permanently align shapes?
Post by: metuemre on July 25, 2017, 02:09:46 PM
You can use ShapeSheet and VBA as well but the simplest way is to group them.

https://msdn.microsoft.com/en-us/library/office/ff765103.aspx (https://msdn.microsoft.com/en-us/library/office/ff765103.aspx)
https://msdn.microsoft.com/tr-tr/vba/visio-vba/articles/object-model-visio-vba-reference (https://msdn.microsoft.com/tr-tr/vba/visio-vba/articles/object-model-visio-vba-reference)

Title: Re: How to permanently align shapes?
Post by: Nikolay on July 25, 2017, 04:05:21 PM
you can also use guidelines

https://support.office.com/en-us/article/Snap-to-guides-to-lay-out-a-drawing-6d5d451a-f46d-4fd5-a359-1032672a1e7c
Title: Re: How to permanently align shapes?
Post by: wapperdude on July 25, 2017, 05:07:47 PM
To add to the dicussion, all of those would typical techniques, but each has short comings.
Grouping:  Best application is for moving both shapes at same time...but not necessarily limited in this regard.

Shapesheet:  this can be used in conjunction with grouping or independent of grouping.   Allows you to lock either horizontal, vertical, or both alignments.  Makes it easy to change spacing but maintain alignment.  Requires editing to break alignment.

VBA (macro):  many various possibilities.  Downside is macro security issue.  VBA could be used to align 2 or more shapes, lock their alignment, etc.  Basically, if you have repeatable task, VBA can be set to do those tasks for you, e.g. either of the steps above.  It is the most involved solution.

Guidelines:  you can glue shapes to guidelines, thus insuring their alignment.  Move the guidelines and all glued shapes move.  Our can easily move, reposition, change the order of the shapes.  Downside is extra clutter in the drawing, and alignment is lost if guideline is deleted.

HTH
Wapperdude


Title: Re: How to permanently align shapes?
Post by: Yacine on July 25, 2017, 05:13:14 PM
To add to Wapperdude's list: use a proper grid with fixed spacing and big snap value.