#Written by Steve Atchison 6/5/2013 for Shawnee County
import datetime
from Tkinter import *
def cleargui():
ent1.delete(0,END)
deednum.delete(0,END)
textwin.delete("1.0",END)
textwin.insert("0.1","Please close GUI to create letter.")
#GET DATA FROM GUI
def getdatafromgui():
notes = textwin.get('1.0',END)#GET TEXT FROM THE TEXT WINDOW
print("\n")
#SELECT A PARCEL FROM THE OWNER LAYER FIRST BEFORE USING THIS SCRIPT.
for row in arcpy.SearchCursor("Owners"):
grantor= ent1.get()
owner = row.getValue('ONAME')
mailaddress = row.getValue('MAILADDRESS')
mailaddress2 = row.getValue('MAILADDRESS2')
#deed= row.getValue('DBOOKPAGE')
deed=deednum.get()
today=datetime.date.today()
parcelid=row.getValue('PID')
#THIS IS WHERE THE SAVE LETTER TO FILE STARTS.
f = open(r"G:\GIS and Mapping\TitleLetters\theletter.txt",'w')
getdatafromgui() #Gets data from the GUI
f.write('''
Shawnee County Appraiser/GIS Department
1515 NW Saline, Suite 100
Topeka KS 66618
'''+"\n")
f.write(" "+today.strftime("%m/%d/%y"+"\n")+"\n"+"\n"+"\n")
f.write(" "+str(owner)+"\n")
f.write(" "+str(mailaddress)+"\n")
f.write(" "+str(mailaddress2)+ "\n"+"\n"+"\n")
f.write(' '+'Dear '+ str(owner)+'\n')
f.write('''
Recently we processed a recorded deed %s that was filed with the Shawnee County
Register of Deeds Office. You are being sent this letter to acknowledge what properties
were affected and what the actions the GIS (Geographic Information Systems) department
did according to that filed deed.
Please note below are the actions the GIS Department used in processing %s
Name NOT Changed from %s to %s
%s : %s
Respectfully,
Shawnee County Mapping Department/Appraisers (785)251-6049 ''' %(deed,deed,owner,grantor,parcelid,notes))
#f.write("\n"+"-------------------------------------------------------------------------------------------------"+"\n")
cleargui()
root = Tk()
root.config(bg='blue')
root.geometry('700x400')
btn1=Button(root,text='Add to letter',command = write_letter)
btn1.pack()
lbl=Label(root,text="GRANTEE").pack()
ent1 = Entry(root, width =80)
ent1.pack()
lbl2=Label(root,text="Deed number ")
lbl2.pack()
deednum=Entry(root)
deednum.pack()
lbl2=Label(root,text="Actions taken").pack()
textwin=Text(root,width=800,height=26,background='white')
textwin.pack(padx=5,pady=5)
root.mainloop()
#Select a parcel from the owner layer before running this script.
#A layer named "Owner" needs to be present in the table of contents
#Letter will be created when GUI is closed: Copy and paste into Word.
This is a personal record of my python programming experiences. It will allow me to see how I am progressing as I learn a new language.
Thursday, February 5, 2015
Subscribe to:
Posts (Atom)
Followers
Blog Archive
- June (1)
- March (3)
- February (1)
- July (3)
- May (1)
- April (1)
- March (1)
- January (1)
- December (1)
- November (4)
- July (3)
- May (2)
- April (1)
- March (6)
- February (2)
- December (1)
- November (1)
- September (3)
- August (3)
- July (1)
- March (3)
- January (1)
- December (5)
- November (2)
- October (1)
- September (2)
- August (1)
- July (4)
- May (3)
- February (1)
- January (1)
- December (1)
- November (2)
- October (2)
- September (9)
- August (2)
- May (1)
- April (1)
- March (6)
- February (5)
- January (3)
- August (2)