TheSwamp

Code Red => Visual DCL Programming => AutoLISP (Vanilla / Visual) => OpenDCL => Topic started by: jonathann3891 on June 16, 2021, 11:38:54 AM

Title: Read SDF files
Post by: jonathann3891 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".
Title: Re: Read SDF files
Post by: jonathann3891 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?
Title: Re: Read SDF files
Post by: jonathann3891 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.