Getting Color index >7 in Combo box - Color

Started by copter, May 27, 2009, 01:35:46 PM

Previous topic - Next topic

copter

Hello

I can set a color to a Combo box:
(defun set_color (ctrl coul)
  (if (not (dcl_ComboBox_FindColor mycbox color))
    (dcl_ComboBox_AddColor mycbox color)
  ) 
  (dcl_ComboBox_SetCurSel mycbox (dcl_ComboBox_FindColor mycbox color))
)
Now I want to write a get_color function.
But how can I get the acad color index, when the color index is > 7 ?
I tried with (dcl_ComboBox_GetEBText mycbox) but how can I manage the results since ODCL is localized ?
I mean "Color 130" can be "Couleur 130" and 'Green" can be "Vert" or "GrĂ¼n" and so on ...
Thanks for your help !
Copter

owenwengerd

Try the (dcl_ComboBox_GetItemData) function. This should return the AutoCAD color number.
Owen Wengerd (Outside The Box) / ManuSoft

copter

I tried it:
dcl_Control_GetItemData returns nil while dcl_ComboBox_GetCurSel returns 0 and dcl_ComboBox_GetEBText returns "Color 130" ...
Any idea ?

copter

OK I get it:
(dcl_ComboBox_GetItemData Mycbox ItemIndex) -> It works now !

Thanks for your help !