OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: zeeboy on June 19, 2009, 12:07:31 PM

Title: (dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) = nil
Post by: zeeboy on June 19, 2009, 12:07:31 PM
(dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) is returning nil for me.  It should return the Default LineWeight according to the help file.

Any suggestions?

Thanks!
Title: Re: (dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) = nil
Post by: owenwengerd on June 19, 2009, 07:50:04 PM
That's a documentation error. The "Default" lineweight has a value equal to whatever the default lineweight is, so a value of -3 will never be found in the list. I will correct the documentation by removing -3 from the table.
Title: Re: (dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) = nil
Post by: Fred Tomke on June 20, 2009, 02:17:53 AM
Quote from: owenwengerd on June 19, 2009, 07:50:04 PM
I will correct the documentation by removing -3 from the table.

That would be bad. Why shouldn't it be possible to select the value -3 for Default as it could be selected from the dropdown in the layer properties manager?

Fred
Title: Re: (dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) = nil
Post by: owenwengerd on June 20, 2009, 12:20:22 PM
Fred, the Default value is still there, and it can still be selected either by the user or by SetCurSel.
Title: Re: (dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) = nil
Post by: Fred Tomke on June 21, 2009, 04:38:28 AM
Quote from: owenwengerd on June 20, 2009, 12:20:22 PM
Fred, the Default value is still there, and it can still be selected either by the user or by SetCurSel.

Ok, then I must have misunderstood you.

Fred
Title: Re: (dcl_ComboBox_FindLineWeight psCreateNewLayer_cmbbxLayerLineweight -3) = nil
Post by: owenwengerd on June 21, 2009, 04:50:42 AM
It may help to understand what is going on behind the scenes.  Each item in the color and lineweight combo boxes automatically gets item data assigned that represents the actual color or lineweight for that item.  In the case of "Default" lineweight, the item data is the actual default lineweight (as set by the LWDEFAULT system variable).  FindColor and FindLineWeight just scan through the list searching for item data that matches the target value.  Therefore, FindLineWeight will not find any item data with a value of -3, however if LWDEFAULT is 25, then (FindLineWeight 25) will find the Default item because it appears earlier in the list than the "0.25 mm" lineweight.