title: How to render a block in Blockly?
body: <p>I went through the <code>Workspace</code> documentation and have attempted to use the <code>newBlock</code> method like so: </p>
  
  <p><code>var block = workspace.newBlock("string_length")</code> to add a custom block which is defined like this:</p>
  
  <pre><code>Blockly.Blocks['string_length'] = {
    init: function() {
      this.jsonInit({
        "message0": 'length of %1',
        "args0": [
          {
            "type": "input_value",
            "name": "VALUE",
            "check": "String"
          }
        ],
        "output": "Number",
        "colour": 160,
        "tooltip": "Returns number of letters in the provided text.",
        "helpUrl": "http://www.w3schools.com/jsref/jsref_length_string.asp"
      });
    }
  };
  </code></pre>
  
  <p>Blockly tends to throw an exception when a block prototype name is not recognized but it seems to recognize it and assign its unique id and other information.</p>
  
  <p>The block turned out not to be visible even after attempting to add it to topblocks.</p>