We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

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

Exception/Crash with ModelerAPI::Model::GetLight?

drjustice
Newcomer
I am experiencing a problem when enumerating the lights in a model.

- Load the S-Office sample
- Call ModelerAPI::Model::GetLightCount(), returns 253 lights in the model.
- Call ModelerAPI::Model::GetLight(4, &light), and argument 4 causes exception to be thrown.

If there are 253 lights in hte model, is there a reason I can't access them from the model?

Also, are the 253 lights the same lights that belong to the elements of the model?
1 REPLY 1
Akos Somorjai
Graphisoft
Graphisoft
Hi,

There are a few special lights in the project, please see the code snippet below:
		for (i = 1; i <= nLight; i++) {
			if (elemIndex == 0) // 3 special lights
				model->GetLight (i, &light);
			else
				elem.GetLight (i, &light);
Hope this helps, Ákos

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!