SOLVED!
How to edit parameters of the element on the scene
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-03-06
04:40 PM
- last edited on
‎2021-09-15
12:38 PM
by
Noemi Balogh
‎2020-03-06
04:40 PM
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.
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; } }
Solved! Go to Solution.
Labels:
- Labels:
-
Add-On (C++)
1 ACCEPTED SOLUTION
Accepted Solutions
Solution
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-03-07 06:46 PM
‎2020-03-07
06:46 PM
Use ACAPI_Element_Change to write the change back to the database.
Ralph Wessel BArch
Central Innovation
Central Innovation
2 REPLIES 2
Solution
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-03-07 06:46 PM
‎2020-03-07
06:46 PM
Use ACAPI_Element_Change to write the change back to the database.
Ralph Wessel BArch
Central Innovation
Central Innovation
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎2020-03-09 11:24 AM
‎2020-03-09
11:24 AM
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.