This section contains a reference for the API that is accessible via the script component.
| Method | Description |
|---|---|
def RCE.close_all_outputs ( )
| Closes all outputs that are known in RCE |
def RCE.close_output (name)
| Closes the RCE output with the given name |
def RCE.fail (reason)
| Fails the RCE component with the given reason |
def RCE.get_execution_count ( )
| Returns the current execution count of the RCE component |
def RCE.get_input_names_with_datum ( )
| Returns all input names that have got a data value from RCE |
def RCE.get_output_names ( )
| Returns the read names of all outputs from RCE |
def RCE.get_state_dict ( )
| Returns the current state dictionary |
def RCE.getallinputs ( )
| Gets a dictionary with all inputs from RCE |
def RCE.read_input (name)
| Gets the value for the given input name or an error, if the input is not there (e.g. not required and it got no value) |
def RCE.read_input (name,defaultvalue)
| Gets the value for the given input name or returns the default value if there is no input connected and the input not required |
def RCE.read_state_variable (name)
| Reads the given state variables value, if it exists, else None is returned |
def RCE.read_state_variable (name,defaultvalue)
| Reads the given state variables value, if it exists, else the default value is returned and stored in the dictionary |
def RCE.write_not_a_value_output (name)
| Sets the given output to "not a value" data type |
def RCE.write_output (name,value)
| Sets the given value to the output "name" which will be read from RCE |
def RCE.write_state_variable (name,value)
| Writes a variable name in the dictionary for the components state |
def RCE.create_input_file ()
| Creates and returns a file from the input file factory Syntax: file = RCE.create_input_file () |
def add_variable (name,value)
| Adds the variable declaration of name (i.e. name = value) to the input file Syntax: file.add_variable(name, value) |
def add_comment(value)
| Adds a comment (i.e. # value) to the given file Syntax: file.add_comment(value) |
def add_dictionary (name)
| Defines an empty Python dictionary with the given name (i.e. name = {}) and adds it to
the input file. Note: The data type of name has to be String.
Syntax: file.add_dictionary(name) |
def add_value_to_dictionary (dic,key,value)
| Writes a (key,value) pair (i.e. dic[key] = value) to the
dictionary dic into the input file. Note: An
empty dictionary with the given name dic has to
be defined beforehand. Syntax: file.add_value_to_dictionary(dic, key, value) |
def write_to_file (filename)
| Writes a previously created input file to the temp, working or
tool dir, depending on the user configurations, and returns the path to
the file. The name of the written file is the given filename
. The component will fail with an error, if a file with the
given filename already exists. Note: The data
type of filename has to be String. An input
file must first be created using the
RCE.create_input_file () method. Syntax: filepath = file.write_to_file(filename) |
def write_to_file (filename,overwriteFile)
| Writes a previously created input file to the temp, working or
tool dir, depending on the user configurations, and returns the path to
the file. The name of the written file is the given filename
. The boolean parameter overwriteFile
is optional. If set to True , an existing file
with the given filename will be overwritten. The
default value is False . Note: The data type of
filename has to be String. An input
file must first be created using the
RCE.create_input_file () method. Syntax: filepath= file.write_to_file(filename, True) |