2021-06-0211:34 PM - last edited on 2021-09-1412:36 AM by Noemi Balogh
Hi. I'm confused about how to treat lights. I use the ModelerAPI.
From the model, I can get a list of all elements (walls, stairs, windows, doors, handrails, etc) and get their GUIDs. There is also an element of type LightElement, so that's great.
From a ModelerAPI::Model instance, I can enumerate lights by index, and it returns instances of ModelerAPI:Light classes (containing color, spot direction, range, etc).
I can also enumerate lights by index from a ModelerAPI::Element, same as from a ModelerAPI::Model.
I'm confused about what these ModelerAPI::Light instances refer to.
I can see 4 possibilities for what it means to enumerate lights by index from the model or an element. Either:
(1) A ceiling or wall element has lights attached to it and we can enumerate such lights. So for example, if there was a ceiling with 12 embedded pot lights, I could enumerate lights from the ceiling element, and I would get those 12 pot lights. (That could make sense)
(2) enumerating lights from an element only returns lights when the element is actually of type LightElement. In this case, enumerating (possibly multiple) lights means something like a light fixture with multiple light bulbs. (Might make sense too)
(3) there are, somehow, lights in the model that aren't actually Elements and aren't identifiable with a GUID. (God I hope not)
(4) refers to the list of lights that participate in the illumination of this element. (Doesn't make much sense to me)
So, which one is it?
If it's case (1), how would I find, only armed with an index and/or a ModelerAPI::Light instance, the GUID of the corresponding light element ? The ModelerAPI::Light class only contains data like color, spot direction, falloff, but nothing about the element it comes from.