Community
thanks for sharing that, it did help a lot.
using the transaction to get the viewport(1) has made all the difference, probably because there's two showing up from the parent layout's .getviewports.count method, which complicates matters when trying to retrieve the one viewport via the layout's blocktablerecord.