iterateOverInstances

This function iterates over all available instances loaded in memory, it is the fastest way to find all instances. Argument entity and entityName are both optional and if non-zero are filled with respectively the entity handle and entity name as char array.

Syntax

public const string enginedll = @"engine.dll";

[DllImport(enginedll, EntryPoint = "iterateOverInstances")]
public static extern Int64 x86_iterateOverInstances(Int32 model, Int32 instance, Int32 entity, out IntPtr entityName);

[DllImport(enginedll, EntryPoint = "iterateOverInstances")]
public static extern Int64 x64_iterateOverInstances(Int64 model, Int64 instance, Int64 entity, out IntPtr entityName);

public static Int64 iterateOverInstances(Int64 model, Int64 instance, Int64 entity, out IntPtr entityName)
		{
			if (IntPtr.Size == 4)
			{
				var _result = x86_iterateOverInstances((Int32)model, (Int32)instance, (Int32)entity, out IntPtr _entityName);
				entityName = _entityName;
				return _result;
			}
			else
			{
				return x64_iterateOverInstances(model, instance, entity, out entityName);
			}
		}    

Property model

Size: 64 bit / 8 byte (value)
The handle to the model. The model handle is static during its existance. Several models can be opened simultaniously within one session. Different models are always independent, threads are allowed to be running on different models simultaniously.

Property instance

Size: 64 bit / 8 byte (value)
...

Property entity

Size: 64 bit / 8 byte (reference)
...

Property entityName

Size: 64 bit / 8 byte (reference)
???.