ArcGIS for Desktop

  • ドキュメント
  • 価格
  • サポート

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS for Desktop

完全なプロ仕様の GIS

ArcGIS for Server

エンタープライズ GIS

ArcGIS for Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • 価格
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

Help

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • その他...

MoveLayer

  • サマリ
  • 説明
  • 構文
  • コードのサンプル

サマリ

Provides the ability to move a layer to a specific location within a data frame or group layer in a map document (.mxd).

説明

MoveLayer will move a layer within a data frame and also within group layers in the same data frame. The moved_layer and reference_layer must reside within the same data frame. A layer cannot be moved from one data frame to a different data frame even within the same map document. Add_Layer, Insert_Layer, and RemoveLayer functions can be used to accomplish this requirement.

構文

MoveLayer (data_frame, reference_layer, move_layer, {insert_position})
パラメータ説明データ タイプ
data_frame

A reference to a DataFrame object within which the layer will be moved.

DataFrame
reference_layer

A reference to a Layer object representing an existing layer that determines the location in relation to where the layer will be moved.

Layer
move_layer

A reference to a Layer object representing the layer to be moved.

Layer
insert_position

A constant that determines the placement of the moved layer relative to the referenced layer.

  • AFTER —Inserts the new layer after or below the referenced layer
  • BEFORE —Inserts the new layer before or above the referenced layer

(デフォルト値は次のとおりです BEFORE)

String

コードのサンプル

MoveLayer example:

The following script will move a layer called Rivers above a reference layer called Lakes. Both layers are in a data frame called County Maps.

import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\Project\Project.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "County Maps")[0]
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
    if lyr.name.lower() == "rivers":
        moveLayer = lyr
    if lyr.name.lower() == "lakes":
        refLayer = lyr
arcpy.mapping.MoveLayer(df, refLayer, moveLayer, "BEFORE")
mxd.saveACopy(r"C:\Project\Project2.mxd")
del mxd
このトピックへのフィードバック

ArcGIS for Desktop

  • ホーム
  • ドキュメント
  • 価格
  • サポート

ArcGIS プラットフォーム

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • スタッフ ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | プライバシー | リーガル