Centering All shapes in a contianer.

Started by bwharrington, August 19, 2019, 04:50:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bwharrington

I'm trying to find if Visio has a native function I can use to center all the shapes in a container. This may be a bit loaded but I do know this is done is some capacity with layouts.

Is anyone aware of something like this we can call?

Thanks,

wapperdude

I What do you mean, center all shapes? 

Literal interpretation would be every shape aligned to center of the container. 

The more likely meaning would be to center the shapes as a group. 

Third possibility is to uniformly distribute the shapes within the container. 

Finally a 4th solution, fit the container to the shapes, see https://docs.microsoft.com/en-us/office/vba/api/visio.containerproperties.fittocontents
Visio 2019 Pro

Yacine

Right click on container, select content, use the aligning sub menu and align horizontally.
Yacine

wapperdude

@ Yacine:  OK, that's another option for "centering".  I took the OP's question to mean centering the shapes to the container.  But your interpretation would be centering to each other, the shapes within the container.  LOL.
Visio 2019 Pro

Yacine

#4
@Wayne,
right, you center first the elements to each other, then you fit the container to its content. I missed mentioning this last step.
Then were're on part.
Yacine

bwharrington

Thank you guys,

I learned a couple new things with some of what Visio can do. Wapperdudes initial post made me realize that while my requirement seems like something Visio would just do, it opens up a world of other questions and that my requirement was probably more custom than I think.

Ultimate I ended up writing a custom solution. Its not perfect but it will work.

Thanks again guys. I really appreciate your input.

wapperdude

Visio 2019 Pro