Dynamo Player - Task Dialog

Is there a way to run a script through Dynamo player that pops up a dialog box that the user can type a value into. The value would be pushed into dynamo (possibly python) to allow the script to finish

Try using the Datashapes package.

I’m really trying to avoid using packages - this is for an office wide workflow implementation. Single click is the easiest for non dynamo users.

Use datashapes or code your own via python are the only options at the moment for revit 2017

For revit 2018 and if you are on subscription get 2018.1 and use the new dynamo player, note it will not do excatly what you want but a half way house.

Sorry but you cannot do this without data shapes…

Ok, I will try data-shapes.

Has anyone tried using python directly. I am able to bring up a task dialog box in Revit, but I’m not sure how to incorporate fields for text or how to push back into dynamo.

Hi, you may be able to specify some predetermined inputs withing Dynamo and feed them into some deconstructed python scripting from #springnodes for drop-down list .etc Would this be ok to do as a workflow @Dimitar_Venkov ?

Look at data shapes as in a way based on same principle but better…check on forum i think i some post years ago. But data shape is your answer.

Datashapes is the way to go. Install it on the network and set users’ package path to that location. :slight_smile:

As @jacob.small suggested. Put the package library on a network location and set the path in the manage package paths settings. This is what we do at our firm also.

Here is an example I copied and pasted from this site: http://www.voidspace.org.uk/ironpython/winforms/part5.shtml

import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')

from System.Drawing import Point
from System.Windows.Forms import Application, Button, Form, Label, TextBox

class SimpleTextBoxForm(Form):
    def __init__(self):
        self.Text = "Simple TextBox Example"

        self.Width = 300
        self.Height = 200

        self.label = Label()
        self.label.Text = "Nothing So Far"
        self.label.Location = Point(25, 25)
        self.label.Height = 25
        self.label.Width = 250

        self.textbox = TextBox()
        self.textbox.Text = "The Default Text"
        self.textbox.Location = Point(25, 75)
        self.textbox.Width = 150

        self.button1 = Button()
        self.button1.Text = 'Press Me'
        self.button1.Location = Point(25, 125)
        self.button1.Click += self.update

        self.button2 = Button()
        self.button2.Text = 'Reset'
        self.button2.Location = Point(125, 125)
        self.button2.Click += self.reset

        self.AcceptButton = self.button1
        self.CancelButton = self.button2

        self.Controls.Add(self.label)
        self.Controls.Add(self.textbox)
        self.Controls.Add(self.button1)
        self.Controls.Add(self.button2)

    def update(self, sender, event):
        self.label.Text = self.textbox.Text

    def reset(self, sender, event):
        self.label.Text = "Nothing So Far"
        self.textbox.Text = "The Default Text"

form = SimpleTextBoxForm()
form.ShowDialog()

image

6 Likes

Thanks all,
I tried Data-Shapes and it works great! I appreciate all of the responses.

Thanks for this. I am going to go ahead with Data-shapes since its already done. I was unaware that we could set the path for packages, which is very helpful as well.

@Pierre_Roberson, sure you can use an external package, but if you don’t want to create a dependency, you can always just copy the Python node out of the custom node, and paste that directly on canvas. That will give you all of the functionality that Data Shapes offers, but no need to have it installed. Of course that will also result in you missing out on any future fixes or updates.

4 Likes

Thanks Konrad