Author Topic: display a list in a dialog box  (Read 1727 times)

0 Members and 1 Guest are viewing this topic.

psuchewinner

  • Guest
display a list in a dialog box
« on: May 10, 2010, 08:36:07 AM »
Say I have a list:
("AAAAA";"BBBBB";"CCCCC")
and I want to display it in a dialog box, on separate lines.....how do I do it?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: display a list in a dialog box
« Reply #1 on: May 10, 2010, 08:51:01 AM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

psuchewinner

  • Guest
Re: display a list in a dialog box
« Reply #2 on: May 10, 2010, 10:31:31 AM »
That will get me to where I need to go.  Thanks for the "nudge".

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: display a list in a dialog box
« Reply #3 on: May 10, 2010, 11:09:11 AM »
Please ask if you need any more assistance.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

psuchewinner

  • Guest
Re: display a list in a dialog box
« Reply #4 on: May 10, 2010, 11:23:38 AM »
Im stumped again.  I can get the dialog up and display stuff ok but what I am actually trying to do is list the "support path directories" in a dialog box.  I can get them in a list ok by accessing them through the "prefs" object, but in the resulting list they are separated by semicolons.  How do i filter the semicolons out and show each directory separately?

(vl-load-com)
  (setq AcadObject (vlax-get-acad-object))
  (setq PrefsObject (vlax-get-property AcadObject 'Preferences))
  (setq TabNameObject (vlax-get-property PrefsObject 'Files))
(setq ThePath (vlax-get-property TabNameObject 'SupportPath))

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: display a list in a dialog box
« Reply #5 on: May 10, 2010, 11:26:01 AM »
Something like:

Code: [Select]
(defun StringParser (str del)  ; Lee Mac
  (if (setq pos (vl-string-search del str))
    (cons (substr str 1 pos)
          (StringParser (substr str (+ pos 1 (strlen del))) del))
    (list str)))

Code: [Select]
(StringParser "Lee;Mac;is;cool" ";")
==>  ("Lee" "Mac" "is" "cool")

Oh BTW,

You can get at the Support Paths using:

Code: [Select]
(getenv "ACAD")

:-)

psuchewinner

  • Guest
Re: display a list in a dialog box
« Reply #6 on: May 10, 2010, 12:00:06 PM »
Thats what im after...thanks!

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: display a list in a dialog box
« Reply #7 on: May 10, 2010, 12:05:16 PM »
You're very welcome :-)

efernal

  • Bull Frog
  • Posts: 206
Re: display a list in a dialog box
« Reply #8 on: May 10, 2010, 03:12:56 PM »
Here is an example:

....
(SETQ lista (LIST "AAA" "BBB" "CCC" "1" "2" "3" "n"))
(START_LIST "list" 3)
(MAPCAR 'ADD_LIST lista)
(END_LIST)
....

e.fernal
e.fernal