set atom color through API?

User 870ab5b546

25-05-2011 14:48:48

Is it possible to set an atom's color through the API?  I can't find a method that will do it...

ChemAxon 990acf0dec

25-05-2011 20:45:10

Hi Bob,


You have to include it in an atom set, and then you can color it:


http://www.chemaxon.com/marvin/help/developer/core/sets.html


Best regards,


Akos

User 870ab5b546

26-05-2011 01:03:54

Thanks, that was helpful.  Is there a way to see what atom sets already exist in a document?  The only way I could figure out how to do it was to go through each atom in the molecule and see if it referred to a set.  I want to color one or more atoms, and I want to add them to an existing set if one with that color already exists, creating a new set if not.


You might want to put references in the MolAtom and MolBond documentation that point the user to the page on setting atom and bond colors and fonts/thicknesses.

ChemAxon 12eab24e0a

27-05-2011 12:20:50

Hi Bob,


Atomset and bondset coloring, fonts and thickness is stored in MDocument. Setnumber belongs to MolAtom, MolBond. There is no direct connection between atoms and colors, only through sets. So in order to take an atom to an existing set with a specified color you have  to scroll over the atoms.


Best regards,


Eva


 

User 870ab5b546

27-05-2011 15:49:21

I don't follow.  The atom sets are stored in either a List or a Map, right?  So, presumably you should be able to get the List or Map and iterate through them?  And if you can look an atom set up by set number, then you can do the reverse as well.

ChemAxon 12eab24e0a

30-05-2011 07:22:45

Hi Bob,


"The atom sets are stored in either a List or a Map, right?" - No, it's not right. Atomset number is stored in MolAtom, and color etc infos in MDocument. We do not store the whole atomset and bondset anywhere.


There is no other way to look up the sets only to get the atoms of the moleculegraph, then get the setnumber one by one from the atoms.


Sorry for the inconvenience,


Best regards


Eva

User 870ab5b546

30-05-2011 18:18:13










ehollo wrote:

Atomset number is stored in MolAtom, and color etc infos in MDocument. 



I don't think you're understanding me.  What I want is a method, MDocument.getAtomSetColors(), that returns all the Colors that are stored in MDocument as either an array or List in order of atomset number or as a Map<Integer, Color>.  Surely the colors must be stored in MDocument so they can be looked up by the atomset number.  Otherwise, how does MDocument.getAtomSetColor(13) find the color associated with atomset 13?  

ChemAxon 12eab24e0a

31-05-2011 19:41:28

Sorry Bob,


I understand pretty well, what you want, but it does not exist. We
store color infos in a different way, but I can not tell you more, it is already confidential.
These sets and colors exist since years and we have no capacity to
implement them again in a short time.


Thanks,

Eva