I’m exporting chart in Microsoft Visio using layoutOptions to layout nodes in diagram. Parent node connection point is right, child node connection point is left.
Nodes are added with command
**rectangleID = diagram.AddShape(0, 0, 2, 0.6, rectangleMaster, pageNum)**
**Dim shape As Shape = diagram.Pages(pageNum).Shapes.GetShape(rectangleID)**
so as you can see, pinX and pinY of each node is set to 0 becase I’m intending to use layoutOptions later to arrange them.
I am using compactTree layout, direction is RightThenDown
**Dim treeLayoutOptions As New LayoutOptions()**
**treeLayoutOptions.LayoutStyle = LayoutStyle.CompactTree**
**treeLayoutOptions.EnlargePage = True**
**treeLayoutOptions.Direction = LayoutDirection.RightThenDown**
And applying this layout afted all nodes are added
diagram.Layout(treeLayoutOptions)
I even tried applying layout for each specific page but the result was the same
For Each p As Page In diagram.Pages
p.Layout(flowChartOptions)
Next
And this is what the first page looks like
http://s17.postimg.org/47l7la0ot/page1.jpg
(notice that connection points for each node is changed, it is no longer right (parent) and left (child) - it doesn’t change them if I don’t use any layout option)
This is what the second page looks like
http://s7.postimg.org/k5os3ef09/page2.jpg
you would think that it looks good but there are more nodes here, it’s just they are behind these visible nodes. When I format this page in Microsoft visio using Right Then Down layout option, i get this
http://s7.postimg.org/4zj6vu5x5/page3_Format.jpg