Select to view content in your preferred language

Scatch Workspace problems

1153
9
06-24-2013 12:19 PM
ChristopherGraf
Occasional Contributor
In Model Builder, I have made a tool that takes an selection, turns it into a Geodatabase, add some fields, calculates those fields, turns it into a dBASE, uses Make XY Layer on that, and Exports to CAD. This all works pretty well now, for every conversion tool I use, it makes another output that is dependent somewhere else. I want clients to be able to use this tool on whatever selection they make and not have to worry about those other outputs. I have tried to use "%scratchworkspace%\output" but it doesn't seem to work. Does anyone have any ideas on how I can get this tool to work using the Scratch Workspace properly?
0 Kudos
9 Replies
ShitijMehta
Esri Regular Contributor
Hi cgraf1,
Create a workspace variable and make it a model parameter. Rename to Output Location. Let the user define the output location and use the name of this variable as inline in the output paths  of different tools %Output Location%. Will this work?

I have to see the model to understand why %scratchworkspace% is not working for you? Have you set the workspace in model properties>environments tab? or the model is using the scratch workspace path set in your arc map document geoprocessing>environments.

You can also read about using %scratchGDB% or %scratchFolder% at 10.1. May be these options work for you.

Let me know.
0 Kudos
ChristopherGraf
Occasional Contributor
Hey Shitij,

     Thanks for the advice. I will try out your suggestions and see if any of those help me out. Meanwhile, this is what happens in my model when I first try to use the %scratchworkspace%. Thanks again.


     - Chris
0 Kudos
markdenil
Frequent Contributor
Is there a scratch GDB that has been created in your scratch space?
Can you write to it outside your model, for example, using ArcCatalog?

Try making a model or script that just tests for the presence of the GDB
(an existing one or one the model creates):
get a fc listing for it, for example.

Try making a model or script to create a GDB in that folder space.

Try having the model create its own scratch workspace in the windows TEMP or TMP directory.
(then delete it when no longer needed)

Try using the in_memory workspace for the intermediate output instead of writing it to disk
(some output MUST be written to disk (output from project, for example), but not every thing need be)

... just a few things to try....
0 Kudos
ChristopherGraf
Occasional Contributor
Shitij,

    I tried your suggestion on using a workspace variable and making it a model parameter. Unfortunately, it did not work. I also reasearched into the %scratchGDB% and the %scratchFolder% as you suggested. In both cases the client would have to do their own deletion clean-up and that is not want I need. Thanks again for your suggestions though. To answer your question, I set up the scratchworkspace in both the ArcMap and the model itself. At least, in the model itself I have clicked the %scratchworkspace% check box. I don't know much about how this works, if that is what you meant.

    - Chris
0 Kudos
markdenil
Frequent Contributor
Be aware that when the help says that "the client would have to do their own deletion clean-up", that just means the system will not do it automatically: You have to build the clean up into your model.
0 Kudos
ShitijMehta
Esri Regular Contributor
Hi cgraf1,
You can set the output of any of your tool to be an intermediate data. Read from the link. If you mark the output as intermediate data and run the model from the model tool dialog (double click on model from catalog window) then anything marked as intermediate data will be cleaned automatically after the model runs. IF you run the model by editing the model then you have to clean the intermediate data from Model menu > Delete Intermediate data.
0 Kudos
ChristopherGraf
Occasional Contributor
Mark,

       I was not aware that I could build a deletion in the model myself. I will most likely try that technique sometime tomorrow if the other things I have been trying do not pan out. I have also yet to try your earlier suggestions. Be assured that I do appreciate the advice and will most likely be trying all of them out soon.


Shitij,

       I tried to turn my outputs into intermediate data, but the button is faded out on all of them. Clicking it does nothing. I can't imagine what is in my model that would make them unable to be turned into intermediate data. I'm still looking into the subject.



    Thank you both again for the help. Hopefully I'll eventually be able to take down this project.


    - Chris
0 Kudos
ShitijMehta
Esri Regular Contributor
Intermediate data will only apply to tools that create new output datasets. If your tools are like Add Field which only modifies the input then there is no intermediate data. Such outputs are called in-out derived data (modify input. NO new output)

See if this information might help solve part of the mystery.
0 Kudos
ChristopherGraf
Occasional Contributor
All of the outputs have the intermediate data button faded. We've decided that too much time is being taken up on this issue and we just want the project to be done and usable for others. I have a new problem now for clients. I had it working just how I wanted to in the Model Builder. Unfortunately, it does not work when called in ArcMap reguarly. The user is supposed to input a Project Selection Layer and where it wants it to be outputed. Within the model, there is a Feature to Geodatabase and a Table to dBASE. The Add Field after the Feature to Geodatabase and the Make XY Event Layer after the Table to dBASE could not take any input until the model was run up to that point, because the geodatabase and the .dbf didn't exist. So when I client is using this for the first time with a different project selection layer, it says that database and .dbf do not exist and cannot run it. How can I transfer those input that should be seen in the model?

I realize this is totally different than what I was asking before. Again, thank you so much for your help. I will most likely be doing a separate post for this problem, since it is so unrelated to my previous one.

   - Chris
0 Kudos