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

Specify start point: ,pick the starting point.then it will show
       Current line-width is 0.0000
Specify next point or [Arc/Halfwidth/Length/Undo/Width]:,give w
Specify starting width <0.0000>:  , give the width like 20
Specify ending width <20.0000>: give the width like 40
Specify next point or [Arc/Halfwidth/Length/Undo/Width]: ,pick second point

          Then the polyline draw according to your points it will continue until u click on ESCAPE Button.
                 In the below figure,red curve shows  the polyline according to different widths,pink curve shows the polyline according to same widths.




How to draw PLINE 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.


(defun c:drawpline()
  (setq p1(strcat "0" "," "0" )
            p2(strcat "200" "," "100"))
  (command "PLINE" p1 p2 "w" 20 30 "")

  )


Save the file as PLINE.LSP
Then  write the below line in the AutoCAD Command prompt.

Command: (load “DrawPLINE”)
Command:DRAWLINE
  
The below figure shows the output of the above program.


      
There is a another way to write the pline with single point.


(defun c:drawpline()
  (setq p1(strcat "0" "," "0" ))
 (command "PLINE" p1 (strcat "@" (rtos 150) "<225") "w" 10 30 "")
  )

Thanks for reading my blog.I think it will may useful to you.

No comments:

Post a Comment