I have a geoprocessing tool that at the end exports points to a DWG-file, it's based on my own python script. It worked with ArcGIS Server 10.6.1, but when trying it with ArcGIS Enterprise 10.8.1 it doesn't work. I can run the tool in ArcMap and publish it succesfully to my server, but when running my geoprocessing service it fails and give me the error:
Error executing tool. Hojddata_till_DWG Job ID: jfcd1dee1b2364e73a10d9d90f4e5ef9b : Traceback (most recent call last): File "E:\arcgisserver\directories\arcgissystem\arcgisinput\Verktyg\Hojddata2dwg2.GPServer\extracted\v101\my_toolboxes\Export_Hojddata_to_DWG.py", line 24, in <module> arcpy.env.workspace = arcpy.arcpy.env.packageWorkspace.scratchFolder AttributeError: 'unicode' object has no attribute 'scratchFolder' Failed to execute (Hojddata2dwg). Failed to execute (Hojddata_till_DWG).
So I guess it has something with the scratchfolder to do, any ideas how to solve this?
The part of my python script that makes the dwg-export looks like this:
filename = "Hojdpunkter.dwg"
arcpy.ExportCAD_conversion(GridpointsZ, "DWG_R2010", filename)
outputFile = os.path.join(arcpy.env.scratchFolder, filename)
arcpy.SetParameterAsText(2, outputFile)
Has anything changed between 10.6.1. and 10.8.1 of ArcGIS Server when it comes to scratchFolders or geoprocessing outputs?
Or is it me that has forgot how to properly publish a geoprocessing tool? I have set the parameters and the third one to be 'output' and 'data file'.