[MUSIC] Hello everyone and welcome back. And welcome to the final lecture on Model Builder. You're still going to use it in your assignment for this module and you'll build your own model there using a lot of the same tools that we've used, but after this, we will be done with our lectures on Model Builder. I have just a few things I want to show you in this lecture. I want to show you some model specific tools that help you do advanced things like looping and iteration in your models, as well as how to export your models to Python code, so that you can either learn Python or incorporate something that you decided was easier to structure conceptually as a model into some existing Python code. To do this, let's take a quick look at the model we've just built. So, I'll close out that geo processing window and go to the Edit for it. And let's start with the tools for models only. And if I go to Insert, there are Model Only Tools and then there are Iterators. And each of these connects to some advanced parts of Model Builder. And they are parts of Model Builder that make it behave a little more like a programming language than as just kind of a structured drag and drop editor to connect your tools together. I don't plan to go through each of these individually, but what I do want to point out is that these tools work on particular variables in Model Builder that aren't necessarily your feature classes or your data that you're working with. Instead, this is where you might want to create a variable, maybe a variable that just holds a number. And then you can use calculate value to maybe calculate the number of times you need to do something and then iterate through from there. You can also select different rows in a feature class and work specifically on those in Model Builder. So we're not limited to just specific geoprocessing tools. You can kind of dive in a little deeper into your data and some analysis on it there. There are some good tutorials on using these sets of tools in the ArcGIS desktop help. And so if you think that you're going to need do some advanced Model Builder work where you need to loop through some datasets or features or things like that, go take a look at those in the Model Builder section of the desktop help because that's a great way to learn how to use all of these. For now, and for this class, what you really need to be proficient in is making your algorithms, your work flows in GIS into this kind of structured representation. You will use this in the Capstone project, and it's just a great way to bring your thoughts together into a single workflow and make sure that you're getting what you think you should be out of your process in ArcGIS. Okay and the other thing I want to show you is exporting your model either to a graphic or to a Python Script. So we can export to a graphic, just so you can send somebody a visual representation of it. Basically, it just makes your model show up as an image. But what I really want to show you is the Python Script. So let's export it to a Python Script. And I'll call it markparsals.py. And let's find that script I just exported. And open it up for editing. Okay, so for those of you who haven't seen or heard of Python before, Python is a scripting language, you can think of it as computer code. But, it’s a much easier one to learn than many languages are, and it's also tightly integrated with arc GIS with this arc pie package that you can import into your own code, and then access different functionality of arc GIS from. And what's really handy is if you're new to Python code, or just new to working with it in arc GIS, exporting a model can be a great way to see what the commands are to use in Python for tools you're familiar with. So here's the command for Field Calculator, and here's the command for adding a field and for copying features. So if you really just want to find out how to do some of the things you already know how to do in arc GIS, from a Python code and how to work on automating them in Python, exporting model can be a great way to get started. The code can get a little weird and isn't really following best practices sometimes since a computer generated it. But overall if you name your variables well, your code actually is pretty easy to read. because it's using the same variable names as I created, like correct side polygon here. So it makes it a lot easier to follow this code. If you don't then you sometimes get variable names like this that are pretty hard to understand and parse and make your code a lot less readable. This would be runnable code though. And since I made those parameters I can still pass these as parameters to, the script on the command line, or if I made this into its own geo-processing tool, which you can do with Python scripts, and arc GIS. So the point of showing you this isn't to make you read this code right now, it's more to show you what's possible. That you can translate from a model where you can build your algorithm, directly into Python code where I can enhance this into a much bigger script or incorporate certain parts of this into other code I have. Maybe just to reuse some steps that I've made. So again, we've seen two things in this video. We've seen that there are a bunch of tools that are specific to Model Builder and to creating complex advanced models that can iterate through your features, or run multiple times on the same datasets. And then we can also export our models to Python so that we can edit them as computer code, or incorporate them into other code we have. Okay, that's it for this time, and for our work on Model Builder. I hope you enjoyed the videos, and I hope you enjoyed the assignments for this module in building your own model. It'll be on building a work flow that you have done before without Model Builder. So it could be kind of nice to see how to do it manually verses how to make a model builder work flow that does it for you. Okay see you next time.