Code Red > .NET

get autocad UI current colors

(1/2) > >>

nekitip:
I can't find where is current autocad UI colors list.
What I would like to do is a way to change my own pallete background depending on current color of, say, acad properties pallete. Easy thing, but I just can't find where that list is.
Closest I have google is to http://adndevblog.typepad.com/autocad/2013/05/wpf-databinding-to-the-commandline-colors.html, but...

huiz:
In 2015, there is a system variable. You could set an event to see when it is changing.

Before 2015, you need to read the Registry (current Profile) to find out if the light or dark theme is active.

nekitip:
Well, I have found some list, but i don't know how to iterate.
It seems it returns items by name (and name I don't know), and from that link, I choose one to see if this works.

--- Code - vb.net: ---Dim col = Autodesk.AutoCAD.ApplicationServices.Application.UIBindings.ColorSettingsDim c1 = col.Item("CommandLineBackground")
But, huiz, are you saying it is only possible for (properties pallete) to be dark or light?
If that is so, than this may do for me. Then only thing left is to find out what version of autocad is running, since 2013,2014 have different colors from 2015 (and the only last 3 I need)

huiz:
Ah you need the color of the Palette!

AutoCAD only shows the Light or Dark Theme setting. And since 2015 you can do that with a system variable GetSystemVariable("COLORTHEME") which is set to 0 or 1. In previous versions you need to read the current Profile from the Registry.

HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R19.1\ACAD-D001:409\Profiles

and then under that Profile you can find somewhere the setting if the user uses the light theme or the dark theme.

You won't get the real color but you can find out with a screenshot and use Photoshop or something to get the dialog color.

For more information you can visit http://through-the-interface.typepad.com/through_the_interface/2014/04/supporting-autocad-2015s-dark-theme.html

huiz:
I played a bit with this too but found out that

1. It takes a lot of programming to change all the dialogs, Palettes and other stuff
2. Dark theme color in 2015 is a different color than dark theme in 2014
3. Some Windows Form objects like Groupboxes are ugly with a dark background
4. Some colors like green are really ugly (and my application main color is green)
5. AutoCAD and certainly Civil3D don't use the dark color for their dialogs, only the Properties Palette and the Layer Palette (and some other)

So, I just keep things simple and don't check the Dark Theme setting at all.

Navigation

[0] Message Index

[#] Next page

Go to full version