GetCurrentLayer
 
 
 

GetCurrentLayer

Description

Gets the current layer.

Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference so you need to use the best workaround for your situation:

For scripting languages this command returns an ISIVTCollection which you can use to get the output arguments.

For C# you can use the XSIApplication.ExecuteCommand method to call this command. ExecuteCommand packs the output arguments into a C# System.Object containing an Array of the output arguments (see Calling Commands from C#).

Scripting Syntax

GetCurrentLayer( Value );

Parameters

Parameter Type Description
Value Layer Returns the current layer

Examples

VBScript Example

' Get initial settings
checkCurrLayer
' Make a new layer (it is *not* automatically set as current)
SICreateLayer , "LayerA",oLayer
checkCurrLayer
' Now explicitly set the new layer as current and check again
SetCurrentLayer oLayer
checkCurrLayer
' Make another new layer (it *is* automatically set as current)
CreateLayer , "LayerB",,oLayer
SetCurrentLayer oLayer
checkCurrLayer
function checkCurrLayer()
        ' What is the current layer?
        GetCurrentLayer oCurrLayer
        LogMessage "Current layer is....." & oCurrLayer
end function
'OUTPUT OF ABOVE SCRIPT IS:
'INFO : "Current layer is.....Layers.Layer_Default"
'INFO : "Current layer is.....Layers.Layer_Default"
'INFO : "Current layer is.....Layers.LayerA"
'INFO : "Current layer is.....Layers.LayerB"

See Also

GetCurrentPass