# GH_CodeBlocks class

Namespace: [Grasshopper.GUI.Script](https://developer.rhino3d.com/api/gh1/namespace/grasshopper.gui.script.md) · Assembly: [Grasshopper](https://developer.rhino3d.com/api/gh1/assembly/grasshopper.md)

```cs
public class GH_CodeBlocks : List<GH_CodeBlock>
```

Represents a list of source code blocks in a GH_ScriptEditor window.

## Methods

- [Add](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblocks/add.md): (2 overloads)
- [GetAllLines](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblocks/getalllines.md): Convert all blocks to a single array of lines and readonly flags.
- [GetMutableCodeBlock](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblocks/getmutablecodeblock.md): Get all the lines that belong to the Nth mutable code block.
- [MergeConsecutiveBlocks](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblocks/mergeconsecutiveblocks.md): Merge all consecutive blocks with identical readonly flags.
- [StringSplit](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblocks/stringsplit.md): (static) String split utility class.
