Processing SysML blocks based on "y" position when accessing through relationships

I’m using Doc. Composer element templates to embed paragraphs in a Word document. Currently, the templates take a “root” SysML block, and recursively process “child” SysML blocks that are related to the “parent” via a shared association. This works fine, except I now need to control the order in which the “children” are processed. I have each tree of SysML blocks and their relationships defined on a block definition diagram, and I thought I could use the example for sorting elements according to their location in diagram, but since my loops are processing relationships, that doesn’t appear to work. Any suggestions?

Would you please share your Doc. Composer template and sample project so that we can see how you loop through the elements and suggest the way for sorting the elements? Look forward to hearing from you.

Here’s some reference information. Let me know if you can’t access the files.

  1. A Word document describing the templates, etc
  1. The VPP file itself.