My way of doing select an item
Code:
; thanks to Lee-mac for this defun
(defun csv->lst ( str / pos )
(if (setq pos (vl-string-position 32 str))
(cons (substr str 1 pos) (csv->lst (substr str (+ pos 2))))
(list str)
)
)
(setq fo (open "c:\\Cad_Support\\acb2-3xxx-series.txt" "R"))
(setq lst '())
(while (setq newline (read-line fo))
(setq str (csv->lst newline))
(setq str2 '())
(foreach val str
(if (= (strlen val) 0)
(princ)
(setq str2 (cons val str2))
)
)
(setq str2 (reverse str2))
(setq lst (cons str2 lst))
)
(close fo)
(setq lst (reverse lst))
(setq lst2 '())
(foreach val lst
(setq lst2 (cons (car val) lst2))
)
(if (not AHlstbox)(load "Listbox-AH.lsp"))
(setq num (ahlstbox "Pick a bearing " lst2 20 20))
; num is item n in list
(setq bcode (atoi(nth 0 (nth num lst))))
(setq di (nth 1 (nth num lst)))
(setq do (nth 2 (nth num lst)))
(setq b (nth 3 (nth num lst)))
(setq r1 (nth 4 (nth num lst)))
(setq a (nth 5 (nth num lst)))
screenshot434.png