我是arcgis pro 3.0.3桌面,想分享一个工具箱,里面包含了一个python脚本工具,是我和同事一起创建的。在我的电脑上,我能够打开,运行和利用这个工具没有任何问题。当我共享工具箱时,我的同事可以将工具箱添加到他的地图项目中,并打开它,但在运行它时得到一个无法打开工具箱的错误。监测地块生成器1 =====================参数边界层woodland_18048_ExportFeature1林地ID 18048边界英亩144中间输出地理数据库c:\ users \ btroxl \ onedrive -美国森林基金会\Documents - FAMILY Forest CARBON PROGRAM\地理空间库\_MRV跨区域\Python脚本\test_properties\scratch。gdb C:\Users\btroxel\OneDrive - American Forest Foundation\Documents - FAMILY Forest CARBON PROGRAM\Geospatial Library\_MRV cross-regional\Python Scripts\test_properties\test_properties。gdb最终地块投影GEOGCS["GCS_Assumed_Geographic_1",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] ===================== MessagesStart时间:2023年1月4日星期三12:20:06 PM文件“C:\Users\btroxel\OneDrive - American Forest Foundation\Documents - FAMILY Forest CARBON PROGRAM\Geospatial Library\_MRV cross-regional\Plot_generator\MRV.atbx#MonitoringPlotsGenerator1_MRV.py”,第23行,在
文件“C:\ PROGRAM Files\ArcGIS\Pro\Resources\ArcPy\ ArcPy\ __init__.py”,第171行,在ImportToolbox返回import_toolbox(input_file, module_name)文件“C:\ PROGRAM Files\ArcGIS\Pro\Resources\ArcPy\ ArcPy\ toolbox_code.py”,第486行,在import_toolbox toolbox = gp。createObject("Toolbox", tbxfile)文件"C:\Program Files\ArcGIS\Pro\Resources\ArcPy\ ArcPy\ geoprocessing\_base.py",行389,在createObject self._gp. py中。CreateObject(*gp_fixargs(args, True))) OSError:工具箱文件C:\Users\btroxel\American Forest Foundation\FAMILY Forest CARBON PROGRAM - Documents\Geospatial Library\_MRV跨区域\Plot_generator\MRV。没有找到Atbx。脚本失败(null)…日志含义执行失败(MonitoringPlotsGenerator1)。失败于2023年1月4日星期三12:20:06 PM(运行时间:0.23秒)请随意下载包含python脚本和工具箱的文件夹。 The screenshot also shows that the toolbox does exist on his computer. I will try to summarize the tool as best as I can. The MRV plots generator was created to randomly generate between 9-11 plots/points within a boundary that can be of any shape or size (can also be a multi-part polygon). It will take into account the acreage of the boundary and mathematically calculate the initial spacing of the points to try to get to the right number of plots. To further randomize, it will shift and rotate the points by some random amount/angle. It works great on my computer, but I need to be able to share it! It has some hacky python scripting because I am a novice at this, but I tried to put in a comments to help describe the process. The mesh points creation, the rotation and shifting of the points is all using tools developed by @DanPatterson_Retired which were huge in making this tool possible. Toolbox has an alias, so I know that isn't the issue. The line that brings in the toolbox is arcpy.ImportToolbox( r"{}\American Forest Foundation\FAMILY FOREST CARBON PROGRAM - Documents\Geospatial Library\_MRV cross-regional\Plot_generator\MRV.atbx".format(os.path.expanduser('~'))) I have the expand user bit in there because it is saved on OneDrive and the start of the pathname changes based on the user. This is where I am guessing the problem lies, but I am lost on how to fix it. Any assistance is appreciated, thank you!
…查看更多