Can we use python/forms and still get the grasshopper parametric preview?

Hi there, I’m working with a Python developer at the moment on a project and we are uncertain if it may be possible to get user input via an ETO/WinForms dialog and still get the Grasshopper parametric preview. But I’m hoping there might be a way around this.

The logic the the above assumption is…

  • Open form to enter data
  • User clicks ‘OK’ when done, form is closed
  • Send variables to Grasshopper script
  • Script then creates the parts

Following that logic I can see there is no way to get a parametric preview while the ETO/WinForm is still on screen.

So I am hoping someone might advise how we can get a logic like below to work. The aim of this project is that the user never has to use Grasshopper, they will only interact with the Form.

Something like…

  • Open the ETO/WinForm
  • A Grasshopper preview is on the screen
  • Variables in the Form are changed
  • The Grasshopper preview updates as the values are changed in the form
  • User chooses OK
  • Grasshopper then creates the objects (effectively baking them)

Human UI sort of does this, but I need to do more with the forms than Human UI will allow keeping the dynamic connection between the form and the grasshopper preview.

Thanks in advance!

Adrian

Just curious — what do you need to do here that Human UI won’t support?

Thanks I will check that out!

Thanks @andheum, I’m learning as I go and will take another look back over Human UI.

I think the dead end I ran across was finding a way to work with integers & real number in a simple box, but I suspect the workaround is ‘Create Text Box’ and then validate the contents.

I’d love also to be able to type the math in, say “500-135” and it update with the resultant value, but maybe that is doable also.

Attached are some sample forms - I don’t need to replicate them, but looking at similar functionality with some options greyed out when when certain selections are made, multiple tabs, and getting some data from .csv or excel files outside of Rhino.

Maybe Human UI can do much more than I’m thinking? Could you direct me to some Human UI documentation and examples?

I have a local python expert on board, but maybe I’m better off finding a developer is more grasshopper savvy. It’s early days and we are still working on firming up the brief, but it does take a bit of work to get there.

The end result of what I’m aiming for will be a saleable product. The end shouldn’t ever know that grasshopper even exists (unless they are going to develop their own libraries).

Regards,

Adrian

Thanks for the answer. A good portion of what is shown in your screenshots can be achieved in Human UI — the hardest bits are the tree view (the expandable folders on the left) and the modal prompts that get launched.

However, since you want a sellable product, I think you’re probably taking the right approach by developing something from scratch. There’s no great way to bundle up a grasshopper script with a UI and make it “feel” as streamlined as a plugin (although it sounds like you’re intending to rely on Grasshopper in any case, which might leave you facing the same problems.)

The best methods I know to hide GH completely but preserve its interactivity / display are here: Hide routines behind UI window

If you are interested in pursuing a Human UI approach, the examples here (under “Example Files”) are decent: https://www.food4rhino.com/app/human-ui

You probably won’t find more advanced features in those examples (i’ve just never had time to build out a more sophisticated set) but it’s certainly possible to do:

  • conditional enable / disable of controls (gray out based on values) (Hide / Show Element with “Disable” option)
  • multiple tabs (tab viewer component)
  • pick external files from the file system via an “open file” dialog (File Picker component)

And, just for the sake of curiosity, here’s how you can do things like validation / math in a human UI text box:

That is awesome, thanks @andheum! I’ll chat with the developer also. The examples definitely show off what can be done. Plan to be manipulating layers, blocks, materials & object attributes in these scripts also - it is looking like there is a place for Human UI in the mix!
Cheers,
Adrian