Civil Engineering Association

Full Version: How to start Language (C#, dot Net & VB) Study
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
@ mecheil.edwar

The Tekla is not written in C++, but in C#.

For more info go to this web page:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************


@ kvtasp

If you like to become a software developer I will suggest you to start with some teaching course. I am sure in your country there are programming courses.

Meanwhile you can go to those web pages and try self learning:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************
and here
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

Finally, no one will help you. I know that this is a hard task but, you must do it by yourself.
Sorry, you can not find any help in this forum, you should use other specialized forums for programming.
Once I have asked to open a section for programming, but that proposal has not been supported.

I wish you best in your codding and hope your dreams will become true.

Regards
Dear Friends,

I appreciate all your advise,
I know this is not a simple task to me. But I am asking to all of you bcz Everybody starting their career with some others help only. Nobody don't have any knowledge when they started to study a new thing. With the help of other people (may be a teacher, or friends or any ) only everybody can start. That is why i asked for all of your experience in this topic.Then i can collect all these for fulfilling my dream.

I know nobody will help me finally. But at starting time at least one person can help me.That one person may be all of you my dear Civilians.

I know this not the forum for programming. But my aim is to develop applications for Tekla, which is used by most of the Civil engineers for their design & detailing purpose.So i asked here. Sorry if somebody got irritation.
i am expecting some more experience from all our Civilians, who having knowledge in this topic.


Regards
I am a Civil Engineer but learned C# and VB through courses out of personal interest but haven't used anywhere. C# is the easy and interesting language to learn. People say it is similar to java in some way. Programming is not that hard. After learning the basics, start to design your programming project. Find the ways to achieve it by googling. I started my C# learning with the following book C# Console Applications -- you can practice it in most of Microsoft operating system machines as .Net framework would be installed.

Private Note:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************
Dear ,

It is purely nice & helpful advise. May be some others have this type of experience. Please share with us.

Request Note: Pls follow our forum rules while posting time.(All links should be transparent)


Regards
kvtasp,

I recently started looking into c#. I purchased the book "Visual C# Step by Step 2010" which I would recommend. It will teach you the structure of the language, but wont do much to get you thinking like a programmer working on engineering specific problems.

One thing I will say regarding programming is maybe it will be more beneficial to start with a smaller framework. I started using VBA then moved to MATLAB then to Python (where I learnt the most). Many universities are using Python for their introduction level courses as it is a pretty forgiving language to start with.

I cant help you with your end goal of programming for Tekla but I will give you this advice: Find a small project such as automatically calculating wind loads on portal frame building or something relevant to your everyday work. Every time I write a new program I learn what NOT to do on the next one.

Good luck. Learning to write your own programs is a very rewarding experience and skill that only a small percentage of civil engineers peruse (many are happy to settle with the power of Excel).

Regards, elbarto
Hello,

Regarding Tekla & C#
When I write interaction with tekla I first write a class to hold the logic and objects.
The class is part of a windows form project.
I add reference to tekla dll's as it is written in tekla api help.
After I write the whole logic and test it.
If all works well I can move forward and convert my class into a connection or macro like in tekla api help/samples.

There's nothing interesting about this or nice or .... Just work.

What you wrote in Post: #7 that text from a forum is the contents of a *.inp file.
There's no logic in it because it simply defines attributes for connections or whatever.
It is not C# code or syntax.

To learn c#, download and install visual studio express from microsoft.
Follow these tutorials:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

For a non programmer things look like this:
You start with some tools.
On top of them you build your own tool.
Your tool will be written in a language which the computer understands.

In order to write the tool you have to understand first the problem the solution and the way to implement the solution on a computer with a programming language in a windows or not environment.

Programming by itself will not provide a solution but will create a lot more problems.
Each of the new problems related to how to add numbers or how to use forms and buttons (input and output) has to be treated at a time.

Anyway start learning c# by doing things with it, solving something, programming can't be learned like history.
You might be seeing some results after a few months it mostly depends on previous programming experience.

I don't believe tekla is written in .NET because all binary files are not .NET, except for add ons.
The exe has dependency msvcp100.dll, msvcr100.dll, mfc100.dll and other alike.
I don't see dependence of mscoree.dll which is for .NET apps.
It has shw32.dll which is SmartHeap memory management. And the api is just a wrapper. It is true that they used a lot of .Net for macros, plugins and other.
If all the binary and dll files I looked at are encrypted (not obfuscated) and decrypted, JIT ed in ram at runtime it is possible to be fooled by it's protection, I don't think that's true so until someone will provide strong evidence Tekla for me is written in c++. Not that it actually matters.
@LiviuM

I just installed Tekla and I agree with you. It is written in c++.
Sorry for my mistake, I took that info from Tekla's web page.
@LiviuM

Very good advise & helpful.
Can you please let me know in which order i want to study for reaching programming of Tekla (one by one in order).That is first i want to study which language, second, third....etc. So that i can follow your advise.

Any other users can also explain this order (one by one ) through which they started Tekla programming.

Please

Regards
I recommend you C# because of visual studio 2012 express.
It is ok because it looks like c++, you write less words compared to visual basic, it's quite close to Java, and it's what tekla expects to find when it will compile it.

The thing is after you learn one language, you'll be able to learn other languages more easily.

So download and install visual studio express. You'll find Visual Studio Express for Desktop in your start menu, run it. Register it's free.
Click New Project, Select on the left Visual C# and select console application.
[Image: 74606308370888474623.png]

You will be seeing something like this:
[Image: 39721711824221615462.png]

The default colors are light theme I prefer dark so you can change the colors of all text and windows from Tools->Options-> Environment->General, Color Theme: Dark.

At the bottom of the window you will see Output or Error List, while writing stuff it's better to switch to Error List. Visual Studio will notify you of syntax errors while writing.

There's a button at top called Start, you will press that in order to start your program.
The text which starts with two slash // is called comment Visual Studio will ignore it.
Programmers use comments to remember what they wrote it happens that code becomes long so they will forgot. The same when there's more than one guy involved.
In this case my comment "//here is where you write code" it is to show you where you can write your first lines of code.

The text bla bla bla is not according to syntax and so 4 errors, Visual Studio doesn't know what bla is.

Here is a sample, to make it work just write it and run it:
[Image: 10758043899024655991.png]

First line:
1) int c;
2) c = 2;
3) int a = 5;
4) int b = a + 5;
5) Console.WriteLine©;
6) Console.WriteLine(b);
7) Console.ReadLine();

1) I defined a variable called "c" which has the integer type (remember from math classes)
2) I assigned value "2" to variable "c".
3) I defined a variable called "a", integer type and assigned value "5" to it.
4) I defined a variable called "b", integer type and assigned a value equal to a value +"5" to it.
5) I used the object called Console provided by the framework, from it I called the function WriteLine with variable c value as parameter.
Function are like in math f(x)=x+3 which means if I call in programming f(4) I will receive a value of 4+3=7.
WriteLine function has the purpose to write a value as text on the screen.
6) The same stuff but with b value;
7) I used the object called Console provided by the framework, from it I called the function ReadLine without any parameter. ReadLine waits for user to press enter. It's purpose is to pause the program until user input.

The basic variable types and more samples are here:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

Here a different sample:

Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

double result=0;
I defined a variable of type double (this is for floating point numbers).
for (int i = 0; i < 1000; i++)
translates into for i=0, while i is smaller than 1000, increment i by 1.

This means the program will repeat what's between the braces {result=result+i} for each value of i, until it reaches 1000. Then it will go to the next statement which is Console.WriteLine(result).

The for.. thing is called a loop.

There are 3 basic loops for, while, until
for is used when you know how many times you wish to repeat a statement.
while and until are used when you expect to achieve a value but don't know how many times you have to repeat a statement. while and until can lead to infinite loops (what you're seeing when software has bugs and keeps using processor at maximum but without any results or response)

So instead of the loop the above code would look like this:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************
becomes:
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************
In other words result=0+1+2+3+...+998+999
From math this is 999*(999+1)/2=499500

What computer does is to increment each step the variable i with 1. Check if it's new value is smaller than limit i<1000 and if it is add it to variable result.

Because the variable result is defined before the loop it's value will be kept each time.
So the code will in fact look like this
i=0;
if(i<1000)
{
result=result+i;
}
i=i+1;
if(i<1000)
{
result=result+i;
}
....

More about loops
Code:
***************************************
Content of this section is hidden, You must be registered and activate your account to see this content. See this link to read how you can remove this limitation:

http://forum.civilea.com/thread-27464.html
***************************************

You can add breakpoints like below:
[Image: 97893101992081793102.png]

Visual Studio allows you to run the application step by step in order to see how the code behaves, how variables change values. In loops this is very useful, you can identify mistakes.

In case you're not interested to run the whole program step by step you can add breakpoints by clicking on the left side of the code area, the red bubble in the picture above is obtained like that.

The program will run until a breakpoint is reached, you can click on Continue button (the previous start button) to jump to the next breakpoint or click Debug->Step Into to run it step by step. There's a keyboard shortcut F11.

At the bottom instead of the errors window you can see the Locals.
It contains a list of your variables and their values.
If you move the mouse over variables or operations you can see the current and future values. You can even check i<1000 it will tell you if it's true or false.

You can remove breakpoints the same way you add them.

I hope the reader will find this useful and proceed further.
@LiviuM,

Dear LiviuM,

You done very good & highly appreciable help for me & other users for this language study.I am taking this time to give my sincere thanks to you.

I will try with your suggestion.

If somebody have anymore suggestion in this topic, please reply.


Regards
Pages: 1 2 3