Hi,
I have a script which, as part of its logic, takes a map layer from the current map document and gets its source path. Recently it has been returning the wrong path: it returns the path to my default geodatabase instead of the correct path to the layer's data. It used to work fine.
This incorrect behavior occurs with my_layer.workspacePath and with Describe(my_layer).Path. Both of these return the wrong path; if I check the Layer Properties from the Table of Contents in ArcMap I can see the correct path.
Any ideas what might be going wrong? Is anyone else having this issue?
I'm using ArcMap 10.8.0.12790
can you confirm that it also doesn't exist in your default geodatabase
Thanks for the quick reply.
It turns out there was indeed a (different) feature class with the same name in my default geodatabase. It was not loaded in the current map document.
Deleting the feature class from the default geodatabase did fix the problem, so thank you for the hint. I am still curious why it gave the result it did.
Could you provide your code so we can take a look?
Glad it worked out, but I suspect that the code will determine that. I suspect that somewhere the environment path or something was changed and caused the default gdb to be read