cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

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

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!