Site Tools


Turn Sun On and Set Longitude and Latitude

Developer: FlamingoScript
Summary: Demonstrates how to set longitude and latitude for sun placement

Question

I am trying to figure out how to turn the sun on and and specify a longitude and latitude to calculate the sun location. What can I do?

Answer

The following are examples of how to turn the sun on and specify a latitude and longitude.

Python

import clr
# Load the Flamingo nXt SDK DLL
clr.AddReference("FlamingoNXtSDK")
import FlamingoNXtSDK
# Get the Flamingo nXt plug-in's SDK implimentaion, this will force the
# plug-in to load if it is not currently loaded
flSDK = FlamingoNXtSDK.SDK.FlamingoSDK
 
def SetSunLongLat():
    sun = flSDK.GetSun()
    print "On:", flSDK.IsSunOn()
    print "SpecifyAzimuthAndAltitiude:", sun.SpecifyAzimuthAndAltitiude
    print "Longitude:", sun.Longitude
    print "Altitude:", sun.Latitude
    flSDK.SetIsSunOn(True)
    sun.SpecifyAzimuthAndAltitiude = False
    sun.Latitude = 47.606
    sun.Longitude = -122.331
    flSDK.SetSun(sun)
    sun = flSDK.GetSun()
    print "On:", flSDK.IsSunOn()
    print "SpecifyAzimuthAndAltitiude:", sun.SpecifyAzimuthAndAltitiude
    print "Longitude:", sun.Longitude
    print "Latitude:", sun.Latitude
 
if __name__=="__main__":
    SetSunLongLat()
flamingo/flamingosdk/setsunlonglat.txt · Last modified: 2016/03/03 by sandy