Code - Auto/Visual Lisp: [Select]
Code - Auto/Visual Lisp: [Select]
Why the shift of 24 bits?
The bit to be removed is the 25th bit (33554432), hence for 32-bit integers, only a 7-bit shift is required to remove all bits above and including the 25th, and one could not argue that the code is accounting for 64-bit integers, since this would require a shift of 39 bits.
However, to remove the single 25th bit, rather than shifting bits back & forth, an alternative solution is to simply mask the unrequired bit, e.g.:Code - Auto/Visual Lisp: [Select]
Please feel free to further critique, offer a simpler adaptation, etc. as it only reinforces the point I originally made (in my ADNDevBlog article comment), that the code was more complicated than it needed to be.
Cheers dude, I haven't ventured into entity transparency before, so this was refreshing 8-)
Why use recursion?Code - Auto/Visual Lisp: [Select]
)
(defun getentitytransparency (ent)
(cond
((= 'vla-object (type ent))
(vla-get-entitytransparency ent)
)
((= 'ename (type ent))
(vla-get-entitytransparency (vlax-ename->vla-object ent))
)
)
)
I would personally make the following changes:Code - Auto/Visual Lisp: [Select]
0 ) ) )