摘要
Adds a file to a Product Library. This associates the file with a Product Library entry. Once you have added a file to a product library, use Check Out File and Check In File to manage changes made to it.
产品库存储着在地理数据库中进行制图和数字数据生产时所需的信息和数据。Esri Mapping and Charting solutions 在产品库内存储业务规则、文档和空间信息。
用法
产品库工作空间必须是地理数据库。
产品库文件路径为特殊“产品库”树节点的路径。此产品库路径为采用以下格式的双冒号分隔的字符串 (::):解决方案名称::产品类名称::系列名称::产品名称::实例名称::AOI 名称。
要确定产品库路径,导航到产品库窗口中的项目,右键单击它,然后选择复制为路径。该产品库路径将被放置到剪贴板中。您可以将其粘贴到需要产品库路径的任何参数中。
This tool will not overwrite existing files in Product Library File Path. The tool will return ERROR 90102: File already exists if it finds an existing file with the same name as the file to add in Product Library File Path.
语法
PLAddFile(product_library_workspace, product_library_itempath, filepath, {checkin_comments}, {product_library_ownername})
参数 | 说明 | 数据类型 |
product_library_workspace | 产品库工作空间的路径。 | Workspace |
product_library_itempath | 项目的产品库路径。按照以下格式指定路径:解决方案名称::产品类名称::系列名称::产品名称::实例名称::AOI 名称::文件名称。 | String |
filepath | Path to the file that is going to be added to the product library. | File |
checkin_comments (可选) | 与签入相关联的注释。 | String |
product_library_ownername (可选) | 产品库方案所有者名称。如果 product_library_workspace 中指定的用户帐户不是方案所有者,请设置此参数。这仅适用于存储在企业级地理数据库中的产品库。 | String |
代码示例
PLAddFile example (Python window)
The following Python window script demonstrates how to use the PLAddFile tool.
# Name: PLAddFile_Example.py
# Description: Adds a file to a Product Library
# Requirements: Production Mapping extension
# import arcpy and checkout a Production Mapping license
import arcpy
arcpy.CheckOutExtension("foundation")
# Product library and item path variables
product_library_workspace = "C:\\Data\\ProductLibrary.gdb"
product_library_itempath = "Products::NewSolution::NewClass::NewSeries"
# path to an existing file
file_path = "c:\\data\\script.py"
# execute the Add File tool
try:
res = arcpy.PLAddFile_production(product_library_workspace, product_library_itempath,file_path)
print res.getMessages()
except Exception, e:
print e.message
print "Script completed successfully."
环境
许可信息
- ArcGIS Desktop Basic: 否
- ArcGIS Desktop Standard: 需要 Production Mapping
- ArcGIS Desktop Advanced: 需要 Production Mapping