I found a node in view but the Document of node is null.
Cause is can’t remove it.
Help me to remove the node.
Just call GoObject.Remove().
You must have added that node to a view layer rather than to a document layer. View objects are not selectable by the user using the normal mechanisms.
I tried, but it’s still there.
Are you sure that the node that you see is in fact the node for which you have a reference?
You can iterate over all of the GoView.Layers and see how many objects there are in each layer. You can also see for each layer whether it belongs to the GoView or to its GoDocument.
I found the node in Document and DefaultLayer.
its IsInDocument and IsInView are false.
If I select the node, there will be a messagebox “Selected object must belong to the view or its document”.
Cause of the problem is deleting some nodes, undoing, deleting these nodes
Are these top-level nodes? What class do they inherit from? Which GoObject and GoGroup methods have you overridden, if any? If you have overridden GoObject.ChangeValue, do you always call the base method for all predefined subhint cases (i.e. not cases you have defined for state that you have added in your class)?
I have resolved this problem.
Cause of this problem is deleting node, which its BeingRemoved equals true.