Highlight list box item

Discussion in 'AutoCAD' started by Jipthiyas, Dec 8, 2004.

  1. Jipthiyas

    Jipthiyas Guest

    I have added new items to the list box. But I do not know how to highlight any particular item through AutoLisp. Please Help..
     
    Jipthiyas, Dec 8, 2004
    #1
  2. (set_tile key position) - set_tile expects position to be a string - so use itoa to format an integer. Here is the function that I use:

    ;;(f:popset [tile key] [list of strings] [default value or list of values for multiselect])

    (defun f:popset (key lst val / i)
    (client_data_tile key (vl-prin1-to-string lst))
    (start_list key)
    (mapcar 'add_list lst)
    (end_list)
    (cond
    ((not val))
    ((and
    (= (type val) 'STR)
    (setq i (vl-position val lst))
    );and
    (set_tile key (itoa i))
    val
    );single value
    ((listp val)
    (f:remove_nils
    (mapcar '(lambda (at)
    (if (setq i (vl-position at lst))
    (progn
    (set_tile key (itoa i))
    at
    );progn
    );if
    )
    val
    );mapcar
    )
    );multiple select
    );cond
    )

    (defun f:remove_nils (lst)
    (vl-remove-if 'null lst)
    )

    Peter
     
    petersciganek, Dec 8, 2004
    #2
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.