How can we create an WB project schematic image similar to those created by ExportReport()?

Erik Kostson
Member, Moderator, Employee Posts: 335
✭✭✭✭
A project schematic image is created when executing the ExportReport() method (workbench scripting). This image is located in a folder with the same name as the report name (+ _images) and in the same directory. How can we though generate this or similar image but without executing the ExportReport() method?
Tagged:
0
Best Answer
-
The way to do that is to use system.drawing and bitmap class. An example is given below (change as needed):
import time import clr import os import sys clr.AddReference("System.Windows.Forms") clr.AddReference("System.Drawing") from System.Drawing import Bitmap,Graphics,Point,Size time.sleep(3) bmp = Bitmap(1920, 1200) # User defined image size g = Graphics.FromImage(bmp) g.CopyFromScreen(0,0, 0, 0, Size((1920), (1200))) bmp.Save('D:/myrep.png')
1
This discussion has been closed.