TheSwamp

Code Red => .NET => Topic started by: Eycki on July 26, 2012, 05:16:54 AM

Title: set/read Sun Properties values
Post by: Eycki on July 26, 2012, 05:16:54 AM
Hello,

Is there a possibility to access the sun properties from AutocAD with .NET?
I would like to put buttons on my tool palette to set geographical location, date and time. 
After setting this I want to read the calculated azimuth and altitude angles and use the values in my program.

Thx in advance!
Title: Re: set/read Sun Properties values
Post by: Eycki on July 26, 2012, 07:28:22 AM
It seems that there are system variables for time, date, longitude, latitude and timezone...
Now need to know how to read azimuth and altitude angles
Title: Re: set/read Sun Properties values
Post by: kaefer on July 26, 2012, 07:38:16 AM
It seems that there are system variables for time, date, longitude, latitude and timezone...
Now need to know how to read azimuth and altitude angles

Did you consult the Object Browser regarding AcDbMgd.dll? It appears that there's a SunId property for either Autodesk.AutoCAD.DatabaseServices.Viewport or Autodesk.AutoCAD.DatabaseServices.SkyBackground, and that the Sun object accessible in this way would provide both an Altitude and an Azimuth property.
Title: Re: set/read Sun Properties values
Post by: Eycki on July 26, 2012, 07:58:39 AM
Thx for the help.  I found Autodesk.AutoCAD.DatabaseServices.Sun which includes all the parameters.