The programming skills starts to be essential for nowadays engineer.
The open source software create a great chance for developing automation in engineering, but also demand some programming knowledge from the structural engineers. Here I will try to slowly introduce engineers in to the basic programming knowledge. The main focus will be on the Finite Element Method in the parametric environment, but also the approach to some Eurocodes will be shown. The main programming language will be c# and python. The software in which I will be working will be the Grasshopper (add-on for Rhino) and Autodesk Dynamo.
To start our journey with programming I have to explain the main types which you will find in codes:
string - the text type, you can store letters, words or sentences in it.
For example:
string text1 = "architect is not engineer" ;
Let's try to understand this declaration of variable in C#. First we are giving the type (string) then we are setting a name (text1) the equal sign, is a sign of attribution, which attribute to the string text1 the sentence architect is not engineer. The debugger, to know were is the begging and the end of string order you to put it in "". To finish the command add ; at the end of it.
double - the number type of variable, represents a wide dynamic range of numeric values by using a floating radix point
For example:
double number1 = 12.0239123 ;
int - the number type of variable, integer
For example:
int number2 = 12 ;
So to declare the variable in c# you can use this scheme:
[TYPE] name = value ;
Comments
Post a Comment