EnableLayerMasking (arcpyproduction.mapping)

摘要

Enables or disables masking functionality on a data frame.

讨论

EnableLayerMasking performs the same operation as opening the Advanced Drawing Options dialog box and checking or unchecking the Draw using masking options specified below check box.

语法

EnableLayerMasking (data_frame, use_masking)
参数说明数据类型
data_frame

The DataFrame object that will have masking enabled or disabled.

DataFrame
use_masking

Controls whether masking is enabled or disabled for the DataFrame object.

(默认值为 None)

Boolean

代码实例

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")

相关主题

4/27/2014