arcpy.SelectLayerByLocation_management("Parcels", "COMPLETELY_WITHIN", "ClipFeature", "", "NEW_SELECTION") fc = "Parcels" field = "LGA" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) val = row.getValue(field) field = "District" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) val1 = row.getValue(field) field = "Block_No" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) val2 = row.getValue(field) field = "Plot_No" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) val3 = row.getValue(field) outName = str(val) + "LGA" outName = "Block" + str(val) + "Plot_" + str(val2) outName1 = "Block_" + str(val2) + "Plot_" + str(val3) + str(val1) + "Area of" + str(val) + "_LGA" + ".pdf" outName2 = str(val1) + "AREA" outName3 = "Block" + str(val2) #+ "Plot_" + str(val3) outName4 = "Plot_" + str(val3) arcpy.CreateFolder_management("C:\ETE_STATE",outName,outName2,outName3,outName4) arcpy.mapping.ExportToPDF(mxd,"C:\ETE_STATE", outName+outName2+outName3+outName4+ outName1)
os.makedirs(path)
arcpy.CreateFolder_management("C:\\ETE_STATE",outName,outName2,outName3,outName4)
>>> arcpy.CreateFolder_management("C:\\ETE_STATE",outName,outName1,outName2,outName3) Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> TypeError: CreateFolder() takes at most 2 arguments (5 given) >>>
>>> arcpy.CreateFolder_management("C:\\KWARA_STATE\\outName",outName1) 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 000732: Folder Location: Dataset C:\KWARA_STATE\outName does not exist or is not supported Failed to execute (CreateFolder). >>>
arcpy.CreateFolder_management("C:\\KWARA_STATE\\outName",outName1)
outName = 'FolderX' outName1 = 'NewFolder' arcpy.CreateFolder_management("C:\\KWARA_STATE\\" + outName,outName1)
arcpy.CreateFolder_management("C:\\ETE_STATE",outName,outName1,outName2,outName3)
folders = [outName,outName1,outName2,outName3' for folder in folders: arcpy.CreateFolder_management("C:\\ETE_STATE",folder)
PATHNAME = "C:\\KWARA_STATE" arcpy.CreateFolder_management(PATHNAME, Outname1{or whatever your folder name is})
>>> outName6 = str(val) + "_LGA" + "(" + str(val1) + " _Area" + ")" >>> outName1 = "Plot_" + str(val3) + "(" "Block_" + str(val3) + ")" >>> arcpy.CreateFolder_management("C:\\ARA_STATE\\", outName6) <Result 'C:\\ARA_STATE\\rin_South_LGA(GRA_Buo_Oho _Area)'> >>> arcpy.CreateFolder_management("C:\\ARA_STATE\\"+ outName6,outName1) <Result 'C:\\ARA_STATE\\rin_South_LGA(GRA_Buo_Oho _Area)\\Plot_9(Block_9)'>
>>> outName2 = "TDP_FOR_" + "Block_" + str(val2) + "_Plot_" + str(val3) + "_" + str(val1) + "_Area_of_" + str(val) + "_LGA" + ".pdf" >>> arcpy.mapping.ExportToPDF(mxd,"C:\\ARA_STATE\\" + outName6,outName1,outName2) Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_ return fn(*args, **kw) File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\mapping.py", line 1133, in ExportToPDF assert isinstance(data_frame, DataFrame) or (isinstance(data_frame, basestring) and data_frame.lower() == 'page_layout') AssertionError >>> arcpy.mapping.ExportToPDF(mxd,"C:\\ARA_STATE\\" + outName6,outName1) Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\utils.py", line 181, in fn_ return fn(*args, **kw) File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\mapping.py", line 1133, in ExportToPDF assert isinstance(data_frame, DataFrame) or (isinstance(data_frame, basestring) and data_frame.lower() == 'page_layout') AssertionError
arcpy.mapping.ExportToPDF(mxd,"C:\\ARA_STATE\\" + outName6,outName1,outName2)
ExportToPDF ( map_document, out_pdf, {data_frame}, {df_export_width} , {df_export_height}, {resolution}, {image_quality}, {colorspace}, {compress_vectors}, {image_compression}, {picture_symbol}, {convert_markers}, {embed_fonts}, {layers_attributes}, {georef_info}, {jpeg_compression_quality})