I have a strange bug (?) using arcpy when I try to create a layer with a point inside the name. Let's consider I write:

N = 26.1
outLocation = "C:/Project/ArcGIS/MyLayers/"    
outputName =  "SimpleName_"+str(N)
geometry_type = "POINT"
arcpy.CreateFeatureclass_management(outLocation, outputName, geometry_type)

The layer is created but it gets the name SimpleName_24 instead of SimpleName_24.1

Is it something that can be corrected? I also tried "SimpleName_"+str(N)[:2]+"."+str(N)[3:] but it didn't work.

  • Are you creating a shapefile or a feature in a geodatabase? – BERA Nov 1 '16 at 12:28
  • 3
    You should really avoid anything but a-z, A-Z, 0-9 and _ in names and paths, especially in combination with Python. Will save you a lot of headaches... – Martin Nov 1 '16 at 12:29

Using "." in feature class name is not supported (invalid). You cannot create a fc with a "." character. Maybe use "_" underscore character instead. Here is a q/a defining naming rules:

What are Valid feature class and table names in ArcGIS Desktop?

|improve this answer|||||

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.