Skip to content

AspBlockAttachedEventArgs.AspBlock

property · AspBlockAttachedEventArgs · cAlgo.API

DesktopCLICloud

Attached block.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

public AspBlock AspBlock {get;}
aspBlockAttachedEventArgs.AspBlock: AspBlock

Returns AspBlock

Examples

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);
}
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}")