#185 SMILES for all connected moieties in model


I'm currently using e.g. var smiles={1.1}.find("SMILES") to obtain the smiles for a model, but this returns smiles for the first connected moiety only.
So I then use the returned smiles to obtain an atom list using e.g. var x={1.1}.find("SMARTS", smiles).
Then I 'remove' these atoms from the model using e.g. for (var i=0;i<x.length;i++) assign atom @{x[i]} "X";
Then repeat the process until .find("SMILES") returns a single atom.
In most cases my script works fine, but there are a few 'gotchas' to overcome, e.g. 'assign atom {} "X"', being part of the model kit, creates a 'logical' atom in place of the last 'X' assignment so the model is altered and the next .find("SMILES") call could return the added atom.

Is it possible for .find("SMILES") to return the smiles string for all distinct molecules in the model? Or can anyone point me in the right direction with regards to scripting a solution?


Simon Westrip

PS I've been using the prerelease versions of 12.1.x, working with core CIFs.


  • Bob Hanson

    Bob Hanson - 2011-02-06

    Must be a better way than that. You can run through all the molecules easily, selecting one at a time. This is not a place for answering usage questions; please use the Jmol users list.

  • Simon Westrip

    Simon Westrip - 2011-02-06


  • Bob Hanson

    Bob Hanson - 2013-03-26
    • status: open --> closed
    • milestone: -->

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks