Grasshopper

algorithmic modeling for Rhino

change tree path item and convert number to date

Hallo :),

I have the following questions, if someone can further help me would be grateful (Attached file is part of my definition):

a - How can i convert the path number to a specific number: in my example, i want 0, 1, 2, ... to be converted to 156.0, 126.0, 96.0, ...

b- How can i convert the numbers 156.0, 126.0, 96.0...(which are Julian Date Calendar) to normal dates: 156.0 is June 5th, 126.0 is may 6th, 96.0 is April 6th...etc.

thank you in advance!

nass

Views: 1244

Attachments:

Replies to This Discussion

For part 1 see attached file. It's most likely not the best solution though. 

For part 2 I suspect you'll need a script that also takes into account leap years.

Attachments:

cool! part 1 works somehow till now

thx

For the first question. I don't even know what a Julian date calendar is, so that's all from me.M.

Maybe Geco has some dates components, though I don't have it installed at the moment. 

Nicely done Marios.

mmm, ok i will try to check the formula from wikipedia to convert the values to date...

attached is a table of julian date

thx though

Attachments:

Ty, 

I am always too lazy and try to use less components.

:)

Can i replace a Branch number by text, or string? 

I mean, part 1 works for me, but I need now to change the branches to string/text (i.e date) 

for instance, what you have in your picture: 66 to March 7, 96 to April 06...

thx !

No, you can't do that. the GH_path class can only take an Integer as an argument.

There's a built-in class in DotNet that handles date time functions. I'm pretty sure David is implementing native date + time components for the next release of GH, but in the meantime, this script will convert a day of year and a year into a full date in a couple formats.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service