cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to edit parameters of the element on the scene

Seems like this piece of code is getting lights from the scene correctly, but the values are not saved into objects. What else am I supposed to do in order to change parameters on the element?
Thanks for the help.
 
GS::Array<API_Guid> elemList;
        ACAPI_Element_GetElemList(API_LampID, &elemList, APIFilt_OnActFloor, APIVarId_Light, APINULLGuid);
        for (const auto& e : elemList) {
            API_Element element;
            BNZeroMemory(&element, sizeof(API_Element));
            element.header.guid = e;
            if (ACAPI_Element_Get(&element, 0) == NoError) {
                element.lamp.lightColor = API_RGBColor{ 1.f, 0.f, 0.f };
                element.lamp.lightIsOn  = true;
            }
        }
1 Solution

Accepted Solutions
Use ACAPI_Element_Change to write the change back to the database.
Ralph Wessel BArch
Central Innovation

Go to post

2 Replies 2
Use ACAPI_Element_Change to write the change back to the database.
Ralph Wessel BArch
Central Innovation
Anonymous
Not applicable
Thanks! To make this post more helpful, you have to wrap the actual element changing logic into ACAPI_CallUndoableCommand because in another case you get APIERR_NEEDSUNDOSCOPE and no changes will occur.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!