Tag Archives: line


NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/books/nanocad/

At the bottom side you will also see command line bar where you can see the commands you entered. Command is a way of interacting with nanoCAD. Instead of selecting the command on screen from bars, you can write command here. On top section of command line bar, you will see the history of commands and bottom of bar you see the command you are entering now.

Click “Ctrl+N” or “File>Open” to open a new nanoCAD drawing. You see now your bars are activated to get your commands and you now have a “+” shaped arrow on black side of the screen.

If you still have “inspector” bar on the left opened, you may close it for now, we will get into deep with it later. 

You see that on the left bottom side you have x, y and arrows. This is for axis system. x-y axis system is used throughout the drafting. This is to define how much where you need to draw a line etc. Software actually can’t understand you by words but it actually understands if you say “draw a line with 5mm to the x direction”. 

So, let’s do it.

Write “l”. You see now that the command line is waiting for you to specify the first point.

Here you can write 0,0 to say the program that you want to start to draw a line starting from x=0 and y=0.

Now you can see also that you can see the line is going through your +. You need to enter the next point as the command line asks you. Here you get it that you can also click to specify the second point, or you can write the point as we did here. While selecting freely you can see that on the bottom left side some numbers are changing; 

Here the first number is the length of the line and the second one after “<” is the angle from the axis. 

So, write to command line 5,0. And click “enter” on your keyboard. So, it has finished the drawing line. So, if you can’t see the line don’t worry it is under the axis system arrows. To see it you need to “zoom in”. To zoom in you can use the wheel on your mouse. 

As you zoom in you see the line under x-y axis is coming on screen. This is because as you zoom in the length of the x-y axis symbol does not change but the lines you draw will change. Anyway, you are getting used to with the environment fast. You can now want to see other sides of the screen. What you do with a real piece of paper? You can pan it right? Here at nanoCAD you can easily do it by using wheel button. By clicking on wheel, you see that your pointer on screen changed to hand. 

With this state you have ability to pan the drawing anywhere you want so that you can easily get a better view of your drawing. 

So, these two movements at the nanoCAD, are very much used pan and zoom in/out. You can use them as much as you can so that you can easily see the drawing you draw. 

If you double click the wheel button, nanoCAD automatically centre the drawing you drew. 

At NanoCAD there are more than one way generally. Other easy and fast way to draw a line is to click to the first point and move your pointer to the direction you want to draw the line, 

As you can see it will also show you the direction that it will draw the line. Then you can just enter the length from keyboard, so enter 5 and enter. So, you get the idea. 

NOTE: You may buy this course in paperbook book format from https://www.amazon.com/Learn-Drafting-NanoCAD-5-0-ECO/dp/B08Y4HB68H/ref=mp_s_a_1_3?dchild=1&keywords=nanocad&qid=1633261854&sr=8-3


Since we learned basic input function at programming with C++, we need to talk a little more about the variables. 

Variables are simply naming some data location in your pc. With variables you can store a value. 

Variables can be global, local or block based. Actually, you can use the same variable name in these locations at the same time. 

  1. #include <iostream>
  2. using namespace std;
  3. int sameVar=1; //defining a global variable at header location
  4. int main(){
  5.     int sameVar=2;    //defining a local variable inside int main
  6.     cout<<“local variable:”<<sameVar; //printing a local variable in int main 
  7.     {
  8.     int sameVar=3; //here we define a variable in any block. 
  9.     cout<<“block variable:”<<sameVar; //printing the block variable
  10. }
  11. //reaching a global variable inside program
  12. cout<<“global variable:”<<::sameVar; //we print global variable in a program
  13. }


Here the most important thing we need to talk is the 

variable = value logic. 

Always variable is on the left and the value is on the right of the equivalent sign. 

TEA BREAK WITH C++: Basic Input & endl

On line 9 in the previous example we give 

    int firstNumber, secondNumber, sum;

We define integer variables. These are first number with the definition firstNumber, and the second number defined as secondNumber. And the sum. These we defined as integer by writing “int” at the beginning.  

Continue reading TEA BREAK WITH C++: Basic Input & endl

TEA BREAK WITH C++: Paragraph Comments (Multiple Line Comment)

NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/

Another type of comment is paragraph comment (or multiple line comment) where you start commenting with “*/” and end with “/*”

Continue reading TEA BREAK WITH C++: Paragraph Comments (Multiple Line Comment)

TEA BREAK WITH C++: Line Comments

NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/

The “//” sign means you are adding a comment. This is called line comment. The things you write after these “//” will not be taken as a command (means these things will not be compiled). It is always a good approach to write down the properties of the code at the beginning like author, for which aim this code is written etc. 

Continue reading TEA BREAK WITH C++: Line Comments