Showing posts with label Code Examples. Show all posts
Showing posts with label Code Examples. Show all posts

15 September 2013

how to insert drawing in AutoCAD using AutoLISP

Hi friends, in this article I will explain about how to insert drawing in AutoCAD using AutoLISP.
First we know about how to insert drawing in AutoCAD. We use insert command to insert the drawing.
Enter insert command and press Enter or Space button. It will display below popup enter drawing name or browse and select your drawing and press OK button.

27 August 2013

How to give the hatch to the particular area by pick the point in AutoLISP or AutoCAD

 Hi friends, in this article I will explain about how to give the hatch to the particular area by pick the point in AutoLISP.. 
First of all open the Visual Lisp Editor in AutoCAD 
Open AutoCAD --- click on Tools --- click on AutoLISP----click on Visual LISP Editor. 

31 July 2013

How to create layers in AutoLISP and how to set the layers in AutoLISP || Working with layers in AutoLISP

Hi Friends, in this article I will explain about how to create layers in AutoLISP and how to set the layers in AutoLISP.
How to create layers in AutoLISP:
The syntax of create layer is
(command "layer" "n" [layer name] "c" [layer color] [layer name] "")

19 July 2013

How to move the dimension text with leader in AutoCAD || aidimtextmove command in AutoLISP

Hi friends, in this article I will explain about how to change dimension text  to move with leader in AutoCAD or aidimtextmove command in AutoLISP or How to move the dimension text with leader in AutoCAD.

First we know about, how dimension text to move with ladder in AutoCAD changed in AutoCAD .
Open the AutoCAD, Select Dimension text, right click on the Dimension text, and select Dim text position and Move with leader and click where to you want. The output will like below.

9 July 2013

How to Split the string using AutoLISP || how to divide the string with special character in AutoLISP

Hi Friends, in this article I will explain about how to Split the string using AutoLISP or how to divide the string with special character like comma (,), question mark (?), etc.
I explain this with small example.
Suppose you have one string and you have to split the string with “-“,for this there is no command is there in AutoLISP to split the string with special character. So I write the code for that.I think it will useful to you.

24 June 2013

Rotate command in AutoLISP || How to rotate the object in AutoCAD using Autolisp?

Hi friends, in this article I will explain about the Rotate command in the AutoLISP or AutoCAD, how to use the Rotate command in AutoCAD, how to write the code for Rotate in AutoLISP.
First we know about, how to use Rotate in AutoCAD. 
  • Open the AutoCAD, Write Rotate or ro and press enter. It will ask the following. 

20 June 2013

How to change the text in DCL (Dialog Control Language) by clicking on radio buttons using AutoLISP | Change the text in DCL

                 Hi Friends, here I will explain about How to change the text in DCL (Dialog Control Language) by clicking on radio buttons using AutoLISP.
  • I explain this with small example.
  • I have two radio buttons FPS and MKS. If I select FPS then the text have to show “HI you have selected FPS”. If I select MKS then the text have to show “HI you have selected MKS”.
  • First Open the AutoLISP Editor write the below code or copy and paste the code and save it as TXT.dcl

18 June 2013

How to get midpoint between two points in AutoCAD or AutoLISP || How to get midpoint of the line in AutoCAD or AutoLISP

                       Hi Friends, in this article I will explain about how to get midpoint between two points in AutoCAD or AutoLISP.
  • In AutoCAD we can easily get the midpoint of the line because if you select on the line then three points will select, the middle point is the midpoint of the line .
  • But if we get the midpoint of the line in AutoLISP it may difficult. For this I will give you the easiest way to get midpoint between two points in AutoLISP.
  • The below figure shows the line draw in AutoCAD if we select the line how it will show the midpoint.

10 June 2013

getfiled () function in AutoLISP

 Hi friends, in this article I will explain about getfiled ()  function in AutoLISP or how to Prompts the user for a file name with the standard AutoCAD file dialog box, and returns that file name in AutoLISP.
Name: getfiled
Syntax:
(getfiled title default ext [flag])

4 June 2013

How to write the TEXT command using AutoLISP | How to write text in AutoCAD | How to write text in different allignments using AutoLISP

                   Hi friends, in this article I will explain about how to drawtext in AUTOCAD using AutoLISP in different alignments like left to right orright to left or from middle etc.,
                   Suppose if we want to write TEXT in AUTOCAD, then we use the command text and give the starting point, height  and rotation ,then write the text and click ENTER ENTER.But there is no chance to write the text in left to right or right to left or from middle ,below the point etc.,

2 March 2013

Double-Click Dimension For DDEdit || DDEDIT not working with double-click || Double-Click with DDEDIT


                                  Hi Friends, in this article I will explain about how to put double click on textto ddedit command.
                                  It’s very difficult,type ddedit command and select text and change the text compared to double click on text and change the text.
I explained double click on text to ddedit command with screenshots see the following steps.
1. for this CUI (Customize User Interface) by typing CUI on the Command line. Then the popup will open like below.

22 June 2012

Offset in the AutoLISP and the AutoCAD


                Hi Friends, in this article I will explain about the offset in the AutoLISP and the AutoCAD.
                First of all open the Visual LISP Editor, I already explained in the previous article how to open Visual LISP Editor in AutoCAD.

15 June 2012

If and if else condition and nested if or cond in AutoLISP


Hi Friends,in this article i will explain about the if and if else condition and  nested if or cond in AutoLISP.

IF:
This is used to execute some code only if a specified condition is true.

14 June 2012

7 June 2012

How to get the path of the file in AutoLISP | How to get the path of the file in the folder in AutoLISP | How to read the data from the file in AutoLSIP.


                       Hi friends ,in this article i will explain about how to get the path of the file in AutoLISP.
                       First of all open the Visual LISP Editor,If you want to know about how to open Visual LISP Editor in AutoCAD.

Write the following code or simply copy paste the code.

31 May 2012

How to draw PLINE in AutoCAD and How to draw PLINE in AutoCAD using AutoLISP.


                    Hi Friends,in this article i will explain about how to draw PLINE in AutoCAD and How to draw PLINE in AutoCAD using AutoLISP.

How to draw PLINE in AutoCAD.

Open AutoCAD and in the command  type PL or PLINE.
It will ask

8 May 2012

how to give the hatch to the rectangle in autolisp. | Hatch in autolisp |Give hatch to rectangle in autolisp


   Hi friends ,in this article i will explain about how to give the hatch to the circle in autolisp.

In previous article i explained about how to give the hatch to the circle in autolisp.

First of all open the  Visual Lisp Editor in autocad

Open AutoCAD --- click on Tools --- click on AutoLISP----click on Visual LISP Editor .

After open the Visual LISP Editor write the following code .

how to give the hatch to the circle in autolisp. | Hatch in autolisp |Give hatch to circle in autolisp


                       Hi friends ,in this article i will explain about how to give the hatch to the circle in autolisp.

First of all open the  Visual Lisp Editor in autocad

Open AutoCAD --- click on Tools --- click on AutoLISP----click on Visual LISP Editor .

After open the Visual LISP Editor write the following code .