mxd = arcpy.mapping.MapDocument("Current") df = arcpy.mapping.ListDataFrames(mxd)[0] fc = "Parcels" field = "StateName" cursor = arcpy.SearchCursor(fc) for row in cursor: val = row.getValue(field) arcpy.CreateFolder_management("C:\\"+ "\\" + Str(val) + "\\") Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 14477, in CreateFolder raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000735: Folder Name: Value is required Failed to execute (CreateFolder).
Solved! Go to Solution.
arcpy.CreateFolder_management("C:\\", str(val))
arcpy.CreateFolder_management("C:\\{0}".format(val)
>>> mxd = arcpy.mapping.MapDocument("Current") >>> df = arcpy.mapping.ListDataFrames(mxd)[0] >>> fc = "Parcels" >>> field = "StateName" >>> cursor = arcpy.SearchCursor(fc) >>> for row in cursor: ... val = row.getValue(field) ... >>> arcpy.CreateFolder_management("C:\\{0}".format(val)) Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 14477, in CreateFolder raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000735: Folder Name: Value is required Failed to execute (CreateFolder).
arcpy.CreateFolder_management("C:\\", str(val))
fc = "Parcels" field = "OBJECTID" field1 = "Plot_No" field2 = "Block_No" field3 = "Name_Allottee" field4 = "TDP_Status" field5 = "LGA" field6 = "District" field7 = "Shape.STLength()" field8 = "SitePlan_Status" cursor = arcpy.SearchCursor(fc) for row in cursor: #row.getValue(field) val = row.getValue(field) val1 = row.getValue(field1) val2 = row.getValue(field2) val3 = row.getValue(field3) val4 = row.getValue(field4) val5 = row.getValue(field5) val6 = row.getValue(field6) val7 = row.getValue(field7) val8 = row.getValue(field8) outName = str(val5) + "_LGA" + "(" + str(val6) + "_Area" + ")" outName1 = "Plot_" + str(val1) + "(" "Block_" + str(val2) + ")" outName2 = str(val3) + " Block_" + str(val2) + "_Plot_" + str(val1) + "_" + str(val6) + "_Area_of_" + str(val5) + "_LGA" + ".pdf" arcpy.CreateFolder_management("C:\\", str(val),outName) arcpy.CreateFolder_management("C:\\", str(val)+ outName,outName1) arcpy.mapping.ExportToPDF(mxd,r"C:\\", str(val) + outName + "\\" + outName1 + "\\" + "Land Granted To " + outName2) os.startfile(r"C:\\", str(val) + outName + "\\" + outName1 + "\\" + "Land Granted To " + outName2)