from chimerax.color_key.model import ColorKeyModel
m = ColorKeyModel(session)
If the above was in a file ending in ‘.py’, you could just use the ‘open’ command to run it and create the key. I’ve attached a file with that code in it for convenience. Once you have created the key, then all operations that affects keys (like the ‘key’ command) will affect the new key and leave the original key as is. If you had the Color Key tool up, it will continue to show the old values. Just close it and re-open it to show the new values.
--Eric
Eric Pettersen
UCSF Computer Graphics Lab