Problems using AddField tool twice in ModelBuilder

627
3
Jump to solution
01-18-2013 09:38 AM
RogerDunn
Occasional Contributor II
I have a model that I'm building and am having trouble with one part.  After a select-and-delete operation, I have two AddField tools.  The first one executes, and the next doesn't.  If I switch the order, the result is the same where the geoprocessor stops on the second AddField.

Here is a clip of that output sequence:
Executing (Add Alias Field): AddField C:\Users\<Username>\Documents\ArcGIS\Default.gdb\PreNamePage_Layer ALIASFOR TEXT # # 30 "Alias For..." NULLABLE NON_REQUIRED # Start Time: Fri Jan 18 12:28:21 2013 Adding ALIASFOR to C:\Users\<Username>\Documents\ArcGIS\Default.gdb\PreNamePage_Layer... Succeeded at Fri Jan 18 12:28:21 2013 (Elapsed Time: 0.00 seconds) Executing (Add Sort Helper Field): AddField C:\Users\<Username>\Documents\ArcGIS\Default.gdb\PreNamePage_Layer SORTHELPER TEXT # # 20 "Sort Helper" NULLABLE NON_REQUIRED # Start Time: Fri Jan 18 12:28:21 2013 ERROR 000229: Cannot open C:\Users\<Username>\Documents\ArcGIS\Default.gdb\PreNamePage_Layer Failed to execute (Add Sort Helper Field). Failed at Fri Jan 18 12:28:21 2013 (Elapsed Time: 0.00 seconds)


I am not able to find or see PreNamePage_Layer before or after the first AddField.  My guess is that it's an in-memory thing.  I've searched the forums and I do not have the virus checker mentioned in one of those threads.

I am using ArcGIS Desktop 10.1 Basic, Service Pack 1.

Any ideas or experiences to help me out?
0 Kudos
1 Solution

Accepted Solutions
HAnnielGilmore
New Contributor III
HI Roger,

I don't know if this will help you but I also, once tried to ADD  FIELD two times. There are two ways that I did it through model builder.
In my first model, I used two Add Fields from my output Select Output Feature Class and it provides me with two new fields in my attribute table. See attachment
[ATTACH=CONFIG]21450[/ATTACH]

In my second model, i used the  Make Feature Layer tool after the first Add Field and then I connect the second Add Field from its Output Feature Class, This Make Feature Layer tool helps  me in adding multiple fields as required. See Attachment
[ATTACH=CONFIG]21451[/ATTACH]

I hope these tools will help you.

If you get some other suggestions and ideas to Add Fields please share.

Thank you in advance,
HG

View solution in original post

0 Kudos
3 Replies
HAnnielGilmore
New Contributor III
HI Roger,

I don't know if this will help you but I also, once tried to ADD  FIELD two times. There are two ways that I did it through model builder.
In my first model, I used two Add Fields from my output Select Output Feature Class and it provides me with two new fields in my attribute table. See attachment
[ATTACH=CONFIG]21450[/ATTACH]

In my second model, i used the  Make Feature Layer tool after the first Add Field and then I connect the second Add Field from its Output Feature Class, This Make Feature Layer tool helps  me in adding multiple fields as required. See Attachment
[ATTACH=CONFIG]21451[/ATTACH]

I hope these tools will help you.

If you get some other suggestions and ideas to Add Fields please share.

Thank you in advance,
HG
0 Kudos
RogerDunn
Occasional Contributor II
I was able to fix the problem before your post, but neglected to update this thread--I'd quite forgotten about it.  Anyway, I used one of the methods you suggested, and that was to put the Add Field tools further apart, and on different logical lines.  For instance, the first Add Field happens on a sister line to another geoprocess.  Those geoprocesses come together with an Append, and the next Add Field called after that.  No problems with that, so thank you.
0 Kudos
HAnnielGilmore
New Contributor III
Hi Roger,

Its great to know that you have resolve the issue.

Hope you have mark the post as answered or discussion.. http://forums.arcgis.com/images/icons/icon7.png

Thank you,
HG
0 Kudos