Well, Otis, I'm guessing you will have a full-fledged Jmol-based molecular
editor for us soon. Is that right?
This is fixed for Jmol 11.9.29. See
http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol-11.zip

Bob

[PS: I'm not sure I would do the "center selected" there -- doesn't that
result in an odd jump? I think it would be cooler to just let the model
relax as you change the atoms.]


On Thu, Feb 11, 2010 at 7:36 PM, Otis Rothenberger <o...@chemagic.com>wrote:

> 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
>
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
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