Click or drag to resize

ArticyDatabaseGetObject Method (String, UInt32)

Gets an object by its technical name and instance id.

Namespace:  Articy.Unity
Assembly:  ArticyRuntime (in ArticyRuntime.dll) Version: 1.0.3
Syntax
C#
public static ArticyObject GetObject(
	string aTechnicalName,
	uint aInstanceId
)

Parameters

aTechnicalName
Type: SystemString
The technical name of the object in question.
aInstanceId
Type: SystemUInt32
The instance id of the object, use 0 for the base database object.

Return Value

Type: ArticyObject
The found object with the given aTechnicalName or null if the name doesn't exist in the database or the owning package is not loaded.
Remarks

This is the basic way of getting an articy object by its technical name. If the object is not found null will be returned.

Note Note
The technical name is case sensitive.
Tip Tip
If you are using packages you might get null as a result to this call, but are sure that the objects technical name is correct. In that case make sure the owning package is fully loaded.
Caution note Caution
Because articy:draft doesn't enforce technical name uniqueness, it is possible to have multiple objects with the same technical name. At the moment this isn't fully supported and this method will the first object with the given technical name, the order is unspecified. If you can't assure unique technical names, you might be safer using the overload.
Examples
C#
// get the cloned object with the instance id 2
var clonedManfred = ArticyDatabase.GetObject("Chr_Manfred", 2);
See Also