Author Topic: Read SDF files  (Read 5023 times)

0 Members and 1 Guest are viewing this topic.

jonathann3891

  • Mosquito
  • Posts: 9
Read SDF files
« on: June 16, 2021, 11:38:54 AM »
I've created a few simple dialog boxes with OpenDCL and now I'm ready to dive a little deeper.

Can OpenDCL read SDF files?

Can I display different SDF files based on a selection in a listbox?
Code: [Select]
(dcl-ListBox-AddList Steel2D/Form1/ListBox1 (list "HM" "HN" "HW" "I" "HT" "TM" "TN" "TW" "C" "L" "CHS" "RHS" "SHS")
So if I pick "HM" then it will display the data from "HM.SDF".

jonathann3891

  • Mosquito
  • Posts: 9
Re: Read SDF files
« Reply #1 on: June 16, 2021, 02:25:46 PM »
I believe I need to use the "SelChanged" event for the listbox.

I can get the index of the item using
Code: [Select]
(defun c:Steel2D/Form1/ListBox1#OnSelChanged (ItemIndexOrCount Value /)
  (setq CurSel (dcl-ListBox-GetCurSel Steel2D/Form1/ListBox1))
  )

I need the text value. How can I get that? I've tried different variations with
Code: [Select]
dcl-ListBox-GetItemText
Do I need to combine these two functions? If so what the correct way to do so?

jonathann3891

  • Mosquito
  • Posts: 9
Re: Read SDF files
« Reply #2 on: June 17, 2021, 08:49:05 AM »
I got everything in my second post working.

The part I'm really struggling with is creating a list form the text file and populating ListBox2.