error when running a system variable %n%

965
5
10-01-2012 09:09 PM
ChrisGraves
Occasional Contributor
Hi GIS Gurus,

I've created a model that works when running it in edit mode but doesn't when running it from the tool dialog box. This is the scenario:

I've got 3 shapefiles that I'm iterating in a model and processing using an in-line variable (%n%). When I run the model in edit

mode it produces 3 shapefiles (shapefile0, Shapefile1, shapefile2) without any issues. When I run it from the tool dialog box, it runs

without error but for shapefile0, I get the attached error when I try to open the file in ArcCatalog or add it into ArcGIS.

The model I'm running is not large and is running 4 tools (see screenshot). I'm running ArcGIS v10 (SP5).

I've done some research but unable to find any bugs on this.

Cheers,

Chris
0 Kudos
5 Replies
by Anonymous User
Not applicable
Original User: m.gasior

Your inline variable created by iterator is %Name%.
Have you tried using %Name% variable name instead of %n%?
0 Kudos
ChrisGraves
Occasional Contributor
Thanks for the reply. Sorry for the confusion but I am using %Name%

Cheers
0 Kudos
by Anonymous User
Not applicable
Original User: j.quinn

In Windows Explorer, are all of the necessary components to a shapefile present?  It needs at least the .shp, .shx, and .dbf.
0 Kudos
ChrisGraves
Occasional Contributor
Thanks for the reply. All of the files are available (see screenshot). The model works seamless when running it in edit mode but not when running the model as a tool.

Thanks again.
0 Kudos
by Anonymous User
Not applicable
Original User: shitijmehta

Can you share your model and a sample of your data?

Possible reasons that it does not work from a tool dialog could be:

  • You have exposed a parameter with default inline variable on the tool dialog. %Name% anywhere in a parameter on a dialog could cause problem

  • You are using some layer file which is locked or getting deleted before being used by a tool downstream.

  • One of your outputs is intermediate and is getting deleted before the next tool using it is run.

0 Kudos