Hands On
4. Populate the SystemTools toolset by selecting it, right-clicking, and choosing Add > Tool. In the Add Tool dialog box, expand Analysis Tools, expand the Extract Toolset, and check the Clip and Select tools. Still in Analysis Tools, expand the Proximity toolset and check the Buffer tool. 5. Expand the Conversion Tools, expand the Geodatabase toolset, and check the Feature Class To Feature Class tool. 6. Expand Data Management Tools, expand the Features toolset, and check the Add XY Coordinates and Copy Features tools. Still in Data Management Tools, expand the Fields toolset and check the Add Field tool, then expand the General toolset and check the Copy, Delete, and Rename tools. Expand the Table toolset and check the Copy Rows tool. Finally, expand the Workspace toolset and check the Create Folder tool. 7. Click OK. The tools will be added to the SystemTools toolset. 8. Next create a second toolset and name it ProjectTools. Although both toolsets were created in the ArcToolbox window, they are stored in the project toolbox, which was created in the BufferSelectedWellsInStudyArea project folder. The ArcToolbox window merely points to, rather than stores, resources. 9. Close the ArcToolbox window. Task 3: Create the Project Folder Structure with a Model The next task will be to build a model in the project folder that will automatically generate five folders (indata, outdata, doc&pics, scripts, and mxds) that will keep the materials for the project organized. 1. Create a new model in the ProjectTools toolset by right-clicking it and choosing New > Model. 2. Access the Model Properties dialog box by either using the Model menu and choosing Model Properties or by right-clicking the model canvas and choosing Model Properties. 3. In the Model Properties dialog box, name the model projectFolderStructure. For the label, enter “Project Folder Structure,” and for the description, enter “Setting up project folder structure”. Check the box next to “Store relative path names so paths” will reflect the
www.esri.com
Double-click the Folder Name node to open the variable dialog box and add four more rows by clicking the Add Data button. Click on each row and enter the folder names: indata, outdata, docs&pics, scripts, and mxds.
toolbox’s location in the project folder. 4. Click the Environments tab. Expand General Settings and check Current Workspace and Scratch Workspace. Click the Values button. Expand General Settings in the new dialog box and set the Current Workspace location to C:\ and the Scratch Workspace to C:\temp. Click OK. 5. In the Model window, save the model. The model name now appears in the ArcToolbox window. 6. Now to build the model. Expand the SystemTools toolset. Drag and drop the Create Folder tool onto the model. Right-click the tool and choose Make Variable > From Parameter > Folder Location. Double-click the Folder Location variable node to open its dialog box. Set it to the BufferSelected WellsInStudyArea_12Oct09 project folder. Because the workspace is set to C:\, the path will automatically be appended. Click OK. The model nodes are now colored. 7. To create the five project folders (indata, outdata, docs&pics, scripts, and mxds) in BufferSelectedWellsInStudyArea_12Oct09 will require exposing the Folder Name parameter. Right-click the Create Folder tool and choose Make Variable > From Parameter > Folder Name. 8. The Folder Name node appears on top of BufferSelectedWellsInStudyArea_12Oct09 so use the Select tool to move it to its own spot in the model. The Folder Name needs to be set to series so it will create five folders with five names. Right-click the Folder Name node and choose Properties. On the General tab of the dialog box, select A series of values and click OK. [Note that the Folder Name node in the model is now stacked, which indicates that there is more than one input.] Double-click the Folder Name node to open the variable dialog box. Add four
more rows by clicking the Add Data button four times to create a total of five rows. Click each row and enter the folder names: indata, outdata, docs&pics, scripts, and mxds. Press the Tab key to move from row to row. Click OK when done. 9. From the Model menu, choose Model > Validate Entire Model. The model elements are colored, which seems to indicate it is ready to run. However, some additional modifications are needed. Save the model. 10. Model iteration needs to be set so the model will use the five values for the folders. Reopen the Model Properties dialog box and click the Iteration tab. Select Get the iteration count from this variable. From the dropdown menu, select Folder Name. Click OK and save the model. 11. To make it easy to identify what this model does, label the Folder Name parameter by selecting it, right-clicking, and choosing Create label. The word Label appears on the Folder Name node. Moving the label off the node is a little tricky. Click in a white area of the model to deselect everything, then click the word Label and drag it away from the node. Right-click Label and choose Display Properties. In the Name field, type “Series of 5 folder names used in model iteration to set up the project folder structure”. Create another label for the entire model by clicking in the white space of the ModelBuilder window and choosing Create label, then type “Creating folders to set up the project folder structure” in the Name field. 12. Validate the model and save it. Click the Run button. The model should create the five folders for the project.
Continued on page 56
ArcUser Spring 2010 55