Macros to Control Layers

 
  • These are a set of simple macros that I have used for a long time (to avoid going in and out - and scrolling around - either the Layer dialog box or the drop-down box in the Layer Toolbox) and assigned to hotkeys as follows:
    • Ctrl+Shift+L - Set Layer     This allows a single layer number to be entered making that the current layer and hiding all others.  Useful when you want to suddenly focus on one layer.  
    • Ctrl+Shift+V - ShowLayer [V for Visibility!]     This doesn't alter the Current layer but shows (or hides if already visible) any number of layers that you enter.  Particularly useful when the layers you want to show or hide are either many and/or numerically far away from the Current layer (lots of scrolling avoided) 
    • Ctrl+Shift+C - ChangeCurrentLayer     This makes the layer the user enters the Current layer (displaying it if it was hidden) but doesn't alter the visibility of any other layers 
    • Ctrl+Shift+M - MultiLayerEdit     This toggles the multi-layer editing function

    Submitted by: Andrew Sanderson

Files to Download:

SetLayer.bsc

ChangeCurrentLayer.bsc

ShowLayer.bsc

MultiLayerEdit.bsc

' This macro asks the user for the number of a layer and then
' makes that layer the current layer and hides all the others

' written by Andrew Sanderson and last update 12 Nov 03

>2DSelectMode
{
}
ask:
input "Enter the number of the required layer or enter 0 to exit", NumLayer

if NumLayer = 0 then end

layer(NumLayer) = 14

for i = 0 to (NumLayer - 1)
layer(i) = 0
next i

for i = (NumLayer + 1) to 255
layer (i) = 0
next i

>Regenerate
{
}
' This macro asks the user for the number of a layer and then
' makes that layer visible without changing the Current Layer

' Layer values are (supposed to be):
' 0 – Invisible and not editable
' 2 – Visible but not editable
' 6 – Visible and editable
' 14 – Set as current layer

' sys(26) contains either 1 or 0 to indicate whether the current layer should
' be the only editable one or not.

' written by Andrew Sanderson and last update 12 Nov 03

>2DSelectMode
{
}

if sys(26) = 1 then
Visible = 2
else
Visible = 6
endif

ask:
input "Enter layer to show or hide or enter 0 to end", NumLayer

if NumLayer = 0 then goto finish 'we do not risk using this layer!

if layer(NumLayer) < 2 then
layer(Numlayer) = Visible
else
if layer(NumLayer) >13 then
message "Cannot hide the Current Layer"
goto ask
else
layer(Numlayer) = 0
endif
endif

goto ask

finish:
>Regenerate
{
}
' This macro asks the user for the number of a layer and then
' makes that layer the current layer

'written by Andrew Sanderson and last updated 12 Nov 03

>2DSelectMode
{
}
ask:
input "Enter the number of the layer to be made Current", NumLayer
if NumLayer = 0 then goto ask

layer (sys(3)) = 6

layer(NumLayer) = 14

>Regenerate
{
}
' This macro enables or disables multi layer editing

' sys(26) contains either 1 or 0 to indicate whether the current layer should
' be the only editable one or not.

' written by Andrew Sanderson and last updated 12 Nov 03

>2DSelectMode
{
}

if sys(26) = 1 then
sys(26) = 0
message "Multi-layer editing ENABLED"
else
sys(26) = 1
message "Multi-layer editing DISABLED"
endif

Files to Download:

SetLayer.bsc

ChangeCurrentLayer.bsc

ShowLayer.bsc

MultiLayerEdit.bsc