sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    A thought to determine date and time in a DC?

    Scheduled Pinned Locked Moved Dynamic Components
    sketchup
    7 Posts 3 Posters 1.2k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      matthew.robert
      last edited by

      It dawned on me today that there might be a way to determine the date and time for use in Dynamic Component formulas... for instance if you wanted foliage color to change or completely disappear based on the season.

      There are a handful of online calculators, such as http://aa.usno.navy.mil/data/docs/AltAz.php, that will determine azimuth and altitude based of date, time, latitude and longitude. Could not that formula be rearranged to determine a model's date and time based of the LAT(), LNG(), SUNELEVATION(), and SUNANGLE() functions?

      Correct me if I am wrong, but are not the functions SUNELEVATION() and SUNANGLE() equal to altitude and azimuth?

      -Matt

      1 Reply Last reply Reply Quote 0
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        That is an interesting thought. It sounds possible. Do any azimuth/altitude pairs ever repeat throughout the year?

        It might be a fun challenge to get that to work. It might be more fruitful to just request that time and date be integrated into the next round of DC's though πŸ˜„

        Chris

        Lately you've been tan, suspicious for the winter.
        All my Plugins I've written

        1 Reply Last reply Reply Quote 0
        • M Offline
          matthew.robert
          last edited by

          Hey Chris, I had a feeling that you would reply.

          As for the Alt/Azm pairs... I think they would repeat at different places, but I also think that a pair at a specific location would be unique to an exact date/time.

          1 Reply Last reply Reply Quote 0
          • Chris FullmerC Offline
            Chris Fullmer
            last edited by

            Here's a start:

            http://www.itacanet.org/eng/elec/solar/sun3.pdf

            I would guess that if you can get your head around that math, you should be set πŸ˜„

            Chris

            Lately you've been tan, suspicious for the winter.
            All my Plugins I've written

            1 Reply Last reply Reply Quote 0
            • J Offline
              Jim
              last edited by

              I wrote a ruby function to get the date in a DC. I'll look it up... OK.

              To use, drop the attachment into your Plugins folder.

              to get the current time, use =now()
              and the date: =today()

              I would guess the values get updated whenever the DC is redrawn.

              
              class DCFunctionsV1
                  protected
                  def now(a=nil)
              	return Time.now.strftime("%H;%M;%S")
                  end
                  def today(a=nil)
              	return Time.now.strftime("%m-%d-%Y")
                  end
              end
              
              

              dc_time.rb

              Hi

              1 Reply Last reply Reply Quote 0
              • M Offline
                matthew.robert
                last edited by

                @jim said:

                I wrote a ruby function to get the date in a DC.

                For that to work on DC, does it need to be installed on each machine that uses the DC, or does it somehow embed the information in a distributable DC?

                1 Reply Last reply Reply Quote 0
                • Chris FullmerC Offline
                  Chris Fullmer
                  last edited by

                  Unfortunately it would have to be installed on each machine. That's why I think you should tackle the math in that pdf I linked to Matt. Your method would be do-able inside a DC, without loading any scripts.

                  Chris

                  Lately you've been tan, suspicious for the winter.
                  All my Plugins I've written

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement