OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: scottcd on September 11, 2008, 02:15:56 AM

Title: Listbox error
Post by: scottcd on September 11, 2008, 02:15:56 AM
I have the following list of layers

!layerlist
("0" "aaaa" "bbbb" "cccc" "dddd" "ffff" "hhhh" "xxxxx" "zzzzz")

Command: (type layerlist)
LIST

I attempt to add the list to the list box using the following code

(defun c:Nortec_Layer_Control_Form1_GraphicButton12_OnClicked (/)
  (dcl_Form_Show Nortec_Layer_Control_Form2)
  (dcl_ListBox_AddList Nortec_Layer_Control_Form2_ListBox1 layerlist) 
)


I get a runtime error:
Error: NIL value not allowed
Function: dcl_listbox_addlist
Argument 0

Any ideas what I am doing wrong?

Thanks

Scott



Title: Re: Listbox error
Post by: owenwengerd on September 11, 2008, 07:42:43 AM
Scott, if this is a modal form then the (dcl_ListBox_AddList) function will not execute until after the form is closed and the value of Nortec_Layer_Control_Form2_ListBox1 is set back to Nil.  Instead, put that code in an OnInitialize event handler and enable the OnInitialize event for the form.
Title: Re: Listbox error
Post by: scottcd on September 11, 2008, 08:08:45 AM
Thanks Owen,

I hope I can keep the questions to a minimum. I appreciate the help, and hopefully others can lean from my attempts as well ;D

Cheers

Scott