Open question about global_map.instance_iter()
I stumbled upon this function which is useful for iterating over 'counters' or 'axes'. However global_map.instance_iter('controllers')
raises an exception because under 'controllers' you can have strings
like 'wago'.
It may be possible to skip 'strings' and get what is under string nodes recursively (or not).
But I'm not sure if it's something we want to do. Maybe there is just no need to call this over 'controllers' ?
def instance_iter(self, tag):
node_list = list(self.G[tag])
for node_id in node_list:
node = self.G.node.get(node_id)
if node is not None:
try:
inst_ref = self.G.node.get(node_id)["instance"]
except KeyError:
continue
inst = inst_ref()
if inst:
yield inst
Edited by Benoit Formet