lisp problem

Discussion in 'AutoCAD' started by Pete, Jun 25, 2003.

  1. Pete

    Pete Guest

    I have:
    (setq ssl (ssget "X" '((0 . "INSERT"))))

    I get:
    a selection set of all blocks in the drawing.

    My problem:
    If I put this lisp line after the one above:
    (command "explode" "p" "")
    I get an error: *Invalid Selection* Expects a point or Last/All/Group

    However, if I type the following on the command line after executing the
    first lisp line (ssget):
    explode <enter> p <enter><enter>
    The set of all blocks is exploded.


    Why does explode, previous, work on the command line and not in the lisp
    code?
     
    Pete, Jun 25, 2003
    #1
  2. Pete

    Pete Guest

    What I meant to say is that the explode command has the selection option,
    "previous" when used on the command line but when using it in lisp code, it
    does not appear to have have that option (along with a few other options)

    Anyway, thanks for the help. It works fine. I simplified the loop a bit:

    (setq ssl (ssget "X" '((0 . "INSERT"))))
    (setq cont 0)
    (while (ssname ssl cont)
    (command "_explode" (ssname ssl cont))
    (setq cont (+ 1 cont))
    )

    Regards,
    Pete
     
    Pete, Jun 25, 2003
    #2
  3. Pete

    Pete Guest

    Thanks for the tip. It works fine now after I simplified the code a bit:

    (setq ssl (ssget "X" '((0 . "INSERT"))))
    (setq cont 0)
    (while (ssname ssl cont)
    (command "_explode" (ssname ssl cont))
    (setq cont (+ 1 cont))
    )

    What I meant to say is that the explode command has "previous" for selection
    option when used on the command line. When explode is used in lisp code,
    the previous option does not function( along with a few other options also).

    Regards,
    Pete
     
    Pete, Jun 25, 2003
    #3
  4. Pete

    Pete Guest

    Ok, this is typical Autodesk. Not only is QAFLAGS not documented anywhere
    in the help files, it is not even listed when using * in the setvar command.
    Yet there it is when I enter it on the command line. Anyone care to offer
    an explanation of the function of this mystery variable?
     
    Pete, Jun 26, 2003
    #4
  5. But be careful using the QAFLAGS system variable - if it is not set to 0
    it causes some errors.

    Juergen
     
    Jürgen Palme, Jun 26, 2003
    #5
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.