Grasshopper

algorithmic modeling for Rhino

Can someone please help me. I am using several generated data files to generate my geometry through grasshopper. I had my Grasshopper program previously working until I just upgraded to the latest version.

The problem is I am using File Path to grab my data files but had it setup so that I could just dump the data files in the same directory as the grasshopper file using ".\data\" Now it is making me select the files but that hard codes the exact directory path. I prefer a working directory so that if different people use the grasshopper file they don't need to redirect file patch depending on their computer setup.

I hope that made sense. Any help would be appreciated!

 

Regards,
Marvin

Views: 1349

Replies to This Discussion

nothing?

Hi Marvin,

I'm a bit confused. You want to use the [File Path] parameter to specify directories?

--

David Rutten

david@mcneel.com

Tirol, Austria

David,

I'd like to generate data files to be read in a sub directory of where ever my grasshopper file exists. So if my GH file is in c:\xyz I can throw data files into c:\xyz\data. If c:\xyz changes to c:\abc i'd like it to still work by accessing  .\data. Make sense?

I see, you want paths relative to the current GH file.

I attached a file with a VB component which gets the current file and folder information of the GH file. You can append filenames to the folder text to get relative paths.

But note that it won't update if you saveas or change the file location some other way. You'll have to rerun the component. That's why there's a [u] input which doesn't do anything else.

--

David Rutten

david@mcneel.com

Tirol, Austria

oops.

--

David Rutten

david@mcneel.com

Tirol, Austria

Attachments:

David,

Thank you for the help. I could net get your script to work. I keep getting 'Grasshopper Document' is not declared.  It my be inaccessible due to its protection level.

 

Any idea why ".\" worked previously and now it doesn't when defining location of a data file?

 

Again thank you.

 

Regards,

Marvin

You'll need a fairly recent version of Grasshopper to run that script. Probably not the very latest one, but at least 0.9.0051

Which version do you have?

--

David Rutten

david@mcneel.com

Tirol, Austria

David,

I am running 0.9.0014. Unfortunately at work because of computer permissions I am unable to install via the ".rhp" grasshopper files. I know Rhino has instructions to unblock but our security scripts don't allow us to do so.

 

Thank you for all your help.

 

Marvin

David,

I just figured a way around our network security script and was able to utilize your script.

 

Thank you for your help!

Hi, sorry for writing so long time later...

is there any way to make it working even if it is inside a cluster?

Thank you

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