Available with Production Mapping license.
Summary
Enables or disables masking functionality on a data frame.
Discussion
EnableLayerMaskingperforms the same operation as opening the Advanced Drawing Options dialog box and checking or unchecking the Draw using masking options specified below check box.
Syntax
EnableLayerMasking (data_frame, use_masking)
Code sample
EnableLayerMasking example 1
This sample enables masking on a data frame.
import arcpy
import arcpyproduction
# Check out Production Mapping license
arcpy.CheckOutExtension("Foundation")
# Get reference to CURRENT mxd
mxd = arcpy.mapping.MapDocument('CURRENT')
# Get reference to active data frame
df = mxd.activeDataFrame
# Enable masking on the active data frame
arcpyproduction.mapping.EnableLayerMasking(df,'true')
# Check in Production Mapping license
arcpy.CheckInExtension("Foundation")
EnableLayerMasking example 2
This sample disables masking on a data frame.
import arcpy
import arcpyproduction
# Check out Production Mapping license
arcpy.CheckOutExtension("Foundation")
# Get reference to CURRENT mxd
mxd = arcpy.mapping.MapDocument('CURRENT')
# Get reference to active data frame
df = mxd.activeDataFrame
# Enable masking on the active data frame
arcpyproduction.mapping.EnableLayerMasking(df,'false')
# Check in Production Mapping license
arcpy.CheckInExtension("Foundation")