Progress on piloting Jmol from Visual Basic (VB)via WebBrowser
Considering the framework:
VB - HTML elements - Jmol functions

I switched to VB.NET for further testing, as that is the modern system, and the few fragments of information concerning data retrieval were relative to the NET system.

After much time spent on “formatting”, the following give signs of life.

VB to Jmol:
WebBrowser1.Document.InvokeScript("jmolScript", {"load heme.pdb"})

Jmol to VB (info retrieval)
StringA = WebBrowser1.Document.InvokeScript("jmolEvaluate", {"5 + 6"})
StringA = WebBrowser1.Document.InvokeScript("jmolGetPropertyAsString", {"atomInfo", "atomno=1"}) StringA = WebBrowser1.Document.InvokeScript("jmolGetPropertyAsString", {"fileName"})

This is good news, although first attempts at recovering an array did not work.The methods requiring explicit code for “callback” or “common functions” are apparently not necessary.



Curious, I went back to VB6 to try again the component that failed (Jmol to VB)
     This did work:
StringA = WebBrowser1.Document.parentWindow.jmolEvaluate("3 + 5")
But similar commands using GetProperty did not:
StringA = WebBrowser1.Document.parentWindow.jmolGetPropertyAsString("FileName")
returns “zapped”
StringA = WebBrowser1.Document.parentWindow.jmolGetPropertyAsString("atomInfo", "atomno=1")
returns “*Vector[0]”

further remarks (tested with NET)
a) There is a timing problem. If I load “Mb” then run a subroutine with load “heme” followed by jmolGetPropertyAsString("FileName"), it returns the “Mb” name. A repeat of the sub correctly returns “heme” b) jmolGetPropertyAsString("atomInfo", "atomno=1") is ok for Mb, but null for heme c) I wanted to try jmolGetPropertyAsString of the Spin state (on or off) but could not find it.

In conclusion, this seems to work.

Michael
E-mail: michael.mar...@inserm.fr

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to