Hassam,
Using the an entity's name in this way does work, but it is ugly and slow. It would be much better to add an attribute to each prototype entity (e.g. 'type') and assign it value as 1, 2, or 3. The input to the Choice keyword for your Branch object would then be this.obj.type.
If, for some reason, it is more convenient to assign a name instead of a number to each entity type, say "a", "b", and "c", then the Choice input would be:
'this.obj.type == "a" ? 1 : (this.obj.type == "b" ? 2 : 3)'
Harry