Automatic rebar tag

Hello,
I am trying to automate the placement of labels for the rebar, but I have no idea how to make it look like this:
image
The script that I made is the following


But the result is the following

and additionally, how you could do to select the type of family of the label. Thank you

Try first to fill all the inputs and see if these can help:
http://dictionary.dynamobim.com/#/Revit/Elements/Tag/Create/ByElement