I am trying to add Python script as a tool in ArcMap 10.6. I have the result or outcop3 saved in the folder Outputs. I added a output folder in the parameter and made the direction as output but i am unable to find this Outputs folder when i click on the parent folder. All i can see is the main folder called "Test". Why is it so? I am adding the script i used here.

import arcpy
import os
import sys
from arcpy import env
from arcpy.sa import *
arcpy.env.overwriteOutput = True

Raster1 = arcpy.GetParameterAsText(0)
Outputs = arcpy.GetParameterAsText(4)
env.workspace = r"C:\Test"
arcpy.env.cellSize = "MINOF"
Raster1 = Raster("Raster_one")
outcop3 = Con(Raster4 == 1,2)

  • Is your C:\ drive on a shared network computer, such as one accessed via Citrix or RDP? If so, I've found that IT departments appear to sometimes hide the contents of certain drives, like the C:\ drive, to discourage people from poking around and creating folders like "Test" at the root of the C:\ drive. If you have another drive you can use elsewhere, it may be worth changing your workspace and output paths to somewhere else. – Zachary Ordo - GISP Jul 10 '20 at 15:00
  • Thanks it worked when i changed from C drive. But i am still getting an error like this with the script."ERROR 000875: Output raster: H:\Test\Output\outcon0805's workspace is an invalid output workspace" – Maya Aug 5 '20 at 10:39
  • Does your Output folder already exist? – Zachary Ordo - GISP Aug 12 '20 at 16:39
  • Yes i have already created the output folder and now i can find it in the parent folder. But the new problem is i want the output name to be decided by the user who runs the tool. How can this be done? – Maya Aug 12 '20 at 17:08
  • You would use the arcpy.GetParameterAsText() function. See desktop.arcgis.com/en/arcmap/10.3/analyze/creating-tools/… – Zachary Ordo - GISP Aug 12 '20 at 21:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.