我是arcgis pro 3.0.3桌面,想要分享一个工具箱,其中包含一个python脚本工具,我与同事创建。在我的电脑上,我可以毫无问题地打开、运行和使用这个工具。当我共享工具箱时,我的同事可以将工具箱添加到他的地图项目中,并打开它,但在他运行工具箱时得到一个无法打开工具箱的错误。监控地块生成器1 ===================== parameters边界层woodland_18048_ExportFeature1林地ID 18048边界英亩144中间输出地理数据库c:\用户\btroxel\ onedrive -美国森林基金会\文档- FAMILY Forest CARBON PROGRAM\地理空间库\_MRV跨区域\Python脚本\test_properties\scratch。gdb最终Plot保存gdb C:\Users\btroxel\OneDrive -美国森林基金会\文档- FAMILY Forest CARBON PROGRAM\地理空间库\_MRV跨区域\Python脚本\test_properties\test_propertiesgdb最终Plot投影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 Time:周三,1月4日,2023 12:20:06 PM Traceback(最近一次调用):文件“C:\Users\btroxel\OneDrive - American Forest Foundation\Documents - FAMILY Forest CARBON PROGRAM\Geospatial Library\_MRV跨区域\Plot_generator\ mrv .atbx#MonitoringPlotsGenerator1_MRV.py”,第23行,在<模块>文件“C:\ PROGRAM Files\ArcGIS\Pro\Resources\ArcPy\ ArcPy\ __init__.py”,第171行,在ImportToolbox return import_toolbox(input_file, module_name)文件“C:\ PROGRAM Files\ArcGIS\Pro\Resources\ArcPy\ ArcPy\ toolbox_code.py”,第486行,在import_toolbox工具箱= gp工具箱。createObject("Toolbox", tbxfile)文件"C:\Program Files\ArcGIS\Pro\Resources\ArcPy\ ArcPy\ geoprocessing\_base.py",第389行,在createObject self._gp。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)。Failed at星期三,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!
...查看更多