From: Robert H. <ha...@st...> - 2010-12-21 17:07:31
|
First thing to realize is that the .jmol file is just a ZIP file, so you can add whatever you want to it. If you add a script that includes loading a file, and you want to include that file also in the ZIP file, then be sure to load it in the script using $SCRIPT_PATH$ at the start of its name: load "$SCRIPT_PATH$Fe2O3.out" Jmol would expect to find Fe2O3.out in the .jmol file along with the script that is calling it. If you want that script to be run AUTOMATICALLY, then add its call to the end of the script file that is in the .jmol file. So, for example, if you have test1.jmol it will contain test1.spt Open that file with an editor and add to it at the end: script "$SCRIPT_PATH$myscript.spt" to run that script as well. A little complicated, but it does work. You are right that recent changes removed the user variables and functions. We could reconsider that, or make it an option. The problem arises when the user redefines Jmol command names -- then reproducing the state is problematic. Bob On Sat, Dec 18, 2010 at 6:22 PM, Alexander Rose <ale...@we... > wrote: > Hi, > > I like the .jmol file which contain everything to display a model and added > data in a certain state. It is a quick and easy way to share some findings > in a model with colleagues. And it is obviously more powerful then an image > because it allows manipulation with all of Jmol's powers. However it allows > just one state. Often there are multiple interesting things in a model and I > like to include some jmol script functions to change the orientation, zoom > in, etc. or just define multiple sets of interesting amino acids. A recent > change excludes user defined functions and atom selections from the state > [1]. As far as I understand it the Jmol 'state' is mainly to reproduce the > visual state and looking more for a way to reproduce something like a > working environment or session. I know that I could just have an extra > script file which manage myself in addition to the .jmol file, but I would > rather have a single file created in one step. > > So, my question is: Is there another way to include user-defined functions > and variables in .jmol files or/and the state? > > Best > Alexander > > > [1] > > #version=12.1.16 > # bug fix: naming functions or variables after Jmol token names fails or > acts unexpectedly > # (fixing this bug required script compiler changes, and that lead to the # > two new features below) > # > # bug fix: User variables and functions removed from state because they are > # no longer necessary and also indeterminant in terms of the "state". > # Originally these were needed because ECHO and DEFINE can be dynamic > # -- which is still true -- and because certain commands such as ISOSURFACE > # were being saved in the state just as their strings instead of their > # intepreted code. But that was changed for 12.0, and this fix also changes > # ECHO to be saved in its current state, not its dynamic state. While > # dynamic DEFINE types may include variables, they aren't really > # part of the "state" per se and aren't needed to recreate the state. So > # they are dropped from the state with this fix as well. > > ------------------------------------------------------------------------------ > Lotusphere 2011 > Register now for Lotusphere 2011 and learn how > to connect the dots, take your collaborative environment > to the next level, and enter the era of Social Business. > http://p.sf.net/sfu/lotusphere-d2d > _______________________________________________ > Jmol-users mailing list > Jmo...@li... > 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 |