Skip to content

Instantly share code, notes, and snippets.

import System.Drawing
import System.Windows.Forms
from System.Drawing import *
from System.Windows.Forms import *
class SliderForm(Form):
def __init__(self):
self.__value_changed_callback = None
self.InitializeComponent()
@sbaer
sbaer / gist:5587540
Created May 15, 2013 21:27
Automate Rhino5 with IronPython
# The following script is meant to be run inside of IronPython
# It demonstrates how to automate Rhino from a script
import System
# start an instance of Rhino
t = System.Type.GetTypeFromProgID("Rhino5.Application")
rhino = System.Activator.CreateInstance(t)
# show Rhino (optional)
rhino.Visible = True
@sbaer
sbaer / gist:1023456
Created June 13, 2011 19:05
Get world points from mouse cursor position
import scriptcontext
import time
import System
import Rhino
rc, view = Rhino.Input.RhinoGet.GetView("select view")
print "position mouse where you want"
for i in [5,4,3,2,1]:
time.sleep(0.5)