Recalling Text In a DCL, have a look

Discussion in 'AutoCAD' started by mnash, Jul 15, 2004.

  1. mnash

    mnash Guest

    I have a lisp where initially I have a DCl, where I specify variables for my routine. For example. I want to create a section and call it "A." The next one would be typically "B" and so on. In an instance where there's 20 odd sections in the one drawing, sometimes by mistake there are two "J's" (for example fo course. Right now I have a DCL warning that is written later in the lisp that pops up to tell that "The section you are creating already exists. Is it possible to recall that variable in the warnig DCL so that it reads "Section "A" already exists. Does this make sense. Can it be done? Any feedback would be great.
    Cheers
    MN
     
    mnash, Jul 15, 2004
    #1
  2. mnash

    BillZ Guest

    Use the strcat function.
    i.e.
    (set_tile "alert_tile" (strcat " Section " var "already exists."))

    or:
    (alert (strcat " Section " var "already exists."))

    You'll need to set the variable when it's selected in the DCL.

    Bill
     
    BillZ, Jul 15, 2004
    #2
  3. mnash

    ECCAD Guest

    Something like this would remove the duplicates from the list.

    ..... Dialog gets 'var'
    (setq a_lst (cons var a_lst)); initial list
    .....
    (defun check_lst ( / n_lst temp_lst c ctr x)
    (setq temp_lst a_lst n_lst (cons "" n_lst))
    (setq c (length temp_lst))
    (setq ctr 0)
    (repeat c
    (setq x (nth ctr temp_lst))
    (if (not (member x n_lst))
    (setq n_lst (cons x n_lst))
    ); if
    (setq ctr (+ ctr 1))
    ); repeat
    (setq a_lst n_lst)
    ); function

    ............

    Then, you wouldn't need the message.

    Bob
     
    ECCAD, Jul 15, 2004
    #3
  4. mnash

    mnash Guest

    works perfect, thanks for the input
     
    mnash, Jul 15, 2004
    #4
  5. mnash

    BillZ Guest

    You're welcome.


    Bill
     
    BillZ, Jul 15, 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.