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
|
|
|
|
2020-08-19 00:30:51 -05:00
|
|
|
from .pdmobject import PdmObjectBase, add_method
|
2020-08-21 02:57:48 -05:00
|
|
|
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)
|
|
|
|
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(
|
2020-08-19 00:30:51 -05:00
|
|
|
exportSnapshots=Commands_pb2.ExportSnapshotsRequest(type='PLOTS',
|
2020-08-21 02:57:48 -05:00
|
|
|
prefix=file_prefix,
|
|
|
|
viewId=self.id,
|
|
|
|
exportFolder=export_folder,
|
|
|
|
plotOutputFormat=output_format))
|