Bob,

I am having an atom index problem building a carbon chain. I set the stage
for this with the following script:

delete hydrogens;echo Clicked atoms will|ADD a carbon atom.;

If at this point I check atomIndexes, and they are A-OK. The hydrogens are
gone, and the atomIndexes run from 0 to the new number of atoms -1.

The carbon atom click/add then uses the following script:

select atomIndex=_atomPicked;flash;var i = {*}.atomIndex.max + 1;var j = i +
1;var x = {atomIndex=_atomPicked}.atomX;var y =
{atomIndex=_atomPicked}.atomY+.1;var z =
{atomIndex=_atomPicked}.atomZ+.1;set appendNew false;var w = '1\ntest\nC ' +
x + ' ' + y + ' ' + z + '\n';data 'append @w';connect
(atomIndex=_atomPicked) (atomIndex=i) single;

Flash is my own command that simply substitutes the Jmol script to flash the
atom magenta for .5 seconds prior to jmolScript()

If I do NOT delete the hydrogens (step 1 above), then the script works
nicely. If I do delete the hydrogens (step 1 again) the first click/add
fails to bond -

 i.e. connect (atomIndex=_atomPicked) (atomIndex=i) single

is failing. The new carbon atom is added, but it floats away without
connecting on a subsequent minimize. After this first failure, the script
works on subsequent clicks.

I could simply leave the hydrogens on, but I'm trying to give the editor the
feel of standard editors that build C frameworks.

The working page is here:

http://chemagic.com/web_molecules/script_page_large.aspx

Click Display Control Panel.

The page is set to do the with-hydrogen edit (works). If you do a delete
hydrogens in the text command field, you will see the problem on the first C
add.

Any thoughts on the problem? It appears for the first click atomIndex=i is
not what I think it is??

Otis

-- 
Otis Rothenberger
http://chemagic.org
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to