创建逻辑示意图文件夹 (Schematics)

许可等级:BasicStandardAdvanced

摘要

在逻辑示意图数据集或逻辑示意图文件夹中创建逻辑示意图文件夹。

用法

语法

CreateSchematicFolder_schematics (out_location, out_name)
参数说明数据类型
out_location

要在其中创建文件夹的逻辑示意图数据集或逻辑示意图文件夹。此容器必须已经存在。

Schematic Dataset;Schematic Folder
out_name

输出逻辑示意图文件夹的名称。

String

代码实例

CreateSchematicFolder 示例(独立 Python 脚本)

在逻辑示意图数据集中创建逻辑示意图文件夹和子文件夹。

以下 Python 脚本示例的运行方法:

  1. 启动 ArcCatalog。
  2. 将以下脚本复制并粘贴到 Python 窗口。
  3. 按 ENTER 键。

# Name: CreateSchematicFolder.py
# Description: Create a schematic folder and subfolder
# Requirement: ArcGIS Schematics 扩展模块

# import system modules
import arcpy
msgNoLicenseAvailable = "ArcGIS Schematics 扩展模块 license required"

try:
    # Checks out the ArcGIS Schematics 扩展模块 licence
    if arcpy.CheckExtension("Schematics") == "Available":
        arcpy.CheckOutExtension("Schematics")
    else:
        raise Exception(msgNoLicenseAvailable)

    # Sets environnement settings
    arcpy.env.overwriteOutput = True
    arcpy.env.workspace = "C:\ArcGIS\ArcTutor\Schematics\Schematics_In_ArcMap\ElecDemo.gdb"

    # Creates a new schematic folder, MySchematicRootFolder, at the ElecDemo schematic dataset root.
    arcpy.CreateSchematicFolder_schematics("ElecDemo", "MySchematicRootFolder")

    # Creates a schematic subfolder, MySchematicSubFolder, in a schematic folder, MySchematicRootFolder.
    arcpy.CreateSchematicFolder_schematics("ElecDemo\MySchematicRootFolder", "MySchematicSubFolder")

    # Returns the ArcGIS Schematics 扩展模块 licence
    arcpy.CheckInExtension("Schematics")
   
    print "Script completed successfully"

except Exception as e:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    print "An error occured on line %i" % tb.tb_lineno
    print str(e)

环境

此工具不使用任何地理处理环境

相关主题

许可信息

ArcGIS for Desktop Basic:需要 Schematics
ArcGIS for Desktop Standard:需要 Schematics
ArcGIS for Desktop Advanced:需要 Schematics
9/15/2013