protected override Result RunCommand(RhinoDoc doc, RunMode mode)
    {
      var instance_definitions = doc.InstanceDefinitions;
      var instance_definition_count = instance_definitions.Count;

      if (instance_definition_count == 0)
      {
        RhinoApp.WriteLine("Document contains no instance definitions.");
        return Result.Nothing;
      }

      var dump = new TextLog();
      dump.IndentSize = 4;

      for (int i = 0; i < instance_definition_count; i++)
        DumpInstanceDefinition(instance_definitions[i], ref dump, true);

      RhinoApp.WriteLine(dump.ToString());

      return Result.Success;
    }
    public static Result InstanceDefinitionTree(RhinoDoc doc)
    {
        var instance_definitions = doc.InstanceDefinitions;
        var instance_definition_count = instance_definitions.Count;

        if (instance_definition_count == 0)
        {
          RhinoApp.WriteLine("Document contains no instance definitions.");
          return Result.Nothing;
        }

        var dump = new TextLog();
        dump.IndentSize = 4;

        for (int i = 0; i < instance_definition_count; i++)
          DumpInstanceDefinition(instance_definitions[i], ref dump, true);

        RhinoApp.WriteLine(dump.ToString());

        return Result.Success;
    }