How can I relayout nodes that were in the selection of mouse?

I tried the layout in the GoXam,it worked good.But can I relayout nodes that were in the seletion of mouse.
I found the subgraph example,howerer,the nodes outside the subgraph also were relayout.
Can anyone help me ?

You can call DiagramLayout.DoLayout on the selected Nodes and Links.

However, note that the layout will only consider the graph consisting of the selected nodes and links, and will not consider any other parts.

Note also that you will want to set the DiagramLayout.ArrangementOrigin to an appropriate point given the collective location of the selected parts. Otherwise everything will be moved to start at the origin (0,0), which is probably not the behavior that you want.

uh,I tried the LayoutId.I could set the LayoutId of nodes that outside the seletion to “none” when I want to layout the nodes in my seletion.And I get the effect what I want.THx for your advervise.