arcgis pro python和arcmap python的不同


ArcMap布局只能矩形,Pro可以是圆形,多边形的,ArcMap可以插入元素,Pro中地图不能插入元素,ArcGIS Pro可以在线更新

ArcMap字段计算器有VB,Pro没有,字段计算器没有VB语法,是PYTHON3,标注Pro有VB

pro字段是别名,print(),ArcMap是print 不加空格,

 

string.split(arcpy.GetParameterAsText(0), ";") 修改arcpy.GetParameterAsText(0).split(";")

 

pro中数据不放在汉字路径下,一个问题用了好几个小时

在pro中,不需要加 u"没有数据",源码前面一定#coding=utf8

在ArcMap中

try

 

except Exception, ErrorDesc:
#If an error set output boolean parameter "Error" to True.
arcpy.AddError(str(ErrorDesc))
是正确

 

 Pro中

  try

 except Exception as err:

    arcpy.AddError(str(err))
 

 ArcMap可以

mystr.decode('utf-8')

Pro不可以

pro中没有

arcpy.CreatePersonalGDB_management(os.path.dirname(out_mdb),os.path.basename(out_mdb))
文件地理数据库10.0和Pro是兼容的

 ArcMap是默认是绝对路径,Pro是相对路径

=========================

在ArcMap中可以

unicode(titlestr)
pro不需要
===================================
arcmap中
filepath+"/Band_1"
pro中
filepath+"/Layer_1"
===========================
ArcMap中arcpy.mapping.MapDocument("CURRENT")修改pro中arcpy.mp.ArcGISProject("CURRENT")
arcpy.mapping修改arcpy.mp
===================================
Pro中增加图层
mxd = arcpy.mp.ArcGISProject("CURRENT")

df = mxd.listMaps()[0]
addLayer = df.addDataFromPath(outFeature)
df.addLayer(addLayer)
Map
 

mxd = arcpy.mapping.MapDocument("CURRENT")
df = arcpy.mapping.ListDataFrames(mxd)[0]

addLayer = arcpy.mapping.Layer(outFeature)
arcpy.mapping.AddLayer(df, addLayer, "AUTO_ARRANGE")

=============================================

arcmap 

string.atof           pro中float
=================================
ArcMap是
arcpy.ConstructSightLines_3d
Pro
 
arcpy.ddd.ConstructSightLines
========================================
arcmap string.find(toolbox,"(") pro修改toolbox.find(toolbox,"(")
==================================
ArcMap
try:

main()

except Exception as e:
arcpy.AddError(e.message)
pro
 
try:

main()

except Exception as e:
arcpy.AddError(e)
======================================
Pro没有arcpy.RefreshActiveView()
 
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM