Model Builder %value% add layer to map

570
5
10-14-2011 06:36 AM
JamesMitchell
New Contributor II
Hello,

Hopefully someone can help me.

I have a model that creates a buffer and then selects features that intersect the buffer.

I have set it up the shapefile that is created uses the buffer value as the shapefile name, however this shapefile will not add to the display. If i name this shapefile anything then it will add.

Is there a workaround for this issue?

Thank you for any help.
Tags (2)
0 Kudos
5 Replies
JamesMitchell
New Contributor II
Hello,

This is beginning to bug me know. Is it possible to add a layer to the map that is created in model builder using the input buffer distance as the layer name?

Thank you
0 Kudos
DuncanHornby
MVP Notable Contributor
James,

It would help us to help you if you post up your model.

Duncan
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Hi James,

I am assuming your shapefile begins with a number since it is based off of the buffer value.  This could be causing the problem.  When naming a shapefile/feature class, the name should not:

1.  Begin with a number
2.  Contain special characters (i.e. !, ?, #...)
3.  Contain spaces
0 Kudos
JamesMitchell
New Contributor II
Hi,

Thanks for the reply.

In model builder there does not seem to be a way i can remove the space between the value and distance measure e.g. 10 Kilometers. I have tried to call the shapefile 'Buffer%Distance%' but this did not work either.

I have managed to add the layer using a Pythin script and MakeFeatureLayer_management
0 Kudos
JordanDecker
New Contributor
Hi,

Thanks for the reply.

In model builder there does not seem to be a way i can remove the space between the value and distance measure e.g. 10 Kilometers. I have tried to call the shapefile 'Buffer%Distance%' but this did not work either.

I have managed to add the layer using a Pythin script and MakeFeatureLayer_management


Any chance you could post your Python script for this and/or explain how you did this in more detail?  Having same issue.

Thanks!
0 Kudos