I noticed that getNodeTextPosition() returns a point in a list. This is not the right way to do it, it should just return the point for a given alias.
It should be used like this:
p = sd.getNodeTextPosition(‘ATP’)
print (p.x, p.y)
Since alias nodes are relatively rare I would add an optional argument to the method which specifies the alias node. If the argument is missing it will use alias node zero.
I noticed that getNodeTextPosition() returns a point in a list. This is not the right way to do it, it should just return the point for a given alias.
It should be used like this:
p = sd.getNodeTextPosition(‘ATP’)
print (p.x, p.y)
Since alias nodes are relatively rare I would add an optional argument to the method which specifies the alias node. If the argument is missing it will use alias node zero.
p = sd.getNodeTextPosition(‘ATP’)
If the node has an alias then a user can do:
p = sd.getNodeTextPosition(‘ATP’, alias=1)
Note it should check for errors:
p = sd.getNodeTextPosition(‘ATP’, alias=999)
Error: Alias 999 does not exist.
The way you did doesn't look great.