Civil 3D Iterating through Xref RasterImage list, loading to Clipboard and pasting OLE

I’m developing a graph to get all linked images, load them into the Windows clipboard and paste into the current document using the system API.

I can get it working on single Xrefs, however when I try to iterate over a list it only pastes the last image multiple times.

Here is the code using RasterImage.Path (index 0) and RasterImage.Orientation.Origin (index 3)

import sys
import clr
import os

# Add Assemblies for AutoCAD
clr.AddReference('AcMgd')
clr.AddReference('AcCoreMgd')
clr.AddReference('AcDbMgd')

# Import references from AutoCAD
from Autodesk.AutoCAD.Runtime import *
from Autodesk.AutoCAD.ApplicationServices import *
from Autodesk.AutoCAD.EditorInput import *
from Autodesk.AutoCAD.DatabaseServices import *
from Autodesk.AutoCAD.Geometry import *
# Remove conflicting method
del globals()["Image"]

adoc = Application.DocumentManager.MdiActiveDocument

# Add Assemblies for Windows
clr.AddReference("System.Windows.Forms")
clr.AddReference("System.Drawing")

# Import references from Windows
from System.Windows.Forms import Clipboard
from System.Drawing import Image

output = []

for raster in IN[0]:
    imgpath = raster[0]
    if isinstance(imgpath, str) and os.path.isfile(imgpath):
        img = Image.FromFile(imgpath)
        Clipboard.Clear()
        Clipboard.SetImage(img)
        
        if Clipboard.ContainsImage():
            origin = raster[3]
            comstr = "_.PASTECLIP\n" + str(origin.X) + "," + str(origin.Y) + "\n"
            
            adoc.SendStringToExecute(comstr, True, False, True)
        
            output.append([True, raster[3:]])
      
        else:
            output.append([False])        
    else:
        output.append([False])
        
OUT = output

What I am thinking is that the SendStringToExecute is being queued while the python script and system calls are being run and then executed as the loop or graph completes. I also tried time.sleep() in the loop and a custom node with longest lacing to no avail.

Ed: It appears SendStringToExecute is asynchronous and the synchronous editor.Command() keeps throwing an exception

Can anyone assist with Dynamo list loop that can push items through a sub-graph one at a time or any API calls that can synchronously send a command?

Solved using Autodesk.AutoCAD.Interop.dll

clr.AddReference('Autodesk.AutoCAD.Interop')
from Autodesk.AutoCAD.Interop import *
app = Application.AcadApplication
...
app.ActiveDocument.SendCommand(comstr)