OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: kenkrupa on June 29, 2012, 04:29:00 PM

Title: Bug in dcl_getolecolorvalue function!
Post by: kenkrupa on June 29, 2012, 04:29:00 PM
The dcl_getolecolorvalue function is defective! It seems that if the first of the three integers is from 220 thru 239, the function bombs!

Command: (dcl_getolecolorvalue (list 219 184 120))
7911643


Command: (dcl_getolecolorvalue (list 220 184 120))
Application ERROR: Bad argument type
; error: ADS request error

Command: (dcl_getolecolorvalue (list 239 184 120))
Application ERROR: Bad argument type
; error: ADS request error

Command: (dcl_getolecolorvalue (list 240 184 120))
7911664

(v 7.0.0.4)
Title: Re: Bug in dcl_getolecolorvalue function!
Post by: owenwengerd on June 29, 2012, 07:32:53 PM
Convert the first argument to a float to work around the problem: (dcl_getolecolorvalue '(220.0 184 120)) or (dcl_getolecolorvalue (list (float 220) 184 120)).
Title: Re: Bug in dcl_getolecolorvalue function!
Post by: kenkrupa on June 30, 2012, 07:21:38 AM
OK - that works - thank you Owen.

Since I have the color as a list of three strings, it seems I can simply use (mapcar 'atof clr) instead of (mapcar 'atoi clr).
No problem having them all reals, as far as I can tell.