Solved! Go to Solution.
I have a model which will pull 30 features from a database and a second model which will perform a feature class rename on these 30 different features. This is done on a daily basis. Sometimes one of the names will change or a feature won't be pulled in for some reason.
The problem is that when the rename model is running if it can't find a feature it will error the entire model instead of ignoring the error and skipping to the next feature to rename. None of the processes have preconditions.
Is their a way I can tell the model to ignore errors and move on if it can't find a feature? A green error instead of a red one?
def FCRename(from,to): import arcpy try: arcpy.Rename_management(from,to) return "rename %s to %s success!" % (from,to) except: return "rename %s to %s failed" % (from,to)
I have a model which will pull 30 features from a database and a second model which will perform a feature class rename on these 30 different features. This is done on a daily basis. Sometimes one of the names will change or a feature won't be pulled in for some reason.
The problem is that when the rename model is running if it can't find a feature it will error the entire model instead of ignoring the error and skipping to the next feature to rename. None of the processes have preconditions.
Is their a way I can tell the model to ignore errors and move on if it can't find a feature? A green error instead of a red one?
def FCRename(from,to): import arcpy try: arcpy.Rename_management(from,to) return "rename %s to %s success!" % (from,to) except: return "rename %s to %s failed" % (from,to)
Interesting...What error message were you getting? I made a replica of your geodatabase in the exact same location on my G: drive and executed the same code I posted above and it worked perfectly (Maybe I had your path name wrong?). I have attached screenshots of the whole process below.
[ATTACH=CONFIG]22400[/ATTACH][ATTACH=CONFIG]22401[/ATTACH][ATTACH=CONFIG]22402[/ATTACH][ATTACH=CONFIG]22403[/ATTACH]