How to find an item by name in EA model through code without iteration?
Posted: 17 Jul 2017, 08:10
Hi,
The standardFunctions.py script library provides a method namely FindEssentialInstanceByName, that could be used to find specific EA instance of a particular class. But the logic is based on a for loop by getting all direct instances of provided class. If the total number of instances are less, this method will work fine. Otherwise this method may be slow if we repeatedly call for checking existing instances before creating new instance.
Is there an out of the box, better performing mechanism to find items by name, inside a python script without using an iteration? Request to share some thoughts on this.
Thanks.
Prem
The standardFunctions.py script library provides a method namely FindEssentialInstanceByName, that could be used to find specific EA instance of a particular class. But the logic is based on a for loop by getting all direct instances of provided class. If the total number of instances are less, this method will work fine. Otherwise this method may be slow if we repeatedly call for checking existing instances before creating new instance.
Is there an out of the box, better performing mechanism to find items by name, inside a python script without using an iteration? Request to share some thoughts on this.
Thanks.
Prem