The title of this video is Input Processing Output. And we're going to dive a little bit deeper into those subjects. We'll start with the code that we were looking at in the last video, sometime when you're typing the code, you might want to leave little notes to yourself or maybe another programmer in the code. And we can do that through writing something called comments. So anything that's followed by hashtag in our code becomes a comment and its color becomes green. So here I could say, this is the area of the code that I collect my data in, this is the area of the code that I print my results. I usually put a title up at the top or who wrote the code, when it was last edited, if I want to, your import modules. If you want to put in multiple lines of comments you can, you'll need to put another hashtag in to do that, so, they're very useful parts of the code. The other thing that you'll start to notice, and you'll notice this more as we write more code, is that the editor automatically colors certain words that we use, certain colors, and it does that automatically so it's going to color all comments green. Some Python functions will be this sort of middle color blue, this sort of sea blue, all the RhinoScript functions will show up as this dark blue. Some Python functions will be that dark blue, this sort of middle sky blue for raters, and it just does that by default, it aids to the legibility of the code. So when I look at a much bigger, more complex code, I'm more easily able to discern parts of the code. So this is, just talking about this sort of basic input, if I run it, it's just inputting an integer. And I can either hit enter to accept default that I have set up or I can type in something else, and it's going to print that out, whatever I input. So let's say we wanted to input a piece of data. As I said, most of the functions in RhinoScript syntax that start with get are input functions. So if I type RS dot get and object that's a sort of universal input for inputting any type of geometry. So I'm going to say input, input, a box, which I haven't drawn yet. And, we'll put our string message in quotes, it turns red, and we're going to want to save that in a variable that I'll call box. And we're going to print out whatever that variable is holding. So in RhinoSpace we'll create a a box. Now in the opening lesson I talked a little bit about something called the GUID or globally unique identifier or sometimes we just usually, either we say GUID or we say ID, those are really interchangeable. Any object that I create in Rhino is automatically given an ID number. If I select that object and I type up in the command line, what, I'll get a dialog box that gives me a bunch of information about that object. So within that information is this ID number, which is automatically assigned. It's a 16 digit number that's assigned to any object that I create in Rhino. So, if I go back to my code, and if we run it. Okay, first it's asking me to input that integer. I'm just going to hit enter, and then I get the message to input a box. So it runs those pieces of code in the order that I've written them in the editor, so input a box, I select that box. And then what it prints out is that 16 digit code of that box. So, this is a pretty important distinction to make that what I actually bring into code editor is not geometry, but is a reference to geometry. So this ID is what references that box in RhinoSpace. And it's the way that the code can operate on it. So this ID carries with it a bunch of other information such as where that box is located in space, so on and so forth. If it's inert, its domains, a whole bunch of information that I can access through that reference. Now something else that's part of inputting now, I could create a curve. That curve, if I select it and type in what, that also has an ID. And another very handy thing about commenting is I can use commenting to turn off parts of the code without having to delete them. So if I comment out this line I've essentially turned it off. Now I'm also going to want to turn off this print x line too, because I would get an error because it wouldn't know what x was, because it doesn't exist because I've turned it off so I can turn off those parts of the code. There's also a quick hand for doing that in our edit menu under selection. I can, uncomment whole sections of the code, or I can comment them and there's also, a quick key selection for that, Ctrl Shift, C for commenting, and Ctrl Shift U for uncommenting. And Iactually use those, quite a bit, yeah, so Ctrl Shift, U for uncommenting Ctrl Shift C for commenting. Okay, so I'm going to run this again. So it's saying input a box, but instead of selecting the box, I'm going to select the curve. And everything works fine. My code is not breaking. I'm not getting an error. And it's printing out, if I went back and sort of double check this, what it's printing out is the ID of that curve. Now, I asked for a box here. So when I type a message into a function there's nothing functional about that message relative to the data that's being input. So just because I call it a box here, doesn't mean I'm going to select a box. Now if I'm using this input get object as a sort of universal input, it allows me to input any type of geometry. The problem with that is that I could select any type of geometry and maybe I want to filter that in some way. So actually part of this function allows me to do that. If I do comma rs dot filter dot then I can type in, I'm not going to type in box. Essentially what my box is, is a volume that's made up of multiple surfaces. We call that a polysurface. So I'm going to type in polysurface. So, now if I run this again and I go to select the curve, I can't select it. It's just not going to work. I could, put a box around it. It's not going to let me say to select that because it doesn't recognize that as a polysurface. I need to click on a polysurface to have it work. So this is probably the most common form of data input of geometry, is the get object. Another common one we might use is get real, and get real allows us to put in a real number, so a number with decimals number 4.561. Okay, but I haven't printed that out. I haven't told it to print out. So if I wanted to see what was being held in the variable num I would need to print it out. Let's run it again. Box number 4.36. So it prints that out. You'll also notice that I didn't put anything in here at all, but it still worked. So get functions are functions that I don't really need to put any information in for them to work, although it can be helpful if I do that, because I really want to understand what it's asking for. Now, this is as I said, these are functions. And I haven't really explained very much what these different slots are, how this is organized, why it uses parentheses say with something like print, and I'm going to talk about that a little bit more in the next video. We'll get into what really defines that. And also, how do you find this information, like how do I find these get functions or how do I understand what print does or import does? So I'm going to talk a little bit about how you access that information in the next video. Now just to end this, I'm going to do a very quick new script here. And when I want to create a new script, all I have to do is click on this little folder here, this little tab. And hit empty script, hit new and it opens up a new script. And I want this line of code, I can just do a Ctrl C to cut and paste that into this new window. So you can very easily cut and paste things from script to script and we do that quite a bit when we're coding. So I've only shown inputting really and only outputting through printing. So we printed out numbers and we've printed out the ID, which is how we get our reference, our data that we're bringing in, our geometry that we're bringing in from RhinoSpace into Python space. So, what does it mean when we output geometry? Well I could write, access a simple Rhino function called AddLine. So I'm going to create a line and we're going to create a line goes between two points. Points are defined by XYZ coordinates in space. And so I'm going to go from the World Coordinate center zero comma zero comma zero to 10 in the X and 10 in the Y, and we'll keep it flat on the C plane, we'll do zero in the Z. So I'm going to add a line from the World Coordinate Center to that point. If I run this, See, it's closed the window really quickly. Let's get rid of this. Closed the window really quickly, and it drew that line, okay? And we're going to just going to loop Let's delete all these. Okay we'll do that. I'll run that again, because if you blinked, you'll probably missed it. So run it again. And there it is, its created that line. Now I've generated that line but I haven't saved. I haven't saved the reference for that line in my code. And if I want to do that, I need to create a variable to do that. So we'll just quickly create a variable called line and then I'm going to print out whatever that variable is holding. So not only will we create the line, but we'll also create its reference or or save its reference within the code. Okay, so I've done two things, I've output the line in physical RhinoSpace and I've saved and also output the reference to that line in Python space. And so that dialogue between these two, inputting IDs of objects that we create in Rhino space into the code and doing something with them, and then generating new geometry and outputting it to Rhino space, but also importantly too is outputting or saving that reference within Python space and being able to use it later on in our code. Again, we're going to get into how we use something called data structures and variables and later on lists and tuples to save and move that data around in the code. So in the next video I'm going to get into how do you access some of the help functions to start to find things within the interface?