2019-10-09 02:21:28 -05:00
|
|
|
"""
|
|
|
|
ResInsight 2d plot module
|
|
|
|
"""
|
2020-08-19 00:30:51 -05:00
|
|
|
import Commands_pb2
|
2019-10-09 02:21:28 -05:00
|
|
|
|
2021-01-21 03:45:37 -06:00
|
|
|
from .pdmobject import add_method
|
|
|
|
from .resinsight_classes import PlotWindow, Plot
|
2019-10-09 02:21:28 -05:00
|
|
|
|
2020-04-16 09:06:18 -05:00
|
|
|
|
2020-02-21 05:10:02 -06:00
|
|
|
@add_method(PlotWindow)
|
2021-01-26 13:48:01 -06:00
|
|
|
def export_snapshot(self, export_folder="", file_prefix="", output_format="PNG"):
|
|
|
|
"""Export snapshot for the current plot
|
2020-04-16 09:06:18 -05:00
|
|
|
|
2020-02-21 05:10:02 -06:00
|
|
|
Arguments:
|
|
|
|
export_folder(str): The path to export to. By default will use the global export folder
|
|
|
|
prefix (str): Exported file name prefix
|
|
|
|
output_format(str): Enum string. Can be 'PNG' or 'PDF'.
|
2020-04-16 09:06:18 -05:00
|
|
|
|
2020-02-21 05:10:02 -06:00
|
|
|
"""
|
|
|
|
return self._execute_command(
|
2021-01-26 13:48:01 -06:00
|
|
|
exportSnapshots=Commands_pb2.ExportSnapshotsRequest(
|
|
|
|
type="PLOTS",
|
|
|
|
prefix=file_prefix,
|
|
|
|
viewId=self.id,
|
|
|
|
exportFolder=export_folder,
|
|
|
|
plotOutputFormat=output_format,
|
|
|
|
)
|
|
|
|
)
|