Skip to main content
Definition: ModelCenter/src/ModelCenter.odl (line 1395) COM Instance. Inherits from:

Members

Properties

Property Variables

Definition: ModelCenter/src/ModelCenter.odl (line 1)
Return type: VARIANT

Property Groups

Definition: ModelCenter/src/ModelCenter.odl (line 1)
Return type: VARIANT

Property userData

Definition: ModelCenter/src/ModelCenter.odl (line 1)
Return type: VARIANT

Property AssociatedFiles

Definition: ModelCenter/src/ModelCenter.odl (line 1)
Return type: VARIANT

Property IndexInParent

Definition: ModelCenter/src/ModelCenter.odl (line 1)
Return type: int

Property ParentAssembly

Definition: ModelCenter/src/ModelCenter.odl (line 1)
Return type: LPDISPATCH

Property language

Definition: ModelCenter/src/ModelCenter.odl (line 1)
The script language. Must be set prior to setting the source. Return type: BSTR

Property timeout

Definition: ModelCenter/src/ModelCenter.odl (line 1)
The script timeout in seconds. Use -1 to set no timeout. Return type: double

Property forwardSchedule

Definition: ModelCenter/src/ModelCenter.odl (line 1)
True to run the component in forward scheduling mode. Return type: boolean

Property prevalidate

Definition: ModelCenter/src/ModelCenter.odl (line 1)
True to pre-validate the component. Return type: boolean

Public functions

Function getName

Gets the name of the Component. Returns: The name of the Component. Return type: BSTR Reimplements: getName

Function getFullName

Gets the full ModelCenter path of the Component. Returns: the full ModelCenter path of the Component. Return type: BSTR Reimplements: getFullName

Function run

Runs the Component. Return type: void Reimplements: run

Function getSource

Gets the source of the Component. Returns: The source of the Component. Return type: BSTR Reimplements: getSource

Function invokeMethod

Invokes one of the Component’s methods. Parameters:
  • method: The name of the method to invoke.
Parameters:
  • BSTR method
Return type: void Reimplements: invokeMethod

Function invalidate

Invalidates the Component and all of its variables. Return type: void Reimplements: invalidate

Function reconnect

Reconnect a Component. Return type: void Reimplements: reconnect

Function downloadValues

Downloads the component’s variable values from ModelCenter Remote Execution, if it’s a MCRE component. Return type: void Reimplements: downloadValues

Function getVariable

Gets the Variable by the specified name. Parameters:
  • name: The name of the variable to retrieve in dotted notation relative to the Component.
Returns: IDispatch* to an IVariable object. Parameters:
  • BSTR name
Return type: LPDISPATCH Reimplements: getVariable

Function getPositionX

Return type: int Reimplements: getPositionX

Function getPositionY

Return type: int Reimplements: getPositionY

Function rename

Renames the current Component. Parameters:
  • name: New name of the Component.
Parameters:
  • BSTR name
Return type: void Reimplements: rename

Function getType

Gets the type of the component. Valid types include:
  • Component
  • Assembly
  • Sequence
  • If
  • Parallel
  • Empty
  • ForEach
Returns: The type of the component. Return type: BSTR Reimplements: getType

Function show

Show the GUI form associated with the component, if any. Return type: void Reimplements: show

Function setSourceFromString

Sets the source script code of the script component to the given string. The source code is parsed baesd on the current language setting. The script language should be set before calling this function. Parameters:
  • script: string value to use as the script code
Parameters:
  • BSTR script
Return type: void

Function setSourceFromFile

Sets the source script code of the script component to the contents of the file. The source code is parsed baesd on the current language setting. The script language should be set before calling this function. Parameters:
  • file: the full path of the file
Parameters:
  • BSTR file
Return type: void

Function addVariable

Adds the variable to the component. Parameters:
  • name: the name of the variable
  • type: the type of the variable e.x. “double”, “string[]”, “object”, etc
  • state: the state of the variable e.x. “input”, “output”
Returns: the IVariable object of the newly created variable Parameters:
  • BSTR name
  • BSTR type
  • BSTR state
Return type: LPDISPATCH

Function removeVariable

Removes the variable from the component. Parameters:
  • name: the name of the variable to remove
Parameters:
  • BSTR name
Return type: void

Function setVariables

Sets the variables of the component. Previous variables of this component are removed. Parameters:
  • inputs: comma separated list of input variables e.x. “long n, double[] p, …”
  • outputs: comma separated list of output variables e.x. “double x, string y, …”
Parameters:
  • VARIANT inputs
  • BSTR outputs
Return type: void

Function getSourceScript

Gets the source script code of the script component. Returns: the source script Return type: BSTR