I am creating a visio 2007 page with almost 900 shapes that represent a geneology tree. The creation of the page is done programatically with the following steps:
1) opening a new visio doc
2) dropping the shapes
3) connecting parents to childs
4) re layout the page with visPLOPlaceHierarchyTopToBottomCenter and visLORouteSimpleSN
The problem is that the layout is not 100% succesfull. Some shapes get on top of others. I 've tested my code thoroughly but I haven't figure out something.
I 've even used the visio sdks sample (WBSTreeView.sln) which has a similar output but nothing there too. Practically with no code changes in this project, I have inserted the data in the mpd file and changed the page layoyt but still no luck.
Therefore I am concluding that the Hierarchy layout in visio 2007 has a problem. Any suggestions?
Thanks in advance
Microsoft Visio
Last Comment
gkarras
8/22/2022 - Mon
Scott Helmers
Have you experimented with setting ShapePermeablePlace=FALSE. According to the SDK, this prevents shapes from being placed on top of a shape during layout operations.
gkarras
ASKER
Scott thanks for the reply. When I came accross this problem, the first step I did was to play with this property. This is waht I did:
I 've unchecked the raleted checkbox on the master's shape Behavior property. The shapes are dropped into the page and when I open the file I am going into the shape's Behavior property and everything looks ok (the check box is not checked).
Your idea is in the right direction though. The only thing I can think of is that either this property doesn't work, or there is something else that overrides this.
gkarras
ASKER
With little more playing around, I came up with the following:
1) Differrent output is achieved, depending on how I connect the shapes, eg: (When I connect parents to childs I get 10 shapes overlapping and wjen I connect childs to parents 15 different shapes are overlapping)
2) When I am setting the "Alignment" property in the "Configure Layout" dialog to Right or Left everything is fine. The problem exists only when I set it to Center ( Application.ActiveWindow.Page.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOPlaceStyle).FormulaForceU = "17")
Therefore I am concluding that there must be a bug with the alignment property. Anybody knows how to report this?
I 've already tried the forum suggestion but still no luck. In any case I 'll leave the question open just a few days more just in case, and then reward u the answer. Propably I'll give a try to your first "costly..." suggestion just to see what happens.