The element template property is not read only, so once you have created your element(s) you can do something like the following to assign them a template:
AFElementTemplate myTemplate = database.ElementTemplates["my template name"]; element.Template = myTemplate; element.ApplyChanges(); database.CheckIn();
Alternatively, rather than creating elements and then assigning them a template you can use the AFElements.Add method to create elements of a specifed template in one step.
Hope that helps.
Very helpful, i wasn't sure how to assign the templates, i thought it would be similar to how you add elements, but wasn't sure on how to get there.
I did end up modifying the element.add method to use the other overflow with the template included, worked perfectly!