This tool creates two output files, i.e. both baseline and shoreline intersection features.
The problem occurs when these output files are rewritten with the same filenames as the first time the tool was run. The error is raised when calling the arcpy.management.CreateFeatureclass()
function. This function is used to create an empty feature class to be filled with the calculated intersection points for both baselines and shorelines.
As you can see in the image below, the traceback error that ArcGIS identifies is related to a problem with invalid characters in the filename, which makes no sense as this error does not appear the first time you run the tool.
I've done several tests to pretend to fix this problem, but for some reason that escapes me, the error doesn't always appear, even when I try to reproduce the exact same process that previously gave me an error. I've coded something that should fix this, but it doesn't, the following snippet detects if the filename already exists and removes it before calling the arcpy.management.CreateFeatureclass()
function.
if arcpy.Exists(baseOutFeature):
arcpy.Delete_management(baseOutFeature)
For now, I have managed to solve the problem by doing the following:
- Restart ArcGIS Pro when the error occurs.
- Delete (if they still exist) the two baseline and shoreline intersection features in the default GDB where all the outputs are stored.
- Re-run the tool.
![image](https://private-user-images.githubusercontent.com/91949040/307885008-2d9a9296-540d-449d-9e2c-6abc067b30ef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM0MDk2MTIsIm5iZiI6MTcyMzQwOTMxMiwicGF0aCI6Ii85MTk0OTA0MC8zMDc4ODUwMDgtMmQ5YTkyOTYtNTQwZC00NDlkLTllMmMtNmFiYzA2N2IzMGVmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODExVDIwNDgzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg5MmE2MjVkMGNlM2UzYTNiYmNlNTRiODhkZWMzMmU2NTQzZTA4Yzk0ODVmZDZlNDFlZGJlZTRhN2I4NTRlOGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.MBVDzTysAPdqGOYVSzTCE2ZF1E3BrsMdLRP_IimhOxU)