How do I export a graphic using DPL?

Category:
Scripting
Answer

There are two ways of exporting shown plots using DPL:

  1. By using the command object ComWr (attached example "ExportGraphic.pfd")
  2. By using the WriteWMF method (attached example "ExportWMF.pfd")

Both of them are exporting the currently shown plot with the difference that ComWr is a command object, which has to be defined and later executed, but offers more file types for the export. On the other hand WriteWMF is a method, which only allows to export as a WindowsMetaFile (WMF) .

The attached examples export all plot pages to a specific folder, which is defined in the input parameters on the Basic Options page of the DPL command. The example for option 1 (ExportGraphic) also allows to set the desired file type for the export.

To use the script is necessary to have an active project and an active study case.

Other graphics, such as network graphs, can be exported by exchanging the "GrpPage" with "SetDeskpage" in the script.

Note:

For PowerFactory 2020 and earlier versions the graphic objects (GrpPage) must be exchanged with respective VI-objects (virtual instrument).

Back