Hello-

I'm using the following JavaScript to replace univalent atoms is a Jmol
model:

evalRasmol("if ({atomIndex=" + atomIndex + "}.valence =1){{atomIndex=" +
atomIndex + "}.element = '" + buildAtom + "'; wireframe 0.15; spacefill
20%;minimize addHydrogens;boundbox {*};select *;center selected;}");

With atomIndex = 1 and buildAtom = "Cl," for example, the evalRasmol
function is processing the following Jmol script:

if ({atomIndex=1}.valence =1){{atomIndex=1}.element = "Cl"; wireframe 0.15;
spacefill 20%;minimize addHydrogens;boundbox {*};select *;center selected;}

This all works very nicely, including a new bond length, for one
substitution. After that, the substitution is made, but the bond length
remains unchanged.

Again by way of example, methane changes smoothly to chloromethane. While
the next substitution leads to methylene chloride, the methylene chloride
has one normal C-Cl bond length and one C-Cl bond length equal to a C-H bond
length.

In summary, for a wide range of molecules, the above process works well
once. After that, bond length for the added atom is not changed.


The following variation of the above JavaScript leads to the same result:

        evalRasmol("if ({atomIndex=" + atomIndex + "}.valence
=1){{atomIndex=" + atomIndex + "}.element = '" + buildAtom + "'; wireframe
0.15; spacefill 20%;minimize addHydrogens;}");

The following variation makes it clear that it is the spacefill command that
adjusts the added atoms vdw, and it is the minimize command that adjusts the
bond length. But only once????

        evalRasmol("if ({atomIndex=" + atomIndex + "}.valence
=1){{atomIndex=" + atomIndex + "}.element = '" + buildAtom + "';}");

Does anyone have any suggestions that might allow subsequent substitutions
to behave as the first? As a point of information the JavaScript is
initiated by a click callback when the univalent atom is clicked.

Otis

-- 
Otis Rothenberger
http://chemagic.org
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to