Hello,
I've built a model that should work as far as I can tell. I'm using the get count to check a shape file for entries. Then using the calculate value to serve as a precondition to the delete tool. The calculate value tool takes in the Row Count and puts out a false if there are values and a true if there are zero values. This breaks the iteration before the delete tool if values exist Essentially I'm iterating through a directory and want to delete any shape files that have 0 features in them. When I run the model features with 0 rows are still created and in the dialogue box it says all the inputs are not current when it runs over a feature that's supposed to be deleted.
My calculate value code is
expression
fn("%Row Count%")
block
def fn(rowcount):
if rowcount == 0:
return "true"
else:
return "false"
data type
boolean
What am I missing?
Thanks
I've built a model that should work as far as I can tell. I'm using the get count to check a shape file for entries. Then using the calculate value to serve as a precondition to the delete tool. The calculate value tool takes in the Row Count and puts out a false if there are values and a true if there are zero values. This breaks the iteration before the delete tool if values exist Essentially I'm iterating through a directory and want to delete any shape files that have 0 features in them. When I run the model features with 0 rows are still created and in the dialogue box it says all the inputs are not current when it runs over a feature that's supposed to be deleted.
My calculate value code is
expression
fn("%Row Count%")
block
def fn(rowcount):
if rowcount == 0:
return "true"
else:
return "false"
data type
boolean
What am I missing?
Thanks