Throws after re-drawing the graph and selecting a node

Aug 14, 2009 at 2:38 AM

I have a routine Create-VisualNodeXL that calls Clear on the Vertices and Edges and then draws the graph.

I can call this multiple times drawing the graph with the same data no problem.

If I select a node, call the routine again and select node it throws. Do I need to clear the NodeSelection?



at ArgumentChecker.ThrowArgumentException(String sMethodName, String sArgumentName, String sMessageDetails, Exception oInnerException)  
at ArgumentChecker.ThrowArgumentException(String sMethodName, String sArgumentName, String sMessageDetails)  
at VertexDrawer.CheckDrawVertexArguments(IVertex oVertex, GraphDrawingContext oGraphDrawingContext)  
at VertexDrawer.TryDrawVertex(IVertex vertex, GraphDrawingContext graphDrawingContext, VertexDrawingHistory& vertexDrawingHistory)  
at GraphDrawer.DrawVertex(IVertex oVertex, GraphDrawingContext oGraphDrawingContext)  
at GraphDrawer.RedrawVertex(IVertex vertex, GraphDrawingContext graphDrawingContext)  
at NodeXLControl.SetVertexSelectedInternal(IVertex oVertex, Boolean bSelected)  
at NodeXLControl.SetAllVerticesSelected(Boolean bSelected)  
at NodeXLControl.OnMouseDown(MouseButtonEventArgs e)  
at UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)  
at MouseButtonEventArgs.InvokeEventHa......

Aug 14, 2009 at 7:10 PM

For now, don't clear the edge and vertex collections.  Instead, do this:

nodeXLControl.Graph = new Graph();

This will fix the bug you're seeing, as well as a related layout bug that occurs when using the Fruchterman-Reingold layout.  (The latter bug causes the vertices to be placed on top of each other if you clear and then repopulate the edge and vertex collections.)

In the next version of NodeXL (, there will be a NodeXLControl.ClearGraph() method that does this for you, and there will be warnings in the documentation for the EdgeCollection.Clear() and VertexCollection.Clear() methods.

-- Tony

Aug 24, 2009 at 4:40 PM

Which assembly is MultiScaleLayout.Graph located in?

Thank you

Aug 24, 2009 at 5:31 PM

There is no class by that name.  If you mean the HarelKorenFastMultiscaleLayout class, it does not have a Graph property.  If you mean the NodeXLControl class, which does have a Graph property, that class is in the Microsoft.NodeXL.Control.Wpf.dll assembly.

-- Tony

Aug 24, 2009 at 5:36 PM

By the way, if you need to know the assembly or namespace that contains a certain class, the NodeXLApi.chm help file will tell you that.  For example, the NodeXLControl Class topic in the help file includes this:

Namespace: Microsoft.NodeXL.Visualization.Wpf
Assembly: Microsoft.NodeXL.Control.Wpf (in Microsoft.NodeXL.Control.Wpf.dll)

-- Tony

Aug 25, 2009 at 3:10 PM

Thank you Tony.

The problem was how I was getting PowerBoots to generate the proxy wrapper PowerShell scripts.