# GH_CodeBlock 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_CodeBlock
```

Represents a collection of lines of code in the GH_ScriptEditor window.

## Constructors

- [GH_CodeBlock](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblock/ctor.md): (3 overloads)

## Properties

- [Lines](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblock/lines.md): Gets or sets the line of code.
- [ReadOnly](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblock/readonly.md): Gets or sets the readonly state of the code.

## Methods

- [AddLine](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblock/addline.md)
- [AddLines](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblock/addlines.md)
- [ToString](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.script.gh-codeblock/tostring.md)
