TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Rustabout on May 29, 2021, 11:03:13 PM
-
I started a routine using Visual LISP and Layers. Discovered that it's a bit of a pain dealing with colors, color indexes, etc...
I can create a sub-routine but it will involve taking this: https://gohtx.com/acadcolors.php and using it to determine whether the object's color is a 'true color' or simply an index color (assuming the user wants an index color if the color's RGB indexes matches an index color). Not 'hard' to program but a bit time intensive.
Does anyone have any better ideas? If I create such a sub routine would anyone else find it useful? Does something better already exist?
I'm a tad hesitant to switch to an entity list approach, but might have to as my next challenge will be dealing with transparency, which isn't the easiest with Visual LISP functions.
Thanks!!
-
The color table in the link is incorrect.
-
have you looked at: http://www.lee-mac.com/colourconversion.html#rgbaci ?
-
Hi Roy, I checked and you're right. Colors 8 and 9 are definitely different. Only checked up to there and a few random colors (color 30 is correct at least). Good eye!
danAllen: The link will be ultra-helpful. I now need to figure out a 'test' to see if the layer is in fact set to a 'true color' or an index color.
As far as Visual vs Vanilla LISP, I think I will literally have to write a function in both to get what I need out of this deal. It's not so bad once it's done I guess.
-
My solution to True Color is the Layer's TrueColor property: if it's ColorMethod is set to 194, it's a true color; 195 and it's an index color. I'm only needed to copy properties not necessarily generate new ones (makes things a bit easier).
-
I started a routine using Visual LISP and Layers. Discovered that it's a bit of a pain dealing with colors, color indexes, etc...
What specifically are you trying to do?
-
Hi Lee,
I was just making a program that copies a grouping of layers. I've since found a function but it doesn't solve the transparency issue (see my other post).