I've created a function in my model to insert row in a table I've created. The problem is if it runs the InsertCursor function before the end of my program. My model executes incorrectly. I believe it's because the InsertCursor doesn't actually output anything. I get this message: "The process did not execute because the precondition is false." if I manually try to step through it. The message I get initially upon running model is: "All the inputs are not current." If I remove the precondition, it executes properly except it wants to run the function last, after it's already created the excel document that I'm trying to add the appended table to. I've already attempted this fix.
Here's the function:
import arcpy, inspect, os fc = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + "\ProposedDesignDB.mdb\AnodeEquipment" fields = ['MATERIALNUMBER','MATERIALNUMBERTEXT'] def AnodeUpdate(y): cursor = arcpy.da.InsertCursor(fc, fields) for x in xrange (0, y): newRow = ["100212","ANODE 1 LB 3 FT LEAD 12 WHITE COPPER"] cursor.insertRow(newRow) del newRow del cursor