Hello colleagues,
I've created a model using ArcGIS Pro 2.5.1 that works fine when I write all outputs to the file geodatabase. So I want to improve performance and write intermediate outputs to in_memory Workspace. I was surprized to find that just changing the location of outputs that are not parameters can cause the issues.
For example Select by Attribute tool stops with a message "Invalid expression". After changing back to .gdb location it works fine. Here is the expression.
Another model stopped on Erase tool with a message "Can't open a feature class" (or something like that) but after I've changed back to .gdb it works. Than I tried to repeat the error to make screenshot but the second time it worked with "in_memory" location.
Have any ideas what's wrong here? I'd like my models to work fast and predictable but now I'm confused.
Solved! Go to Solution.
You are getting the message "Invalid expression" because the Shape_Area field is most probably not available in your shapefiles' fields by default. But when you import your shapefiles into a gdb, some fields are automatically created/calculated by the gdb. These fields are Shape_Area, Shape_Length, ... and FID becomes OBJECTID.
I hope that helps.
Mehdi
Do any of the issues discussed in
Considerations when using the in_memory workspace—ArcGIS Pro | Documentation
apply to your workflow in the model? Anything being added to the display?
I studied that article before posting. Unfortunately nothing there explains my situation
"in_memory" is the legacy workspace from ArcMap. ArcGIS Pro uses "memory", try using that.
The link in the previous post says that in_memory is used in Pro... So thanks for advise, I'll delete all "in_" from output locations and will be back with the results
You are getting the message "Invalid expression" because the Shape_Area field is most probably not available in your shapefiles' fields by default. But when you import your shapefiles into a gdb, some fields are automatically created/calculated by the gdb. These fields are Shape_Area, Shape_Length, ... and FID becomes OBJECTID.
I hope that helps.
Mehdi
Thanks! That explains the expression error!
The other errors appear when I try to clear the memory Workspace using Delete tool.
Some features can't be read because they are already deleted and in other cases some features can't be deleted because are blocked by application.
Looks like there is some peculiarity of clearing the memory Workspace in a model with Iterator...