Problems when adding list to a listbox

Started by Danell, October 16, 2008, 08:51:51 AM

Previous topic - Next topic

Danell

I'm pretty new at OpenDCL. I'm creating a dialog where you can preview and insert blocks in a folder. But when I try to add the list via LISP to my listbox I get an OpenDCL Runtime error message that says.

Error: NIL value not allowed.
Function: dcl_ListBox_Addlist.
Argument 0.

My list do not contain NIL and I have tried several lists. I use AutoCad 2009 together with OpenDCL 5.0.0.25.

I hope someone can help me out.

Fred Tomke

Hello Danell and welcome,

I'd like to help you. But I need so more information. Would it be possible to upload the project file and the source code?
You can also send it to f.tomke@opendcl.de of you don't like to publish.

Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Fred Tomke

Just to your knowledge: to avoid that I ask several things not knowing to come closer to the reason it should be easier to send me the sources. Then I can tell you why much more easier.
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Danell

Thank you for trying to help. Actually I solved the problem. The AddList function wasnt placed under OnInitialize. But now I have a new problem. I can not get the drawing that I want to preview to show up in the dwgPreview window unless I put it under OnInitialize. But even then it will not update when I make a new selection in my Listbox.
The code for previewing the dwg looks like this:

(defun c:OFRdesign_FRdesign_FR_List_OnSelChanged (nSelection sSelText /)
 
  (dcl_DwgPreview_LoadDwg OFRdesign_FRdesign_DwgPreview1 "C:\\test\\GA.dwg")

)

The GA.dwg is not the actual drawing I want to show (it is not member of the list). I am just trying to show any drawing at all, for examplw c:\\test\\GA.dwg

Thanks

Fred Tomke

Hi, Danell, does this file have a preview? As far as I know a preview is needed for this.
Make sure that your project has been reloaded after activating the event OnSelChanged and saving the project file.
Reloading with (dcl_project_load "OFRdesign" T)
Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

Danell

Do I need to create the preview manually in some way you mean before I display it in the prevew window? Like I said, I can see a preview of the file if I put the code under OnInitialize, but nothing happens when I click the listbox.

Danell

Fred Tomke

Hello,

the preview of the dwg will be stored when you save the drawing and the systemvariable RASTERPREVIEW is set.
But I'm not sure that I'm on the right path 'cause you say that the preview of this file will be shown if you set the drawing in the OnInitialize function.  :-\ It should work so as you wrote. You code seems to be correct. Would you update the project, the code and the dwg for some tests?

Fred

Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]