

AutoLisp uses parentheses to nest, allowing you to write a command that acts on (evaluates) another command. All commands are surrounded by parentheses. Parentheses are vital to writing AutoLisp programs. (prompt "This line will print") This is a commentįrom where the semicolon begins, the remainder of the line is a comment statement. A semicolon does not have to begin the line. Write notes about your program, what you are doing and what the variables are.

It is used for documentation and explanation of your program. When you begin a line with a semicolon, anything you write after will be ignored by AutoLisp. Structure your program in such a way that it is easy to understand, by yourself and everyone else. Therefore a variable can store just about anything. In AutoLisp, variables may be a collection of letters or numbers as long as they begin with the letters.Įxample of legal variables are as follows:Īn AutoLisp variable may contain more than one value in a single variable. These are like empty boxes in which to store data, to be used later. Is a pre-defined set of instructions that describes a set of actions that AutoLisp is to perform, divided into three sections:ĭraw out or write out in English what you want your program to do. Use a simple text processor such as Notepad to create and edit your lisp files. Hope this helps you and Good Luck in your Lisping - Kenny Ramage Principles of ProgrammingĪll AutoLisp programs must contain the suffix ".LSP" otherwise AutoCAD will not access them when loading. You can then lookup the relevant AutoLisp commands for a more detailed explanation.

I suggest that you go through this tutorial along with the AutoCAD Programmers Reference Guide. The thickness will be in the Z direction and visible in 3D only.This tutorial is aimed at the AutoCAD users who would like to start learning AutoLisp. Specify the length and breadth of the rectangle in the form of width.Specify the thickness of the rectangle.The steps to increase the thickness of the rectangle are listed below: We can increase the thickness of the rectangle. Width/chamfer), we need to specify the value 0 to the corresponding property of the rectangle. The rectangle formed (represented by blue lines for better visibility) is shown in the below image: Note: We can perform multiple functions on a rectangle by specifying the value for each property. Specify the line width for the rectangle.The steps to increase the width of the rectangle are listed below: We can increase the width of the rectangle. We can also change the shape according to the requirements. The rectangle formed is shown in the below image: Note: The chamfer distance for both sides should be the same to create regular shape. Specify the first corner point of the rectangle on the viewport.Specify the second chamfer distance for the rectangle.Specify the first chamfer distance for the rectangle.(Chamfers are used to create slanted edges.) The steps to create a slanted corner rectangle are listed below: The rectangles can also be created with slanted corners. We can also type Elevation or E instead of Fillet to create rounded corners. The rectangle formed is shown in the below image: Specify the first corner point of rectangle on the viewport.Specify the fillet radius for the rectangle.(Fillets are used to create round edges.) The steps to create a rounded corner rectangle are listed below: The rectangles can also be created with rounded corners. For example, 4 is the length of the rectangle, while 5 is the width of the rectangle. To draw a rectangle by specifying the length and width. Specify the second corner point (diagonally opposite to the first point) on the viewport.Specify the first corner point on the viewport.Type Rec or Rectangle in the command line and press Enter. The rectangle icon will look like the below image: Select the rectangle command from the ribbon panel.In the second method, we can create rectangles by specifying the value (length and width). In the first method, we can create rectangles randomly by specifying the points. There are two methods to draw a rectangle. The rectangle command is used to create rectangles in our drawing.
