Engine中执行Calculate Field工具,报错

ArcMap中可以执行成功,Engine中使用同样参数执行报错。
已邀请:

朱新颖

赞同来自:

【解决办法】:
通过try catch捕捉该GP工具出错的详细信息为:“ERROR 001386:The VB option is not valid with the engine install” 经查找Calculate Field工具的expression_type 参数默认设置为VB,Engine中不支持,导致报错,可以使用PYTHON或PYTHON_9.3。
参见链接:http://resources.arcgis.com/en ... 01386 
链接中说明:
VB is not a supported option for the Calculate Field tool with ArcGIS Engine. 
Solution 
Change the Expression Type parameter for the Calculate Field tool to PYTHON or PYTHON_9.3. 

例如:赋字符串可以写为如下表达式: 
calculateField.expression = ''ss''; 
calculateField.expression_type = PYTHON_9.3;

要回复问题请先登录注册