Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

*Expert Elite*
Posts: 4,798
Registered: ‎09-13-2004
Message 11 of 16 (204 Views)

Re: dotted pairs

10-19-2012 09:02 AM in reply to: hmsilva

Even forgetting the 33-1/2 million size of the full-length numbers, and considering only the range in values between the extremes, being off by 1 out of 227 is still pretty good -- less than 1/2 of 1% off.  I can't imagine that the difference in appearance could possibly be detectable.  I would still love to know what those first 5 digits that are the same in all values are accomplishing.

Kent Cooper
*Expert Elite*
Posts: 2,206
Registered: ‎12-17-2004
Message 12 of 16 (200 Views)

Re: dotted pairs

10-19-2012 09:10 AM in reply to: Kent1Cooper

Kent Cooper wrote:

...I would still love to know what those first 5 digits that are the same in all values are accomplishing.

is puzzling!

Henrique

Valued Mentor
Posts: 434
Registered: ‎08-06-2002
Message 13 of 16 (169 Views)

Re: dotted pairs

10-29-2012 08:47 PM in reply to: hmsilva

The high byte is the transparency method (0 = ByLayer, 1 = ByBlock, 2 = ByAlpha), the low byte is the alpha value from 0 to 255.

--
Owen Wengerd
ManuSoft
*Expert Elite*
Posts: 2,206
Registered: ‎12-17-2004
Message 14 of 16 (147 Views)

Re: dotted pairs

10-30-2012 07:43 AM in reply to: owenwengerd

Owen Wengerd wrote:

The high byte is the transparency method (0 = ByLayer, 1 = ByBlock, 2 = ByAlpha), the low byte is the alpha value from 0 to 255.

I Owen,

Is possible to explain me little more?

Thanks

Henrique

Distinguished Contributor
Posts: 144
Registered: ‎02-06-2007
Message 15 of 16 (139 Views)

Re: dotted pairs

10-30-2012 10:14 AM in reply to: Kent1Cooper

Kent1Cooper wrote:

Even forgetting the 33-1/2 million size of the full-length numbers, and considering only the range in values between the extremes, being off by 1 out of 227 is still pretty good -- less than 1/2 of 1% off.  I can't imagine that the difference in appearance could possibly be detectable.  I would still love to know what those first 5 digits that are the same in all values are accomplishing.

Acording to DXF reference, code 440 holds a 32 bit integer and the high-order byte (8 bits) is 2.

That is hexadecimal 0x02000000 and decimal 33554432.

To represent transparency, to this value is added a number between 0 (100% transparency) and 255 (0% transparency). (well, you can't set a transparency higher than 90% so the minim value, coresponding to 90%, is 25)

You can get this value by interpolating linear for n% transparency:  x = integer(255-n*255/100)

For demonstration, look at this lisp:

```(defun C:TEST ( / e n)
(if
(and
(setq e (car (entsel)))
(setq n (getint "\nTransparency: "))
(<= 0 n 90)
)
(entmod
(append
(entget e)
(list (cons 440 (+ (lsh 2 24) (fix (- 255 (* n 2.55))))))
)
)
)
)```

*Expert Elite*
Posts: 2,206
Registered: ‎12-17-2004
Message 16 of 16 (135 Views)

Re: dotted pairs

10-30-2012 10:26 AM in reply to: phanaem

phanaem,
great explanation.

Thank you very much.

Henrique

Recently Solved