algorithmic modeling for Rhino
Hi,
(This is a continuation of a single project, but because it's a separate issue, I thought it'd be best to separate it out into a new thread, to help for anyone searching for help in the future. If we'd rather limited posts to the same thread, please let me know.)
Based on a previous discussion, I've created a button that dynamically changes the number of input/output parameters in a comp..., as part of a meta-component project.
However, I need the button to be clickable and to process an input (a file URL) when the component has a warning raised. Specifically, I need the button to be clickable when the components' inputs are not all plugged in. At the same time, I don't want to make the inputs optional, so I don't want to disable the warnings themselves.
I'm running into a situation where I need the new file URL to process input after the button click. However, I can't read the new file URL input in SolveInstance() since the component requires all inputs to be plugged in.
As a workaround, I have thought about making all the inputs optional, then manually triggering an AddRuntimeMessage warning within SolveInstance, so that the URL input is retrieved, yet a warning message is still triggered. This seems somehow messy and a possible slowdown, since it's in SolveInstance.
I'd rather be able to retrieve that one input parameter's value upon mouse click. Is this possible? I'm not sure how to get access to the IGH_DataAccess object otherwise.
My component code is here: https://github.com/provolot/GrasshopperExchange/blob/master/Hairwor...
Thanks again!
Tags:
It's not possible to get an IGH_DataAccess object outside of SolveInstance. Setting up one of those is very complicated and probably not possible outside of core code.
You can however get access to the data in a parameter whenever you want. There is a potential problem here in that the data might not exist when you ask, though if you are not asking in between an expiration event and new document solution you should be fine.
When the button is clicked you look at the VolatileData for the parameter in question. You may have to cast the data in there before you can make sense of it, but if you know the type of the parameter you know which type of IGH_Goo is contains.
--
David Rutten
david@mcneel.com
Welcome to
Grasshopper
© 2025 Created by Scott Davidson.
Powered by