Output from list boxes in dialog boxes

Discussion in 'AutoCAD' started by SiBanny, Jun 29, 2004.

  1. SiBanny

    SiBanny Guest

    Hi there.
    I'm trying to create a dialog box using .lsp and .dcl files (it's my first time!)
    I've managed to get the drop down list to work, referring to the values given in the LISP file, but can't get anything to actually happen once I select a value from the list. Does anyone know what I'm doing wrong???

    DCL File:

    Revisions : dialog {
    label = "Babtie Revisions" ;
    : boxed_column {
    label = "&Revision Letter";
    : popup_list {
    key = "Revisions";
    value = "1" ;
    }
    }
    ok_cancel ;
    : row {
    : image {
    key = "im" ;
    height = 1.0 ;
    width = 1.0 ;
    }
    : paragraph {
    : text_part {
    label = "Designed and Created";
    }
    : text_part {
    label = "by Simon Bannister";
    }
    }
    }
    }

    LISP file:

    (defun C:Revisions ()
    (setq rev "P1")
    (setq NAMES '("P1" "P2" "P3" "P4" "P5" "P6" "P7" "A" "B" "C" "D" "E" "F" "G" "H" "J" "K" "L" "M" "N" "P" "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z")
    )
    (setq dcl_id (load_dialog "Revisions.dcl"))
    (if (not (new_dialog "Revisions" dcl_id)
    )
    (exit)
    )
    (setq w (dimx_tile "im")
    h (dimy_tile "im")
    )
    (start_image "im")
    (fill_image 0 0 w h 1)
    (end_image)
    (start_list "Revisions")
    (mapcar 'add_list NAMES)
    (end_list)
    (action_tile
    "cancel"
    "(done_dialog) (setq userclick nil)"
    )
    (action_tile
    "accept"
    (strcat
    "(progn
    (setq rev (atof (get_tile \"Revisions\")))"
    " (done_dialog)(setq userclick T))"
    )
    )
    (start_dialog)
    (unload_dialog dcl_id)
    (if userclick1
    (progn
    (setq REV (nth REV NAMES))
    (alert (strcat "You chose revision " rev))
    (setq dlist nil
    rev (strcat "*" REV)
    file (findfile M:/Temp/CAD_Customisation/Revisions/Revisions.dat)
    fp (open file "r")
    item (read-line fp)
    )
    )
    )
    (princ)
    )
    (princ)
     
    SiBanny, Jun 29, 2004
    #1
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.