Site Tools


Sample: Molecular modeling plugin (VB.NET)

Summary: Complete source-code for a VB.NET plugin. This plugin covers importing and selecting Protein Data Bank files as atoms and bonds in Rhino.
Notice: Please note that this code is beta. I have tested it, and it seems to work. But there may be many errors. Use with care and a healthy dose of scepticism. This is a Rhino 3.NET plug-in. It will not run on Rhino 4

More Information

The plugin deals with (among other things) the following issues

  • Reading PDB files and storing the data is custom classes
  • Using dialog boxes in Rhino
  • Inserting meshes, curves, points, pointclouds and NURBs surfaces with custom attributes
  • Zooming viewports
  • Orienting geometry
  • Iterating and selecting through existing objects in a document
  • Registry interaction

The zip-archive with all source-code files can be downloaded here:

http://en.wiki.mcneel.com/content/upload/files/CADmium_SourceCode.zip


Please read the message in the archive. If you do not agree with my terms you should not use this example.


David Rutten

Question: Do you have a good site to get sample .pdb files? One thing I noticed right away is that VB.NET compiles .pbd files as “Program Debug Database” files. I accidentally thought this was a sample file at first, and this threw an exception when I tried to load it. – SteveBaer
Answer: Many PDB files are are available for download in the Protein Data Bank , which is the main repository of protein structures. PDB files are organized there by four-character identifiers such as 1MUE (thrombin) or 1A0Z (hemoglobin). If you need an interesting structure in a hurry, why not try the Molecule of the Month ? – Bathsheba Grossman
Answer: Oops, I gues the code that reads a pdb-file isn't very robust yet. I also noticed a bug in radius-lookup, will post an improved version shortly.
Question: I would be interested in updating your source code and posting a second zip file of source to this wiki page. This could be a work in progress Rhino.NET plug-in that we could update with comments and tweaks. What do you think? – SteveBaer
Answer: That would be great. I'd love to see this evolve into something versatile. I'd especially like to add more geometry-types like Strands, Ribbons, Meta-balls etc. I have no objections to anyone fixing code, adding comments, adding features. But how do we make sure two people don't change it independently resulting in conflicting subroutines? – David Rutten
developer/sdksamples/molecularmodeling.txt · Last modified: 2015/09/14 (external edit)