TheSwamp

Code Red => Visual DCL Programming => AutoLISP (Vanilla / Visual) => OpenDCL => Topic started by: Chris K on May 02, 2011, 02:02:08 PM

Title: Issue with dcl_ComboBox_SetCurSel
Post by: Chris K on May 02, 2011, 02:02:08 PM
I'm using OpenDCL to manage layer modifiers by discipline and subdiscipline.  As part of the the initial setup I set the current selection to the discipline and subdiscipline for the current drawing.  All works great until the discipline is the last one in the list.  Then, the next to last item is set active and you are not allowed to select the last item.

Code: [Select]
;; fill cboDiscipline
(defun Fill_cboDiscipline (/ cboList discipline)
  (dcl_Combobox_Clear LayerToolsForms_frmSetSystem_cboDiscipline)
  (setq discipline (cdr (assoc "Disc" (cdr (getfileinfo))))
cboList    (acad_strlsort
     (mapcar
       'car
       (GetDisciplineListByName)
     )
   )
  )
  (if (/= nil cboList)
    (progn
      (dcl_Control_SetList
LayerToolsForms_frmSetSystem_cboDiscipline
cboList
      )
      (if (member discipline cboList)
(dcl_ComboBox_SetCurSel
  LayerToolsForms_frmSetSystem_cboDiscipline
  (- (length cboList) (length (member discipline cboList)))
)
(dcl_ComboBox_SetCurSel
  LayerToolsForms_frmSetSystem_cboDiscipline
  0
)
      )
    )
  )
 
)

Anyone else experience a similar issue?
Below are a couple of items needed to test the code.

GetFileInfo - returns a list with the following info for a drawing name "01RGA.dwg"
("01RGA"
   ("Bldg" . "01")
   ("BldgName" . "TUNNEL")
   ("Disc" . "Process")
   ("DiscAbbrev" . "R")
   ("SubDisc" . "Gases")
   ("SubDiscAbbrev" . "G")
   ("System" . "")
   ("SystemAbbrev" . "")
   ("Series" . "")
   ("Lvl" . "A")
   ("Sec" . "")
   ("SubSec" . "")
   ("Sequence" . "")
   ("SubSequence" . "")
   ("Switchboard" . "")
   ("SwitchboardSide" . "")
   ("Switch" . "")
   ("Column" . "")
   ("LookingDir" . "")
   ("DrawingType" . "Process Gases Base File")
   ("DrawingTypeID" . 1.0)
   ("IsBaseFile" . T)
   ("IsBaseGrid")
   ("IsSection")
   ("IsBaseBuildFile")
   ("IsWorkorder")
   ("IsXSheet")
   ("IsHookupFile")
   ("IsDetail")
   ("IsSUD")
   ("IsCover")
   ("IsPlan")
   ("IsPartial")
   ("IsTemp")
   ("IsModel")
   ("IsPOC")
   ("IsOp")
   ("IsDemo")
   ("IsUnderground")
   ("IsUnnamed")
   ("IsError")
   ("ErrorMsg" "")
)

GetDisciplineListByName - returns a list with the following info:
(
   ("Life Safety" . "B")
   ("Civil" . "C")
   ("Fire Protection" . "F")
   ("Plumbing" . "P")
   ("Process" . "R")
)
Title: Re: Issue with dcl_ComboBox_SetCurSel
Post by: jbuzbee on May 03, 2011, 11:04:40 AM
What version are you using?  I'm not aware of this problem.

Please post this here: http://www.opendcl.com/forum/ (http://www.opendcl.com/forum/)
Title: Re: Issue with dcl_ComboBox_SetCurSel
Post by: Chris K on May 03, 2011, 12:09:56 PM
I'm using verson 6.0.2.2.