Using this script piece based on a larger script by @Helvetosaur
I played around with the variables, and researched, but couldn’t come up with anything consistent. Here’s the part of the script I’m talking about:
bb=rs.BoundingBox(obj)
text="{}".format(layer)
dot=rs.AddTextDot(text,(bb[0]+bb[6])/2)
group=rs.AddGroup()
rs.AddObjectsToGroup([obj,dot],group)