Select to view content in your preferred language

Use project scratch workspace in ModelBuilder

216
3
Jump to solution
4 weeks ago
AmyDunn
Occasional Contributor

I am using the Contour tool in ModelBuilder, and I would like the output to always be the scratch workspace of whatever project it's run in. I tried %scratchGDB%\ContourLines, and the model runs, but that just makes a new scratch.gdb, every project we work it will already have a MapName_Scratch.gdb set up and assigned in the environments of the project.

I'd rather it not be a user-defined tool parameter; if a user is setting the environments of their project, the tool should honor that instead of having to define it again in the tool interface.

0 Kudos
1 Solution

Accepted Solutions
AmyDunn
Occasional Contributor

Solution found under Workspace Environments here.

View solution in original post

0 Kudos
3 Replies
AmyDunn
Occasional Contributor

Solution found under Workspace Environments here.

0 Kudos
BrendanNewell
Esri Contributor

Hi @AmyDunn this  should work. I am not sure why in your case it is creating a new gdb. Are you able to provide a screenshot of the contour tool, model and project environments?

🙂
0 Kudos
AmyDunn
Occasional Contributor

I figured it out, %scratchGDB% and %scratchFolder% are meant to create scratch.gdb or a folder named scratch, respectively. %workspace% and %scratchWorkspace% are meant to use the current and scratch workspaces set in the current project.

0 Kudos