Yes, this will get you!
The trick here is to do the GetCount inside the calculate value. A little Python goes a long way in ModelBuilder!
"Output feature class" is the model element for your shapefile that you want to delete if it is empty.
You should have Output feature class be precondition for this Calculate Value tool so it will run at the right time.
DeleteIfZeroCount(r"%Output feature class%")
if int(arcpy.GetCount_management(inFC).getOutput(0)) == 0:
followed by error 000732 input rows for my "target shapfile" does not exist or is not supported failed to execute (getcount)
invalue = arcpy.Getparameter (0)
if inValue == 0:
outValue = True
out Value = False
I know it's been a long time since you posted this question and solution, but do you mind sending a picture of your model? -If you still have it?
I am having the same problem as you where I am not able to delete empty feature classes created by my model. I've tried many things and contacting you is sort of my last resort.
I think the easiest way may be to do the delete inside the Calculate Value tool. This is up-thread, but here's another shot at it.
As I said above it's very important that you use the "r" and quotes and percent signs as shown - and that the name matches the name of the model element exactly.
fcount = int(arcpy.GetCount_management(ds).getOutput(0))
if fcount == 0: