The Exchange connector for Rhino-Inventor/Revit Japhy mentioned can be downloaded from here:
Here is an example code for Rhino Inside Solidworks: