Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

How to get Sun Guid?

Anonymous
Not applicable
Hi. I'm trying to figure out how do I get the guid of the sun ( if this is even possible ? ). All that I've found is API_SunInfo which is not helpful for me, the 2nd approach is returning empty GS::Array.
Thanks for your assistance.

API_SunInfo sunInfo = {};
GSErrCode err2 = ACAPI_Environment( APIEnv_GetSunSetsID, &sunInfo, nullptr, nullptr );
My another try using elem list

GS::Array<API_Guid> elemList;
GSErrCode err = ACAPI_Element_GetElemList( API_SkylightID, &elemList, APIFilt_None, APIVarId_Skylight, APINULLGuid );
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Anonymous
Not applicable
My intention was to get the Sun for the Corona render element. I've got it covered now, thanks anyway!

View solution in original post

4 REPLIES 4
Akos Somorjai
Graphisoft
Graphisoft
Hi,

The sun is _not_ an ARCHICAD element, so the first option is the only way to go.

Best, Akos
Anonymous
Not applicable
Yes, but it returns just the API_SunInfo. Also, I can get SunSettings from the Modeler. But how can I obtain the Sun pointer/reference??
Akos Somorjai
Graphisoft
Graphisoft
Hi,

There's no sun object in ARCHICAD, it is a built-in entity. What kind of information would you like to obtain from that?

Best, Akos
Solution
Anonymous
Not applicable
My intention was to get the Sun for the Corona render element. I've got it covered now, thanks anyway!