From the course: Grasshopper and Rhino: C# Scripting

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Variables

Variables

From the course: Grasshopper and Rhino: C# Scripting

Start my 1-month free trial

Variables

- [Instructor] In C sharp, we use variables to store information. Variables are simply identifiers, that point to a reserve space in memory in which we can store values or data such as numbers, letters or objects. Every time we create a new variable, we're essentially reserving a space in memory to store something. Think of a variable as a bucket, which can store whatever object we like. Whenever we need to find some piece of data, we simply look at the appropriate bucket or variable, which contains the value. In a new grasp of fall. Let's go ahead and place a new C sharp component and then open it up. Within the run script method of our component, let's start by creating our first variable, which will store reference to a new point. To create a variable we need to start with the type of object it will store. A C sharp is what we call a statically-typed language. Meaning the variable data type needs to be…

Contents