Click or drag to resize

ArticyDatabaseGetObject Method (UInt64, UInt32)

Gets an object by its object id and an optional instance id.

Namespace:  Articy.Unity
Assembly:  ArticyRuntime (in ArticyRuntime.dll) Version: 1.0.3
Syntax
C#
public static ArticyObject GetObject(
	ulong aObjectId,
	uint aInstanceId = 0
)

Parameters

aObjectId
Type: SystemUInt64
The id of the object in question.
aInstanceId (Optional)
Type: SystemUInt32
The instance id, can be used to get another instance of the given object.

Return Value

Type: ArticyObject
The found object with the given aObjectId or null if the id doesn't exist in the database, the object wasn't cloned with the given instance id, or the owning package is not loaded.
Remarks

This is the basic way of getting an articy object by its id. If the object is not found null will be returned. If you are using packages you might get null as a result to this call, but are sure that the object id is correct. In that case make sure the owning package is fully loaded.

Tip Tip
Remember that C# understands numbers to be written in decimal or in hexadecimal notation. You can therefore just copy and paste the object id found in articy in the model sheet as the parameter to this method
Examples
C#
// this is the same as below but in hexadecimal notation (as in articy:draft)
var manfred2 = ArticyDatabase.GetObject(0x1000001000010C6);    
// this is basically the same as above just in decimal notation
var manfred3 = ArticyDatabase.GetObject(72057598332899526);
See Also