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"
Solved! Go to Solution.
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"
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 thisarcpy.mapping.ExportToPDF(mxd,"C:\ARA_STATE\TDP_For_" + outName,outName1)
What do you think?
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