Select to view content in your preferred language

Interaction Help in ModelBuilder

622
1
01-12-2012 07:15 AM
Raphael_Augusto_FoscariniFerre
Regular Contributor
Hi everyone...

First of all, sorry if my post isn'n in the right sub-forum, but i really dont know where to post it...


So, i want to make a very simple model (actually i already did) where it will be created 5 specific columns in several existing shapefiles, with the same value in the entire column...

This is ver simple... Just 'Add Field' (with their specifications) and then 'Calculate Value' for the column...

Like this:

[ATTACH=CONFIG]11133[/ATTACH]


The entire script is not that, this is a piece of that... Showing only this is a simple way to explain what is my problem:

Some shapefiles already have a column with the same 'Field Name' that i want to create...
When i run the script, ArcMap shows the 'Warning 000012: Field already exists' but the script keep going (this is good, it doesnt stop ever).
Then it runs the 'Calculate Value' in the pre-existing field and this is my problem...

I want to skip the 'Calculate Value' if the field already exists in the shapefile...
I want to create and set a 'default' value to the fields only in the shapefiles that doesnt have that field... And i have a thousands of shapes, so i cant do it one by one...


So, is there a way to put an 'if' in the model builder??  Like " 'if warning 000012...' "
Or is there another way to solve this problem?

i need this...

thanks...
0 Kudos
1 Reply
Raphael_Augusto_FoscariniFerre
Regular Contributor
this is exactly what i was looking for:

http://resources.esri.com/help/9.3/arcgisdesktop/com/gp_toolref/automating_your_work_with_models/bra...

it creates a 'python script' with the 'if condition'... and it does it that exactly looking for a 'field name'...

impossible better!
0 Kudos