fc = "Parcels" field = "GeneratedN" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) Val = row.getValue(field) if Val == 1: print "Done" else: print "Not Done"
I want to use an if else statement to pass a condition and it's not returning any of the two values what im i doing wrong?fc = "Parcels" field = "GeneratedN" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) Val = row.getValue(field) if Val == 1: print "Done" else: print "Not Done" Any suggestions please
fc = "Parcels" field = "GeneratedN" cursor = arcpy.SearchCursor(fc) for row in cursor: Val = row.getValue(field) if Val == 1: print "Done" else: print "Not Done"
fc = "Parcels" field = "GeneratedN" cursor = arcpy.SearchCursor(fc) for row in cursor: Val = row.getValue(field) if Val == 1: print "Done" break; else: print "Not Done"
fc = "Parcels" field = "LGA" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) val = row.getValue(field) print (row.getValue(field)) field = "District" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) val1 = row.getValue(field) print (row.getValue(field)) field = "Block_No" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) val2 = row.getValue(field) print (row.getValue(field)) field = "Plot_No" cursor = arcpy.SearchCursor(fc) for row in cursor: row.getValue(field) val3 = row.getValue(field) print (row.getValue(field)) outName = str(val) + "_LGA" + "(" + str(val1) + " _Area" + ")" outName1 = "Plot_" + str(val3) + "(" "Block_" + str(val2) + ")" outName2 = "Block_" + str(val2) + "_Plot_" + str(val3) + "_" + str(val1) + "_Area_of_" + str(val) + "_LGA" + ".pdf" arcpy.CreateFolder_management("C:\\ARA_STATE\\", outName) arcpy.CreateFolder_management("C:\\ARA_STATE\\"+ outName,outName1) arcpy.mapping.ExportToPDF(mxd,"C:\ARA_STATE\TDP_For_" + outName1)
arcpy.mapping.ExportToPDF(mxd,"C:\ARA_STATE\TDP_For_" + outName,outName1)
arcpy.CreateFolder_management("C:\\ARA_STATE\\", outName) arcpy.CreateFolder_management("C:\\ARA_STATE\\"+ outName,outName1) arcpy.mapping.ExportToPDF(mxd,"C:\ARA_STATE\TDP_For_" + outName1)my final pdf output is not going into something like this arcpy.mapping.ExportToPDF(mxd,"C:\ARA_STATE\TDP_For_" + outName,outName1)What do you think?
arcpy.CreateFolder_management("C:\\ARA_STATE\\", outName) arcpy.CreateFolder_management("C:\\ARA_STATE\\"+ outName,outName1) arcpy.mapping.ExportToPDF(mxd,"C:\ARA_STATE\TDP_For_" + outName1)
arcpy.mapping.ExportToPDF(mxd,"C:\\ARA_STATE\\TDP_For_" + outName,outName1)
arcpy.mapping.ExportToPDF(mxd,r"C:\ARA_STATE\TDP_For_" + outName,outName1)
fc = "Parcels" field = "LGA" field1 = "District" field2 = "Block_No" field3 = "Plot_No" cursor = arcpy.SearchCursor(fc) for row in cursor: # do not use 4 cursors on the same feature class, only 1 cursor is needed. # read every cursor row and get all 4 field values in a single read of the row val = row.getValue(field) print (row.getValue(field)) val1 = row.getValue(field1) print (row.getValue(field1)) val2 = row.getValue(field2) print (row.getValue(field2)) val3 = row.getValue(field3) print (row.getValue(field3)) # The lines below must also be in the loop to use the values read from each row. outName = str(val) + "_LGA" + "(" + str(val1) + " _Area" + ")" outName1 = "Plot_" + str(val3) + "(" "Block_" + str(val2) + ")" outName2 = "Block_" + str(val2) + "_Plot_" + str(val3) + "_" + str(val1) + "_Area_of_" + str(val) + "_LGA" + ".pdf" arcpy.CreateFolder_management("C:\\ARA_STATE\\", outName) arcpy.CreateFolder_management("C:\\ARA_STATE\\"+ outName,outName1) arcpy.mapping.ExportToPDF(mxd,r"C:\ARA_STATE\TDP_For_" + outName2)
arcpy.mapping.ExportToPDF(mxd,r"C:\ARA_STATE\\" + outName + "\\" + outName1 + "\\" + "TDP_For_" + outName2)
A very big thank you to you SIR!!!! Once again you are the main man. You solved yet another problem for me!
def onEditChange(self, text): pass def onFocus(self, focused): pass def onEnter(self): pass def refresh(self): pass
Dear rfairhur24 please i want to be able to select a name from a drop down list of a combobox i created and i use to use the enter tab to set the process and not by just selecting the name. which of the following codes would i use? Thanksdef onEditChange(self, text): pass def onFocus(self, focused): pass def onEnter(self): pass def refresh(self): pass
Please start a new thread for this question. It is completely different from the other questions on this thread. Also, I am not an expert on Python custom user interface design, so I am not sure I can help. Please indicate how you created this combobox when you repost. Are you hosting the combobox using a script tool interface, a tkinter interface, or what?
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.