How to get the file extension of a layer

10-01-2019 09:49 AM
New Contributor III

I am trying to create a copy of a layer already on the map. It works great when I hardcode the file extension or the layer is in a gdb. The problem is that I won't know that when the user clicks copy. How do I programmatically find out the file extension? I know that it is stored since I can see it when I go to the layer properties in ArcPro, but I can't figure out how to see that programmatically.

Thank you,


0 Kudos
1 Reply
New Contributor II

I am also having this issue. When using Layer.GetPath(), I receive the path to the correct file, but it does not have the file extension, e.g. .shp.

0 Kudos