Add save() as a command to the python interface

Fix export_snapshot issue
This commit is contained in:
Jacob Støren 2019-12-17 13:27:02 +01:00
parent 7f393f5ad8
commit 2ca3345a20
2 changed files with 15 additions and 1 deletions

View File

@ -323,6 +323,11 @@ message ExportContourMapToTextRequest
int32 viewId = 5;
}
message SaveProjectRequest
{
string filePath = 1;
}
/* CommandParams handles both command name and parameters in one.
* The message type and content is used as parameters and
* the name of the variable is used to find the command name. */
@ -372,6 +377,7 @@ message CommandParams
ExportWellLogPlotDataRequest exportWellLogPlotData = 36;
SetWindowSizeParams setPlotWindowSize = 37;
ExportContourMapToTextRequest exportContourMapToText = 38;
SaveProjectRequest saveProject = 39;
}
}

View File

@ -36,6 +36,14 @@ class Project(PdmObject):
"""
self._execute_command(openProject=Cmd.FilePathRequest(path=path))
return self
def save(self, path=""):
"""Save the project to the existing project file, or to a new file
Arguments:
path(str): File path to the file to save the project to. If empty, saves to the active project file
"""
self._execute_command(saveProject=Cmd.SaveProjectRequest(filePath=path))
return self
def close(self):
"""Close the current project (and open new blank project)"""
@ -223,7 +231,7 @@ class Project(PdmObject):
"""
return self._execute_command(
exportSnapshots=Cmd.ExportSnapshotsRequest(
type=snapshot_type, prefix=prefix, caseId=-1))
type=snapshot_type, prefix=prefix, caseId=-1, viewId=-1 ))
def export_well_paths(self, well_paths=None, md_step_size=5.0):
""" Export a set of well paths