I am new to Python. I created a Python Toolbox - Tool Properties, I cannot change the Name, Label, and the Store Relative Pathnames is grayed out. How do I enable to these features?
Solved! Go to Solution.
Sorry! I was referring to the How To: Batch export attachments from a feature class you are following. I suggest not creating a Python toolbox and create a Custom one instead. Here are the instructions for that: Creating a toolbox.
Just to be sure... you are following the logic and process described in the help files beginning here...
I am using ArcGIS 10.2.2, and have never used Python before. I am using NotePad++ as my editor. The script was copied from here: How To: Batch export attachments from a feature class and savedas a .py file using Notepad.
I followed the instructions for Creating a new Python Toolbox, all I need to do is make sure the box next to "Store Relative Paths" is checked. But, when I right click on Tool under the Toolbox.pyt and go to Properties, the "Store Relative Path Names" is grayed out. How do I get this so it is not grayed out and I can add a check in the box next to it.
I am totally new to Python.
I think the directions in the article you link to are for a custom toolbox (right-click New>Toolbox) instead of a Python Toolbox. Try with a custom toolbox and then follow steps 2 -6 in the article.
I only see 3 steps in article:Creating a new Python toolbox—Help | ArcGIS for Desktop
Sorry! I was referring to the How To: Batch export attachments from a feature class you are following. I suggest not creating a Python toolbox and create a Custom one instead. Here are the instructions for that: Creating a toolbox.
It worked! I was able to extract the attached photos on my local drive. THANKS!
One more thing, the photo attachments download, but their names include the Attachment ID at the front, like this:
ATT3_CIP Photographs_-1_0_ArcGISApp_1475269645362.jpg
Any idea how to auto-remove the "ATT3_" from the photo file name automatically?
I know I could do a Field Calculate on the Photo_ATTACH Table and add the "ATT3_" before each Photo. But is there a better way?
The script generates this filename here.
filenum = "ATT" + str(item[2]) + "_"
filename = filenum + str(item[1])
This is how I'd do it (equivalent to the above). 0 and 1 format indexes are used to flip the order (put the first argument second).
filename = "ATT{1}_{0}".format(item[1], item[2])
You could modify your script tool to set up a filename just how you want it.
Hope this helps!
I want to remove the "ATT_1" etc... all together. Do not want to have any filename added, just want to use the original file names with nothing added a prefix or suffix via the script tool. How can this be done?