I want to access the file path inside the toolbox directory path, so I need to access the directory path of the toolbox. Please let me know how I would get it using ArcPy.
from arcpy mapping, the project has a "defaultToolbox" property which you can get or set
ArcGISProject—ArcGIS Pro | Documentation
defaultToolbox(Read and Write)The project's default toolbox location. The string must include the toolbox's full path and file name.
code examples are at the bottom of the help topic
https://desktop.arcgis.com/en/arcmap/latest/analyze/python/adding-and-removing-toolboxes.htm
Not sure if this will help.
But this will only give me the path of the toolbox associated with project only. I need to access the path of other toolbox path that has been added to the same project.
Use the ListToolboxes method in the project class
No luck over there either
arcgis pro - How to get the directory path of the toolbox in ArcPy? - Geographic Information Systems Stack Exchange
so you might want to try a different approach if your toolboxes are stored in a common location
Solved: How to list all Toolboxes names in a specific fold... - Esri Community
Maybe this will get you closer to what you're looking for?https://stackoverflow.com/questions/3430372/how-do-i-get-the-full-path-of-the-current-files-directory
The solution using os works within a python toolbox added to a Pro (version 3.1.2) project.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.