Grasshopper

algorithmic modeling for Rhino

Hi David,

 

Would it be possible to have an option to set the File Path Component to read to Folder Level, in addition to the current option of file level. As when exporting data the file/s are not yet created but the destination folder can be.

 

Thanks

Matt

Views: 5306

Replies to This Discussion

Ran out of nested replies. In the attached version I'm calling the .NET function directly and checking whether it returns anything before assigning to the persistent variable (which should solve the issue you had when cancelling the dialog). Anywho, as I said I'm sure there are better ways of doing this in GH (I've had several issues with the Button as an input for scripting components, which makes sense when you think about what it's actually doing). Afraid I'm not quite following those last bits, a file would help ;)

Attachments:

Oh yeah, for browsing for a file see attached. Note that this is highly untested and probably could use a bunch of conditional checks and whatnot.

Attachments:

Hm, yeah when I hit the button for a file, it opens the dialog, I select a file, it outputs the path, but I can then neither right-click nor click anywhere except the button. It then opens the dialog again, I select a file again and then clicking is back.

Its always alternating this behaviour. But only for the one that browses for files.

Yup, its' problematic. I always end up using Boolean toggles instead for this reason (that are sent to the Remote Control Panel, which means they act like a radio button here i.e. only one click needed)

Hm, ok. Its kind of weird to set it using a toggle, because a toggle suggest switching between 2 states. Also it remembers the state of the toggle, but not the path output, between saves. So now I you have to toggle twice, meaning 4 clicks to set it back to true. Then to set a different file, also 4 clicks.

I wish we could have the Group Toggle from Metahopper. It looks real nice and does exactly what you ask for (except of course it doesn't have an output).

In the end though, if you want to pick a file it should behave just like a button, like you would have "open file" or something like that in any software. 

Well I am glad the folder browser works nicely. Any ideas why this bug happens? And why only every other time and not always!?

Afraid not, but you'll find the "scripting button issue" as a general theme here on the board. Also, this does indeed sound like something Andrew could whip out in a heartbeat.

Thanks a lot! Much better and I think this is the definitive version of the folder browser.

If you happen to be able to make one for files as well, that would be ace!

Humpf... So I just ran into another problem. As soon as you go into and back out of a cluster, the folder gets reset to <Null>. Is there a way to store true global values, that are accessible from within the whole document, ie. also inside clusters? Or even in the whole instance of GH? David was saying that clusters - even though contained in a file - are treated like seperate files.

I really wish that there was a way to create true global variables, which can be accessed using send and receive components. I am currently using this workaround where I am writing some data to custom attributes in a Rhino Layer and reading them back out. Maybe I will expand on that.

You can use the Rhino Python sticky dictionary to set/get global variables across the Rhino session (i.e. from the Rhino Python Editor and all open Grasshopper definitions and GHPython instances, how's that for global!). Note that these truly do stick around, so be careful with overriding/deleting them etc. See attached for example (also works from within a cluster).

Attachments:

Slight update: it only gets reset to Null when going to the to the top-most document. If you have the folder selector inside a cluster and then go down another layer into another cluster and come back out the data is still there. But as soon as you go to the top document and back into the cluster the data is gone.

Thank you, that one is also really nice. Everything is hidden in a cluster, so no problem about the save panel.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service