I’m trying to make steps into learning Python within Dynamo. I’ve realised i’ve probably took a step too far and haven’t learned the basics, but I was wondering if anyone could help me out with an issue I have.
I’m in the process of writing a script for work and it was an added bonus I try add in a GUI interface to help with making it user friendly and more accessible to people who don’t “trust” dynamo…
The script side of things is going fine, however i’m stuck trying to create an interface to do a simple yes/no answer with two different outputs, this would be very beneficial if i could do this atleast once because I can string a few of them together to allow people to make choice on outputs.
So if anyone could help me on this, i’d really appreciate it. I essentially want the Python Script node to have to Outputs which are essentially Yes and No, choosing to delete existing circuits or keep them. Also as you notice in the image above, the delete existing circuit text is being cut off, how would I fix that?
Sorry for the probably very basic questions but I’d really like to learn Python with this script and in the short amount of time i’ve learned a little.
import clr # import windows form clr.AddReference("System.Windows.Forms") #import system drawing clr.AddReference("System.Drawing") # import system import System from System.Windows.Forms import * from System.Drawing import * value1 = IN # Create a Class Form class CreateWindow(Form): def __init__(self): # Create the Form self.Name = value1 self.Text = value1 self.Size = Size(500, 150) self.CenterToScreen() self.values =  # Create Label for Sheet Name labelSheetName = Label(Text = "Delete Existing Circuits?") labelSheetName.Parent = self labelSheetName.Location = Point(30, 20) # Create TextBox for Sheet Name button = Button() button.Parent = self button.Text = "Yes" button.Location = Point(180,20) # Register event button.Click += self.ButtonClickedYes # Create TextBox for Sheet Name button = Button() button.Parent = self button.Text = "No" button.Location = Point(300,20) # Create Button = button button = Button() button.Parent = self button.Text = "Close" button.Location = Point(400, 80) # Register event button.Click += self.ButtonClickedClose # Create button event def ButtonClickedYes(self, sender, args): if sender.Click: self.values.append(self.textboxSheetName.Text) self.Close() # Create button event def ButtonClickedClose(self, sender, args): if sender.Click: self.Close() if IN: form = CreateWindow() Application.Run(form) OUT = form.values