Grasshopper

algorithmic modeling for Rhino

Hi All

I have this C# Script from a while back that controls the Sun in Rhino though Grasshopper but not been able to understand how i add a way to automatically set the time zone in the same way as it work if you enter the Longitude or Latitude manually in the sun Panel in Rhino it self

This is the current code

private void RunScript(DateTime date, double lat, double lon, ref object A)
{
Rhino.Render.Sun s = doc.Lights.Sun;
s.SetPosition(date, lat, lon);

}

Found Here:

http://www.grasshopper3d.com/profiles/blogs/control-rhino-sun-syste...

Thanks

Matt

PS. If anyone had been able to control the Sun including time zone though python please post this too, as everything i have tried either returns errors or crashes Rhino in GHPython 

Views: 576

Replies to This Discussion

I don't see a way to do this without relying on an external API like google's to look up the time zone, unfortunately. 

I've got a working example in C# - got pretty far but not quite all the way to a working translation to python. My knowledge of IronPython fails at generics/ custom classes etc. 

Hope this helps you some!

Attachments:

Great I will take a look thanks. I wonder how the Rhino Sun panel controls the timezone.

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