Search
FlowChart.ArrangeDiagram Method
See Also
 



Arranges the diagram items using the specified layout routine.

 Syntax

VB6  Copy Code

Public Sub ArrangeDiagram( _
    ByVal layout As Object _
)

C++  Copy Code

public:
void ArrangeDiagram (
    IDispatch* layout
)

 Parameters

layout
A structure containing layout settings.

 Remarks

Automatically arranges the diagram items. Items whose IgnoreLayout property is enabled are ignored by layout algorithms. The kind of layout to apply and its properties are specified via the layout argument. Currently supported layout types are LayeredLayout, TreeLayout, GridLayout, CircularLayout and SpringLayout.

If there are several unconnected sub-graphs in a diagram, you can specify which sub-graph to arrange by setting the Root property of the respective layout class.

In some layouts the order of the arrows in the nodes' OutgoingArrows or IncomingArrows collections defines how child nodes are arranged. The ChangeIndex method of the IArrows collection class lets you change the index of an arrow in the collection and thus specify the order of child nodes under their parent node.

 Example

The first button applies Spring-Embedder graph layout algorithm on the current diagram. The second button applies tree layout.

VB6  Copy Code

Private Sub Command1_Click()

    Dim layout As New SpringLayout
    layout.NumIterations = 500
    layout.NodeDistance = 100
    fcx.ArrangeDiagram layout

End Sub

Private Sub Command2_Click()

    Dim treeLt As New TreeLayout
    treeLt.Root = fcx.ActiveBox
    treeLt.NodeSpacing = 30
    treeLt.LevelSpacing = 40
    fcx.ArrangeDiagram treeLt

End Sub

 See Also