Env variables of grasshopper - Shapediver models

I wonder if there is a possibility to extract grasshopper environment variables?
It might be a GH general topic but I would like to code in my definition to extract if the GH model runs on my local machine OR at the servers of Shapediver. I would need somth very basic as DEV and PROD.

My use case:

  • Feed in JSON object from the code during development
  • Or Get the JSON from a front end or cloud storage file once in production

@Balazs_Kisfali you could do that by defining some environment variable in your local development environment, which won’t exist when your model runs on ShapeDiver. Then use a C# scripted component to check the existence and/or value of that variable.

1 Like

Hi @snabela thanks, actually I wanted something without script components, as those are subject to overview by your team once the model is uploaded to SD. Since I am frequently pushing new GH definition to SD, it would be cumbersome to wait for those reviews. …but this would solve the problem once the definition is “stabilised”, …which will be sooner or later :wink:

@Balazs_Kisfali every script that has been confirmed by us once does not need to be reviewed again, i.e. not really a problem, as long as you keep that code in a separate script.