Accessing the Selection

 
 
 

The Selection or Selection object is available from the XSIApplication or XSIApplication object via the XSIApplication.Selection or Application::GetSelection property:

// C++ API
Selection sel( Application.GetSelection() );

// C# 
CXSIApplication app = new CXSIApplication();
Selection sel = app.Selection;
Important

For JScript and VBScript, the XSIApplication object is implicit (meaning it doesn't need to be specified). For Python, you must use it explicitly:

// JScript -- these versions are both valid
var sel = Selection;
var sel = Application.Selection;

' VBScript -- these versions are both valid
set sel = Selection
set sel = Application.Selection

# Python -- only this syntax may be used
sel = Application.Selection

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License