Select to view content in your preferred language

Parse Path ModelBuilder utility crashes ArcGIS Pro when run from toolbox

1472
5
Jump to solution
02-04-2022 09:21 AM
HaileyWright1
Regular Contributor

I created a model that uses the Parse Path utility to pass the name of a parameter input value (a spreadsheet in my case) to various output feature classes using inline variable substitution. The model works great when run in ModelBuilder, and after it successfully runs in ModelBuilder, I can also run it as a tool from toolbox without issue. But when I first open up my project and attempt to run my model as a tool from toolbox, ArcGIS Pro crashes - the program, not just the tool - with no error message. 

I figured the issue must be somewhere else in my model but through troubleshooting, I've learned that if I run Parse Path alone in ModelBuilder first  (by right clicking the Parse Path utility and clicking Run) I can close ModelBuilder then run the whole model from toolbox and that seems to work fine.

Then I was able to isolate the issue in a separate model with just the Parse Path utility. Works fine in ModelBuilder and from toolbox - but only after first run in ModelBuilder. Otherwise a fresh instance of Pro will crash. I've tried selecting several different files types from several different folder locations. What am I missing here? 

I'm using ArcGIS Pro 2.6.3 and Format Name, Extension and Workspace is enabled for Parse Path. 

 

1 Solution

Accepted Solutions
DuncanHornby
MVP Notable Contributor

As a possible work around you could parse your path using some simple python code run in the Calculate Value tool?

View solution in original post

5 Replies
curtvprice
MVP Alum

Good for you for isolating this bug. I highly recommend updating Pro to the current version to see if it is fixed and if not reporting the issue to Esri tech support, that's how these things get fixed. If you get a NIM number, post it in this thread for future reference so people can see if/when it was fixed.

HaileyWright1
Regular Contributor

Thanks for the pointer. I'll be using 2.6.3 until the next corporate rollout but will test again in the newer version of Pro once I'm able to upgrade. Hopefully soon!

0 Kudos
DuncanHornby
MVP Notable Contributor

As a possible work around you could parse your path using some simple python code run in the Calculate Value tool?

curtvprice
MVP Alum

That's a great idea. Example Calculate Value code

arcpy.Describe(r"%Excel worksheet%").name
HaileyWright1
Regular Contributor

Great work around. I added a parameter variable (data type table), renamed the variable "Excel worksheet" and typed "arcpy.Describe(r"%Excel worksheet%").name[:-1]" in the expression line of the Calculate Value utility. I added the [:-1] in order to format the value by trimming the $ that gets pulled in with the worksheet name. It's working great in both modelBuilder and geoprocessing. Thank you both for the help @DuncanHornby and @curtvprice!