Help I need Somebody..how do I pattern 3d section with a template

I have created a template in a dgnlib file to pattern 3d sections. It works, but I have to assign the template using element id.

that's a pain.

How can this be automated?  I want to pick the template, create the 3d elements and sections and then the sections are patterned