MapDocument.selectedLayer

Indicates the currently selected layer

class MapDocument
int selectedLayer;

Meta