Question

I've managed to learn enough about programmatically authoring visio diagrams to create shapes with custom properties which I can use to populate a diagram. I can connect the shapes with dynamic connectors and get visio to lay them out automatically.

As pleased as I am with my progress thus far, I am missing a fundamental piece to sucessfully model my system. I need to add shapes to shapes.

Initially when learning about the visio object model it seemed like since everything has a shapesheet, that it was a perfect match for my needs. However - attempts to 'Drop' a shape onto another shape keeps slapping me with com exceptions. (Even though the method is there.)

The solution should support shapes added to shapes which have shapes, etc, and the parent shape should grow to fit added children.

Internal nested shapes must remain eligible for gluing connectors to..

I'm trying to use grouping but don't feel like I'm getting any closer.

Any help or ideas are appreciated.

Was it helpful?

Solution

If you are using Visio 2010 or later, Container shapes might serve your needs better than group shapes. Group shapes are primarily designed for creating composite shapes, not so much for containing peer shapes. Container shapes do not hide or limit the functionality of their contained shapes. Container shapes can be configured to automatically resize to fit the shapes added to them. You can create custom container shapes if the out-of-the-box containers don't have the appearance you want.

A link that might help you get started: http://blogs.msdn.com/b/visio/archive/2009/08/25/organizing-diagrams-with-containers.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top