I can't seem to get a ListBox filled with the current views within the drawing. The code is below. What am I doing wrong? Maybe I'm just having a brain-fade.
(DEFUN C:TOOLBOX (/ fn)
(SETQ sVariable "Not set")
;;
;; Ensure the OpenDCL.##.ARX is loaded.
(OR (VL-SYMBOL-VALUE 'ODCL_GETVERSIONEX)
(AND (SETQ fn (FINDFILE "OpenDCL_ARXLoader.LSP"))
(LOAD fn (STRCAT "Failed to load :- " fn))
)
(ALERT (STRCAT "Failed to load OpenDCL_ARXLoader.LSP"))
(EXIT)
)
;;
;; Ensure the Project ODC file is loaded.
(OR (ODCL_PROJECT_LOAD "Toolbox") (EXIT))
;;
;; Show the modal dialog .. (odcl_Form_IsActive test is not required
;;
(ODCL_FORM_SHOW Toolbox_frmMain)
(LoadViews)
(PRINC)
)
(defun LoadViews ( / strViewName strViewList)
(setq strViewList (GetNames "VIEW"))
(Odcl_ListBox_AddList Toolbox_frmMain_lstViews StringList strViewList)
(princ)
)
(defun GetNames ( TableName / Data Result )
(while (setq Data (tblnext TableName (null Data)))
(setq Result (cons (cdr (assoc 2 Data)) Result))
)
)
(princ)