List question

Discussion in 'AutoCAD' started by Matt W, Nov 18, 2004.

  1. Matt W

    Matt W Guest

    I'm using the following snippet of code to populate a DCL list box.

    Code:
    (setq BlockList (vl-directory-files "s:/cadd/fittings/" "*.dwg"))
    (start_list "lstValves")
    (mapcar 'add_list BlockList)
    
    It works great, but I'd like to be able to trim the extension from each item
    in the list and I'm not quite sure of the best way to go about it.
    I tried something but ended up in what seemed to be an endless loop.
    I had to give ACAD a three-finger salute (CTRL+ALT+DEL).

    Also, I've heard some nasty rumors about mixing LSP and VLISP and how it's a
    big "NO NO".
    Is this true and if so, what are the "side effects" of mixing the two??


    Thanks in advance!
     
    Matt W, Nov 18, 2004
    #1
  2. Trimming the extensions is easy, as an example:

    (mapcar
    'vl-filename-base
    (vl-directory-files
    (getvar "dwgprefix")
    "*.dwg") )

    As for mixing flavors, I believe the biggest problem
    with using hybrid code depends on what version of
    AutoCAD and if you are using reactors.
     
    Jason Piercey, Nov 18, 2004
    #2
  3. Matt W

    Jürg Menzi Guest

    Hi Matt

    (mapcar 'add_list (mapcar 'vl-filename-base BlockList))

    Cheers
     
    Jürg Menzi, Nov 18, 2004
    #3
  4. Matt W

    Matt W Guest

    Oh... Well I'm using 2005 but I don't use any reactors.
    So I guess I'm safe??!

    Thanks for the quick reply, Jason.

    --
    I support two teams: The Red Sox and whoever beats the Yankees.

     
    Matt W, Nov 18, 2004
    #4
  5. I'd say safer than previous versions and you
    are welcome.
     
    Jason Piercey, Nov 18, 2004
    #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.