OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: dsm_dude on June 16, 2021, 02:28:51 PM

Title: Create List from txt file
Post by: dsm_dude on June 16, 2021, 02:28:51 PM
I'm looking for a way to populate a listbox with the first line of a txt file (attached).


Now this might be the tricky part.

I have another listbox that have a list based off my txt files. I would like the ListBox2 to load based off the corresponding ListBox1 selection.
(dcl-ListBox-AddList Steel2D/Form1/ListBox1 (list "HM" "HN" "HW" "I" "HT" "TM" "TN" "TW" "C" "L" "CHS" "RHS" "SHS"))

For example, when I select "HM" in ListBox1 it will Load "HM.txt" (which is attached) into ListBox2.

Title: Re: Create List from txt file
Post by: diogenes on June 17, 2021, 01:17:52 AM
You can use the "onselchanged" event in ListBox1 to update ListBox2 as needed.
Title: Re: Create List from txt file
Post by: dsm_dude on June 17, 2021, 04:19:13 AM
How do I go about populating the listbox from the text file?

This is where I'm currently stuck.
Title: Re: Create List from txt file
Post by: diogenes on June 22, 2021, 03:25:48 AM
1.- Clear list box to be filled
2.- read the txt file and select the data you want
3.- fill the list box.