Basic Lisp

Discussion in 'AutoCAD' started by Coro, Rob, Sep 4, 2003.

  1. Coro, Rob

    Coro, Rob Guest

    I'm trying to write a basic lisp routine but i'm struggling with one
    command:
    (command "explode" "all") - it doesn't select all the objects.

    when i type in: explode it comes back with Select objects: (multiple)
    however when i run my routine it only asks for Select object: (single)

    any ideas?
     
    Coro, Rob, Sep 4, 2003
    #1
  2. Coro, Rob

    bestafor Guest

    HiHo;
    Check "pickadd" and "pickauto" system variables
    should be 1 and 0
     
    bestafor, Sep 4, 2003
    #2
  3. Coro, Rob

    Coro, Rob Guest

    Michel, you're a star.

    Thanks buddy

    -----Original Message-----
    From: Michel [mailto:]
    Posted At: 04 September 2003 16:21
    Posted To: autocad
    Conversation: Basic Lisp
    Subject: Re: Basic Lisp


    EXPLODE behaves differently in scripts, macros and LISP routines than it
    does from the Command: prompt; it does only single objects. But there's
    a
    workaround: Before using the EXPLODE command, set QAFLAGS to 1; do your
    exploding, then return QAFLAGS to 0.

    "Coro, Rob" a ecrit :
     
    Coro, Rob, Sep 4, 2003
    #3
  4. Coro, Rob

    John Johnson Guest

    Welcome to the wonderful world of AutoLISP,

    To complete your EXPLODE ALL routine, you just
    need to insert two quotes ("") a the end of your LISP expression.

    This this is interpreted by the command line as a RETURN
    which ordinarily means "I'm done selecting things... now proceed"

    (command "explode" "all" "")

    Another nice touch is to end the expression with the (PRIN1)function,
    which causes a "carriage return" on the command line,
    moving the cursor down a line, ready for your next typed command.

    (command "explode" "all" "" (print1))

    Here's another example of a command abbreviation
    that simplifies TRIM to request only two selection picks.

    (defun C:TR ()(command "TRIM" PAUSE "" PAUSE "")(prin1))

    The PAUSE expression prompts for user input where a command would expect it.
    In this case a mouse click.

    Enjoy!

    JohnJ
     
    John Johnson, Sep 4, 2003
    #4
  5. So it must be true!

     
    Michael Bulatovich, Sep 4, 2003
    #5
  6. Coro, Rob

    P.C. Guest

    Hi

    There are several resons why Explode don't alway's work all so well .
    Each entity store the scale values case a block is inserted with different xyz
    values and if several differently scaled objects is in a block you will need to
    make each entity recalculate from these values before you can say you Exploded
    the entities.
    A known bug with ver.14 made scaled blocks explode into the original unscaled
    entities. --------- a major trouble that could best be worked around, by using
    the scale values to create a compleatly new entity and then delete the old.

    With simple entities Explode often work but the danger about it is that
    entities can be exploded into the original entities and if you model by scaling
    Solids you realy need to check what happen in your drawing.

    P.C.
    http://www.designcommunity.com/scrapbook/2000.html
     
    P.C., Sep 5, 2003
    #6
  7. Coro, Rob

    P.C. Guest

    Hi

    Well I say it like this, that I payed for these experiences while forming a boat
    hull, it somtimes is an idear, to make the mesh entity into a block and then
    inserting it with slight adjustments for instance making the hull one foot
    longer , wider or deeper.
    What I encountered was to acturly plot the unfolded panels from a design trimmed
    like this, scrapping the lot of panels cut , as when I exploded the new block it
    was exploded back into the original mesh entity as before it was placed as
    unequal block insert.
    ----------- took a week to find out what acturly happened and double check from
    now two sets of drawings , and that's what acturly happened ; the exploded block
    lost the scale information when exploded so I unfolded the original but wrong
    hull panels.
    Solution was an application, that "looked" at the scale information , ---- was
    it code 42 - 45 entity sublist , don't remember , but I still use this
    application, that I made acturly create a new entity , by mapcar multiply ,down
    all point information , all way thru the mesh entity, make the resulting new
    entity into a new block, that exploded would explode right.
    The life of a boatbuilder ;))

    Anyway all those designs where quite a few was build is now free-download ;
    http://groups.yahoo.com/group/Cyber-Boat/

    P.C.
    Have a nice day.
     
    P.C., Sep 5, 2003
    #7
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.