DynamoDS/Dynamo — pull request #3007 by ke-yu (2014-11-07 06:46:45+00:00)
Title: Fix issue that converting nodes to custom node doesn't delete original node

This pull request is a partial fix for issue [MAGN-5128 GC: Turning nodes into custom node doesn't dispose objects created by nodes](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5128)

The problem is both in language engine and in Dynamo core. Language engine issue is tracked by defect [http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5353](http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5353)

For Dynamo core, the issues are
1. When converting nodes to custom node, these nodes are not deleted from home work space, but just simply are added to custom work space, therefore engine controller is not notified by ``NodeDeleted`` event, it won't generate sync data for these deleted nodes, and consequentially all geometries associated with these nodes won't be created.
2. As all selected nodes are reused in custom node, their Guids are not changed, therefore when they are compiled to AST node, all variables in the custom function literally are *global variables* instead of local variables in function scope. It may trigger update, and the result is unpredictable.

What we need to do is to fire ``NodeDeleted`` event, and assign a new Guid to these nodes.

@Benglin for you.