Return value after command?

Discussion in 'AutoCAD' started by mnelson, Apr 21, 2004.

  1. mnelson

    mnelson Guest

    I'm a little rusty in the LISP. How do I get this routine to return the PLINEWID value after the p-line command is complete?

    Thanks

    (defun c:BPL (/ PLW)
    (setq PLW (getvar "PLINEWID"))
    (setvar "PLINEWID" 3.5)
    (command "pline")
    (setvar "PLINEWID" PLW)
    )
     
    mnelson, Apr 21, 2004
    #1
  2. mnelson

    Jeff Mishler Guest

    First, the lisp command will complete prior to running the "pline" command
    unless you give the command to pause for user input. Second, just use the
    variable PLW as the last line in the function.

    (defun c:BPL (/ PLW)
    (setq PLW (getvar "PLINEWID"))
    (setvar "PLINEWID" 3.5)
    (command "pline")
    (while (> (getvar "cmdactive") 0)
    (command pause)
    )
    (setvar "PLINEWID" PLW)
    (princ (strcat "\nPline width restored to: " (rtos plw)))
    (princ)
    )

    HTH,
    Jeff

    PLINEWID value after the p-line command is complete?
     
    Jeff Mishler, Apr 21, 2004
    #2
  3. mnelson

    mnelson Guest

    Thanks a bunch Jeff! You made that fast and easy. I though WHILE was involved somehow.
     
    mnelson, Apr 21, 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.