Continous polylines

Discussion in 'AutoCAD' started by ffejgreb, Jun 26, 2004.

  1. ffejgreb

    ffejgreb Guest

    Not looking for an answer, just direction. Also, I would prefer to stick
    with lisp, as that is what I am learning currently. Next will be Vlisp.
    This routine will be used to draw contour lines.

    How do I do the following:

    Code:
    draw a polyline of unlimited length
    when done (enter) ask to draw another one
    if yes
    reset a variable to another value (an integer)
    perform a setvar
    run another defun in the routine (possible layer change)
    draw another polyline of unlimited length
    if no - end program
    repeat until a no is encountered
    
    Thanks in advance to all,

    Jeff
     
    ffejgreb, Jun 26, 2004
    #1
  2. ffejgreb

    Paul Turvill Guest

    One approach:

    (defun c:RPOLY (/ cmde p1)
    (setq cmde (getvar "cmdecho"))
    (setvar "cmdecho" 1)
    (while (setq p1 (getpoint "\nStarting Point (ENTER when done): "))
    (command "_.pline" p1)
    (while (= (logand (getvar "cmdactive") 1) 1)
    (command pause)
    ); while
    ); while
    (setvar "cmdecho" cmde)
    (princ)
    )
    ___
     
    Paul Turvill, Jun 26, 2004
    #2
  3. ffejgreb

    ffejgreb Guest

    Thank you Paul. I wasn't sure if I should use a while or a cond statement
    to accomplish this. I haven't been able to get a good handle on making
    while work just yet. I will keep plugging away.
     
    ffejgreb, Jun 28, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.