Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to draw a polyline in lisp

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
253 Views, 6 Replies

How to draw a polyline in lisp

I am new at this, can somebody please help.
here is my lisp routine:

(defun drawPline()
(setq p (getpoint "\nPlease Select Starting Point: "))
(command "pline" P)
)

the result i got is this:

Command: (drawPline)

Please Select Starting Point: pline
Specify start point:
Current line-width is 0.0000
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: nil

Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]:

is there a way to make it so that i would get only this:

Command: (drawPline)
Please Select Starting Point:
Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]:

Since the first point was already asked, I do not want to see it again in the command-prompt. Also I do not understand why 'nil' is on the first 'Specify next point' line.

Any help is appreciated.
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

(defun C:drawPline (/ cmde p)
(setq cmde (getvar "cmdecho")
p (getpoint "\nPlease Select Starting Point: "))
(setvar "cmdecho" 0)
(command "_.pline" P)
(setvar "cmdecho" 1)
(while (= (logand (getvar "cmdactive") 1) 1)
(command pause))
(setvar "cmdecho" cmde)
(princ)
)
___

"rchiu2001" wrote in message
news:f091a46.-1@WebX.maYIadrTaRb...
> I am new at this, can somebody please help.
> here is my lisp routine:
> (defun drawPline()
> (setq p (getpoint "\nPlease Select Starting Point: "))
> (command "pline" P)
> )
>
> the result i got is this:
>
> Command: (drawPline)
>
> Please Select Starting Point: pline
> Specify start point:
> Current line-width is 0.0000
> Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: nil
>
> Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]:
>
> is there a way to make it so that i would get only this:
>
> Command: (drawPline)
> Please Select Starting Point:
> Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]:
>
> Since the first point was already asked, I do not want to see it again in
the command-prompt. Also I do not understand why 'nil' is on the first
'Specify next point' line.
>
> Any help is appreciated.
>
>
Message 3 of 7
Anonymous
in reply to: Anonymous

Hi Paul,

I thought for sure I would see (initget 1) worked in there. :-))

-Jason

"Paul Turvill" wrote in message
news:C82781BEE2AFE07B80B991E7F8C75752@in.WebX.maYIadrTaRb...
> (defun C:drawPline (/ cmde p)
> (setq cmde (getvar "cmdecho")
> p (getpoint "\nPlease Select Starting Point: "))
> (setvar "cmdecho" 0)
> (command "_.pline" P)
> (setvar "cmdecho" 1)
> (while (= (logand (getvar "cmdactive") 1) 1)
> (command pause))
> (setvar "cmdecho" cmde)
> (princ)
> )
> ___
>
> "rchiu2001" wrote in message
> news:f091a46.-1@WebX.maYIadrTaRb...
> > I am new at this, can somebody please help.
> > here is my lisp routine:
> > (defun drawPline()
> > (setq p (getpoint "\nPlease Select Starting Point: "))
> > (command "pline" P)
> > )
> >
> > the result i got is this:
> >
> > Command: (drawPline)
> >
> > Please Select Starting Point: pline
> > Specify start point:
> > Current line-width is 0.0000
> > Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: nil
> >
> > Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]:
> >
> > is there a way to make it so that i would get only this:
> >
> > Command: (drawPline)
> > Please Select Starting Point:
> > Specify next point or [Arc/Close/Halfwidth/Length/Undo/Width]:
> >
> > Since the first point was already asked, I do not want to see it again
in
> the command-prompt. Also I do not understand why 'nil' is on the first
> 'Specify next point' line.
> >
> > Any help is appreciated.
> >
> >
>
>
Message 4 of 7
Anonymous
in reply to: Anonymous

Oh, ok ...

(defun C:drawPline (/ cmde p)
(setq cmde (getvar "cmdecho"))
(initget 1)
(setq p (getpoint "\nPlease Select Starting Point: "))
(setvar "cmdecho" 0)
(command "_.pline")
(setvar "cmdecho" 1)
(command p)
(while (= (logand (getvar "cmdactive") 1) 1)
(command pause))
(setvar "cmdecho" cmde)
(princ)
)
___

"Jason Piercey" wrote in message
news:2C1ECCD8625EF588EFE3770B4E614174@in.WebX.maYIadrTaRb...
>
> I thought for sure I would see (initget 1) worked in there. :-))
Message 5 of 7
Anonymous
in reply to: Anonymous

... and I can *still* combine my (setq)'s ...

(defun C:drawPline (/ cmde p)
(initget 1)
(setq p (getpoint "\nPlease Select Starting Point: ")
cmde (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "_.pline")
(setvar "cmdecho" 1)
(command p)
(while (= (logand (getvar "cmdactive") 1) 1)
(command pause))
(setvar "cmdecho" cmde)
(princ)
)
___

"Paul Turvill" wrote in message
news:37C2B63FEFCE9E405CF705D2ACFA716C@in.WebX.maYIadrTaRb...
> Oh, ok ...
>
> (defun C:drawPline (/ cmde p)
> (setq cmde (getvar "cmdecho"))
> (initget 1)
> (setq p (getpoint "\nPlease Select Starting Point: "))
> (setvar "cmdecho" 0)
> (command "_.pline")
> (setvar "cmdecho" 1)
> (command p)
> (while (= (logand (getvar "cmdactive") 1) 1)
> (command pause))
> (setvar "cmdecho" cmde)
> (princ)
> )
> ___
>
> "Jason Piercey" wrote in message
> news:2C1ECCD8625EF588EFE3770B4E614174@in.WebX.maYIadrTaRb...
> >
> > I thought for sure I would see (initget 1) worked in there. :-))
Message 6 of 7
Anonymous
in reply to: Anonymous

lol :-))

-Jason


"Paul Turvill" wrote in message
news:4E3C947713A93CF7BF561D59285EDA5D@in.WebX.maYIadrTaRb...
> ... and I can *still* combine my (setq)'s ...
>
> (defun C:drawPline (/ cmde p)
> (initget 1)
> (setq p (getpoint "\nPlease Select Starting Point: ")
> cmde (getvar "cmdecho"))
> (setvar "cmdecho" 0)
> (command "_.pline")
> (setvar "cmdecho" 1)
> (command p)
> (while (= (logand (getvar "cmdactive") 1) 1)
> (command pause))
> (setvar "cmdecho" cmde)
> (princ)
> )
> ___
>
> "Paul Turvill" wrote in message
> news:37C2B63FEFCE9E405CF705D2ACFA716C@in.WebX.maYIadrTaRb...
> > Oh, ok ...
> >
> > (defun C:drawPline (/ cmde p)
> > (setq cmde (getvar "cmdecho"))
> > (initget 1)
> > (setq p (getpoint "\nPlease Select Starting Point: "))
> > (setvar "cmdecho" 0)
> > (command "_.pline")
> > (setvar "cmdecho" 1)
> > (command p)
> > (while (= (logand (getvar "cmdactive") 1) 1)
> > (command pause))
> > (setvar "cmdecho" cmde)
> > (princ)
> > )
> > ___
> >
> > "Jason Piercey" wrote in message
> > news:2C1ECCD8625EF588EFE3770B4E614174@in.WebX.maYIadrTaRb...
> > >
> > > I thought for sure I would see (initget 1) worked in there. :-))
>
>
>
Message 7 of 7
Anonymous
in reply to: Anonymous

Thanks guys, that is exactly how I wanted.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost