def FindLabel ( [NAME], [ID] , [RECHAR] ): if long( [RECHAR].split('-')[0] )<=80000: return "<CLR yellow='255'>"+ [RECHAR] + '\n' + [NAME] + "</CLR>" elif long( [RECHAR].split('-')[0]) > 80000: return "<CLR yellow='255'>"+ [NAME] + '\n' + str( [ID] ) + "</CLR>"
goes at the beginning, I think you get my drift, just reversed them here to negate the effect?
I need assistance with labeling also. I am new to Python and I may have posted this but I am going to try to get your assistance on this since I've been reading your answers to this string from Barton.
I am trying to label contours that are designated as "major" which are the rounded number in the values fields--300, 350, 400, etc. and not label all of the contours. I've been in the Python mode, advanced checked in the label expression dialog box but how do I Find a label in one field and label it some value from another field? Is this possible?
def FindLabel ( [PARCEL] , [LOTNUMBER] , [DEEDACRES] ): if long([LOTNUMBER]) >1: return "<CLR yellow='255'>" + [PARCEL] + "</CLR>" + '\n' + str([LOTNUMBER]) else: return "<CLR yellow='255'>" + [PARCEL] + "</CLR>" + '\n' + str([DEEDACRES])
def FindLabel ( [PARCEL] , [LOTNUMBER] , [DEEDACRES] ): if [LOTNUMBER].strip() == None: return "<CLR yellow='255'>" + [PARCEL] + "</CLR>\n" + str([DEEDACRES]) else: return "<CLR yellow='255'>" + [PARCEL] + "</CLR>\n" + [LOTNUMBER]
def FindLabel ( [contractorName] ): if not [contractorName]: a = "Apples" else: a = [contractorName] return a