# InsertBlockNode(int, BlockNode)

> Inserts an existing BlockNode at the specified index in this context node.

## Definition

* **Type:** Method
* **Namespace:** [Unity.GraphToolkit.Editor](/engine/6000.6/script-reference/unity/graphtoolkit/editor.md)
* **Assembly:** UnityEditor

```csharp
public void InsertBlockNode(int index, BlockNode blockNode)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The zero-based index where to insert the block node.**** (\[BlockNode]\(/engine/6000.6/script-reference/unity/graphtoolkit/editor/blocknode)): The [BlockNode](/engine/6000.6/script-reference/unity/graphtoolkit/editor/blocknode.md) to insert.

### Remarks

Use this method when you have an existing block node instance that you want to add to the context at a specific position. Consider using [ContextNode.CreateBlockNode](/engine/6000.6/script-reference/unity/graphtoolkit/editor/contextnode/createblocknode.md) to create and add a new block node, or [ContextNode.AddBlockNode](/engine/6000.6/script-reference/unity/graphtoolkit/editor/contextnode/addblocknode.md) to append the block at the end. Blocks are ordered vertically: index 0 is the topmost block, and higher indices go toward the bottom. When `index` is less than 0 or equal to the current block count, the block is added at the bottom. When the block node already belongs to another context node, it is removed from that context and added to this one. Throws ArgumentException when `index` is greater than the current block count.
