Export active viewport to picture

 From:  Max Smirnov (SMIRNOV)
6111.2 In reply to 6111.1 
Krass, you can use this command: moi.view.screenshot ("3D", false).save("3d.png");
But it's just a screenshot. You can't set picture resolution and disable borders. It's very hard to use this command in scripts, because it catches everything above viewport (dialogs, windows, etc.)

There ia a second method:
moi.ui.mainWindow.viewpanel.getViewport('3D').renderToClipboard(1024, 1024); // Perfect! But you need to use external software to save it :(
var oShell = new ActiveXObject("Shell.Application");
oShell.ShellExecute("NirCmd.exe", "clipboard saveimage 3d.png" , "", "open", "1");

Michael,
is it possible to get something like this?:
moi.ui.mainWindow.viewpanel.getViewport('3D').render(1024, 1024).save("3d.png");

EDITED: 7 Mar 2022 by SMIRNOV