GUI Python

How does one go about create a GUI for rhino using Python? Do people import a specific ‘module’?

Many thanks in advance…

I have not tried it myself however this should help:

There is some pre-canned dialog boxes in the rhinoscryptsyntax. Check the Rhino.Python help file for details.

For anything beyond that, you might consider WinForms. Here is a simple example:

import clr
clr.AddReference("System.Windows.Forms")
from System.Windows.Forms import Application, Form

class IForm(Form):

    def __init__(self):
        self.Text = 'Simple'
        self.Width = 250
        self.Height = 200
        self.CenterToScreen()

if __name__ == "__main__":
    form = IForm()
    form.ShowDialog()

Hi @dale, is there any more info around on using Windows Forms from either Python or RhinoScript? I’m needing more than the pre-canned. Thanks! Adrian

Hi Adrian,

Ths topic might be of interest to you:
http://discourse.mcneel.com/t/can-winforms-be-used-with-python-to-make-this/17167

-Willem

Awesome, that is great thanks @Willem, just what I needed!

1 Like