algorithmic modeling for Rhino
David, Ben,
It seems I'm following Ben down the path of this bad idea, and just wanted to check if anything might have changed on this thread.
What I'm working on is basically a fancy parser. I'd like to monitor a folder location, parse all the files in that location, and generate a variable number of output params accordingly. Having read the thread above detailing the dangers of fussing around with the number of params, I'm prepared to accept the potential annoyances associated with problem #1, and will update only on a menu-item click and not from within solveinstance (which i think addresses the remainder of the issues).
Any advice along these lines? I'm currently trying to work out how to politely add or remove parameters from a component in my click handler. Any help or advice would be most appreciated.
-Kyle
Hi Kyle,
nothing has changed, however I think your case is mildly different. You want to adjust output parameters not based on a GH solution, but based on a File System event. This event can be handled outside of a Solution, which means that problems #2 & #3 don't really apply.
Do note that file system events are notoriously unpredictable so problem #1 is very much still there.
I think in your case the biggest problem is making sure your connections aren't wiped. I'm not really sure what the best solution to this is.
I attached a source file which kinda sorta synchs files in a folder with output parameters, but it would be so much easier if you could trigger this from a menu item rather than a File System event.
--
David Rutten
david@mcneel.com
Poprad, Slovakia
Yowza, thanks David!
It's my birthday today, so I've only just started to dig into this file... but a first glance suggests that this little gem of a birthday gift just narrowed the scope of the task in front of me significantly.
I'll be sure to post my modifications / results here once appropriate.
Kyle
Hi David,
Thanks again for your birthday gift. For anyone else hunting down a similar problem, attached is my implementation based on your example. This version is working to parse single files that are updated only with mouseclicks, not monitored for changes (which is fine by me).
Some wierdness that I can't work out:
1. The referenced files remain locked for some reason, even though I'm reading them within a "using" construct, which I thought automatically closed the file once exiting the code block.
2. Serialization seems to work for the most part, but when I modify the referenced CSV (delete a column, for example) and then re-open the GH definition things aren't refreshing they way I thought they would. A manual refresh corrects this.
Any thoughts on these (admittedly minor) problems?
Thanks again,
Kyle
Wow, I never replied to this. But it was a great response David. I remember that the primary thing I was trying to solve was that I would often use the explode tree component to split off branches and would have to explicitly add outputs for every branch. This is not a problem with a few branches, but gets very tedious with 10+ branches if you're doing it repeatedly (which I was).
I think the Merge component handles this well in its inputs: if you fill up the inputs, it adds another. It would be amazing if the outputs of the explode tree component were handled in a similar way to the Merge inputs. Maybe if it's a purely additive process, it wouldn't be as problematic (outputs are removed manually and can be added automatically - if you plug in 20 branches, you get 20 outputs).
Thanks for replying to me over a year ago.
That functionality is already there. Right click on the explode tree component and select "match outputs".
excellent. thanks.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by