2

Using ArcMap 10.3 I am trying to create a model that will take all the shapefiles in a folder and convert them to KML files. I first create an inline variable for the shapefiles in the folder, then when I convert them to feature classes in a geodatabase (because the layer to kml tool needs layer files as input), my output ends up at %variable%.shp.shp.shp.shp... etc. Then it fails on the next tool, which is converting those feature classes to layer files. I have attached two screenshots.

Does anyone know why I might be getting multiple .shp extensions when converting shapefiles to feature classes?

enter image description here enter image description here

2

When using an inline variable you dont need to type the .shp extension afterword. It will be automatically assigned.

| improve this answer | |
  • Thanks @KGR, that makes sense, but when I remove the .shp from the input features in the picture above, I get the error 000732, Input Features: Dataset %full_perimeter% does not exist or is not supported. So I am confused on how I am supposed to use the variable %full_perimeter% that I created when I iterated the feature class it came from, further down the line in the model. – sparky Aug 21 '18 at 5:14
0

Export your tool into a script and add these 2 lines according to your files, wherever you are giving names. An example of code to split your name

| improve this answer | |
-1

Split the name of the file using a dot (.), use the first part for name and add extension using a + sign.

| improve this answer | |
  • 3
    Split how, can you edit your question and add more details? – BERA Mar 28 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.