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.
;; 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")
)