---
id: "P:cAlgo.API.AspBlockAttachedEventArgs.AspBlock"
kind: "property"
type: "T:cAlgo.API.AspBlockAttachedEventArgs"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/AspBlockAttachedEventArgs/AspBlock/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# AspBlockAttachedEventArgs.AspBlock

Member of [AspBlockAttachedEventArgs](https://help.ctrader.com/ctrader-algo/references/EventArgs/AspBlockAttachedEventArgs/index.md).

## AspBlock

Attached block.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

C#:

```csharp
public AspBlock AspBlock {get;}
```

Python:

```python
aspBlockAttachedEventArgs.AspBlock: AspBlock
```

### Returns

`AspBlock` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    var block = Asp.SymbolTab.AddBlock("My Block");
    block.Attached += OnBlockAttached;
}

private void OnBlockAttached(AspBlockAttachedEventArgs args)
{
    Print("Block {0} attached: {1}, index: {2}", args.AspBlock.Id, args.AspBlock.IsAttached, args.AspBlock.Index);
}
```

Python:

```python
def on_start(self):
    block = api.Asp.SymbolTab.AddBlock("My Block")
    block.Attached += self.on_block_attached

def on_block_attached(self, args):
    api.Print(f"Block {args.AspBlock.Id} attached: {args.AspBlock.IsAttached}, index: {args.AspBlock.Index}")
```

