poIModel SetResult

Attaches the given result file to the model.

Syntax

model_handle SetResultfile_name (reader_name)

Application

HyperView Tcl Import

Description

This command attaches the given result file to the model. Only one result file can be attached at any given time. The new result file overrides any previously attached one. The first registered reader that recognizes the file format will attempt to load it. If no reader was found to load the file, a proper message is displayed and a warning code is returned. In most cases, you don’t need to specify the reader name as a second argument. However, if you know that the file format can be recognized by more than one reader, you can specify the reader name as a second argument. You can get a list of available readers by using GetResultReaderList command.

Inputs

file_name
The result file name to be loaded.
reader_name (Optional)
Fully qualified reader name, for example “LS-DYNA d3plot Result Reader”.

Context

Example

To attach a result file after loading the model file; both files are in demos directory “C:\Altair\hw\demos\mv_hv_hg\animation\dyna\bumper\d3plot”:
hwi OpenStack
hwi GetSessionHandle session_handle
session_handle GetProjectHandle project_handle
project_handle GetPageHandle page_handle [project_handle GetActivePage]
page_handle GetWindowHandle window_handle [page_handle GetActiveWindow]
window_handle GetClientHandle client_handle
client_handle GetModelHandle model_handle [client_handle GetActiveModel]
set file_name C:/Altair/hw/demos/mv_hv_hg/animation/dyna/bumper/d3plot
model_handle SetResult $file_name
hwi CloseStack

Errors

This command returns success if the filename is valid and at least one registered reader was able to recognize the format. In the case of any failure, a warning code is returned and not an error. To see if you have successfully loaded the results file, you can get the result handle. This results in an error code if results were not loaded.
Note: The post result read TCL commands will not be executed using this command, if the current active window is not a HyperView window.
Example:
...
set file_name C:/Altair/hw/demos/mv_hv_hg/animation/dyna/bumper/d3plot
model_handle SetResult $file_name

if { [ catch { [model_handle GetResultCtrlHandle result_handle] }]} {
	# error attaching result
	return
}
# continue execution
...