OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Slavko Ivanovic on September 30, 2010, 12:22:42 PM

Title: Im Back! but with error :)-GetOLEColorValue
Post by: Slavko Ivanovic on September 30, 2010, 12:22:42 PM

First of all, hi to all OpenDCL developers and users.
In December 2009 i was change company (work place).
Iv got a much better position in my new company, but also much responsibilities.
I didn't touch any code from then up to two weeks ago.

In December 2009 i was also cooking some very interesting code for Show and Tell with intention
to post as a NEW YEAR present :), but i was forced to stop at 80%.

Now, to bug:
I was doing some stuff with colors and found this with 6.0.0.29 and 6.0.1.1
Code (autolisp) Select

GetOLEColorValue ERROR:

(dcl_GetOLEColorValue (list 219 232 204)) -> 13428955
(dcl_GetOLEColorValue (list 220 232 204)) -> error !   from RED 220
...
...
(dcl_GetOLEColorValue (list 225 232 204)) -> error !
(dcl_GetOLEColorValue (list 227 232 204)) -> error !
...
...
(dcl_GetOLEColorValue (list 239 232 204)) -> error !  to RED 239
(dcl_GetOLEColorValue (list 240 232 204)) -> 13428976


i need confirmation.
thanx


Title: Re: Im Back! but with error :)-GetOLEColorValue
Post by: owenwengerd on September 30, 2010, 04:58:46 PM
Welcome back! The error is due to a bug in the way AutoCAD interprets DXF groups. The usual solution is to force one of the numbers to be a (float):
Code (autolisp) Select
(dcl_GetOLEColorValue (list 220.0 232 204))
Title: Re: Im Back! but with error :)-GetOLEColorValue
Post by: Slavko Ivanovic on October 16, 2010, 05:44:13 PM
Thanks Owen.
Simple.
Next time i will investigate more before posting  ;).