Defined a Parameter as data type folder and put in c:\Temp1 which results in this error message?
File "R:\Karto\zGIS\Projekte\MaP_FFH_Richtlinie_Toolentwicklung\python\FangenSymDiff.py", line 50, in <module>
arcpy.FeatureClassToShapefile_conversion(Aenderung_MToS, Aenderung_MToS_CopyFeatures)
File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\conversion.py", line 2550, in FeatureClassToShapefile
raise e
ExecuteError: Fehler bei Ausführung. Parameter sind ungültig.
ERROR 000840: Der Wert ist kein(e) Ordner.
Fehler beim Ausführen von (FeatureClassToShapefile).
Solved! Go to Solution.
I never assume and always convert path selections
aPath = aPath.replace("\\",:/")
when I select aPath from a tool within Arctoolbox...just incorporate within your script
"c:\temp1"
must be written in raw format
r"c:\temp1"
with double backslashes
"c:\\temp1"
or with forward slashes
"c:/temp1"
of course this assumes you have a folder of this name in the first place
Hi Dan,
the script is used in the toolbox Folder as Parameter (Folder Data Type) - so the input there sould be right?
I never assume and always convert path selections
aPath = aPath.replace("\\",:/")
when I select aPath from a tool within Arctoolbox...just incorporate within your script
ok, why .replace("\\",:/")?
Isn't it old, new?
in python the backslash is used as a literal...meaning if you want a backslash you have to preceed the backslash you want with another one (check python documentation), so the expression I gave you means "replace the backslash with a forward slash"
It is disconcerting because if there is no corresponding escape sequence, the string is passed along unmodified. The escape sequences are case sensitive, just to add to the confusion.
>>> print "C:\TEMP C:\temp"
C:\TEMP C: emp
Here's the help page I always refer people to:
ArcGIS Help 10.2 - Paths explained: Absolute, relative, UNC, and URL
Dan, did you mean:
aPath = aPath.replace("\\","/")
Personally, I always use one of the following methods and don't have any trouble anymore
1. put an r in front of the path and it will be interpreted literally.
path = r"C:\Temp1"
2. os.path.join() is great also, especially for constructing dynamic paths because you can pass variables as arguments. Also good if cross platform considerations are an issue
path = os.path.join("C:","Temp1")
3. also good for dynamic paths, because you can through variables in for the directory names:
path = r"{0}\{1}".format("C:","Temp1")
4. finally, it's not very concise, but you can always use os.sep
path = "C:" +os.sep+"Temp1"
Hope this is helpful!
Very helpful, thanks.
To tell you the truth, there was no path problem, I used two times one input parameter 🙂