{"action":"created","issue":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4216","labels_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4216/labels{/name}","comments_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4216/comments","events_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4216/events","html_url":"https://github.com/DynamoDS/Dynamo/pull/4216","id":67502982,"number":4216,"title":"Basic implementation of node to code","user":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-10T03:56:45Z","updated_at":"2015-04-10T06:24:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/pulls/4216","html_url":"https://github.com/DynamoDS/Dynamo/pull/4216","diff_url":"https://github.com/DynamoDS/Dynamo/pull/4216.diff","patch_url":"https://github.com/DynamoDS/Dynamo/pull/4216.patch"},"body":"This pull request re-enables [node to code] (http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-6768) command and enhances the original implementation. Note the implementation is not complete yet.  \r\n\r\n* **What are done in this pull request?**\r\n  1. Node to code command is re-enabled in the context menu of a selection\r\n![1](https://cloud.githubusercontent.com/assets/2600379/7081485/6fe3e1bc-df75-11e4-98ce-808fe13961e4.png)\r\n  2. No more long and mysterious variable names in generated code\r\n![2](https://cloud.githubusercontent.com/assets/2600379/7081548/65927704-df76-11e4-9400-68e62a68f38a.png)\r\n  3. Conflicting variables will be renamed in the generated code block node\r\n![3](https://cloud.githubusercontent.com/assets/2600379/7081567/bd5f99da-df76-11e4-9790-f3730f609063.png)\r\n* **What haven't been done in this pull request?**\r\n  1. Custom node, partial applied function and UI nodes can't be converted to code. The reasons are, for custom node, as it will compiled to mysterious name like \"``__func__6BBA4B28C5E54CF89F300D510499A00E``\", it is hard to figure out what's custom node that it represents for. Partial applied function will be compiled to ``__SingleFunctionObject`` which is mysterious for most users and UI nodes are not compiled to a direct function. But we'll fix these issues in the following sprint. \r\n  2. We only generate 1 code block node. That means, if there are some non-convertible nodes in the selected node, we may introduce circular reference. For example: \r\n![4](https://cloud.githubusercontent.com/assets/2600379/7081631/efd7f280-df77-11e4-8d21-3f18d03a13b0.png)\r\nBut note it is just initial implementation of node to code. We could either generate multiple code block nodes or make more nodes be convertible (see 1). \r\n* **What's the scope of impact?**\r\n  1. It is self-contained functionality, so shouldn't have impact on the existing ones. Most implementation is in `Dynamo.DSEngine.NodeToCodeUtils`.\r\n\r\n@Benglin please help to review the change. Thanks. "},"comment":{"url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/comments/91448000","html_url":"https://github.com/DynamoDS/Dynamo/pull/4216#issuecomment-91448000","issue_url":"https://api.github.com/repos/DynamoDS/Dynamo/issues/4216","id":91448000,"user":{"login":"ke-yu","id":2600379,"avatar_url":"https://avatars.githubusercontent.com/u/2600379?v=3","gravatar_id":"","url":"https://api.github.com/users/ke-yu","html_url":"https://github.com/ke-yu","followers_url":"https://api.github.com/users/ke-yu/followers","following_url":"https://api.github.com/users/ke-yu/following{/other_user}","gists_url":"https://api.github.com/users/ke-yu/gists{/gist_id}","starred_url":"https://api.github.com/users/ke-yu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ke-yu/subscriptions","organizations_url":"https://api.github.com/users/ke-yu/orgs","repos_url":"https://api.github.com/users/ke-yu/repos","events_url":"https://api.github.com/users/ke-yu/events{/privacy}","received_events_url":"https://api.github.com/users/ke-yu/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T06:24:20Z","updated_at":"2015-04-10T06:24:20Z","body":"@andydandy74 wow, thanks! This would take a while to get enabled in daily build, but looking forward to hearing your feedback! "}}