> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Interface ModelCenter::IScriptComponent

![][IDL]
![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1395)

COM Instance.

**Inherits from**:

* [ModelCenter::IComponent](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md)

## Members

* [addVariable](#interfaceModelCenter_1_1IScriptComponent_1a04bbcea36b9bb694385e8620fa0a6b11)
* [AssociatedFiles](#interfaceModelCenter_1_1IScriptComponent_1a42162de74b1b046b277b927ace2dd403)
* [downloadValues](#interfaceModelCenter_1_1IScriptComponent_1ae380bd13a2c92b3392432f879e87baf2)
* [forwardSchedule](#interfaceModelCenter_1_1IScriptComponent_1aedc1fa62c68c5512ccfe6913e018610c)
* [getFullName](#interfaceModelCenter_1_1IScriptComponent_1a7e4a9eb5127e60bfbbd90640e35b32a7)
* [getMetadata](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a2bd6e585619f4cd76426932b62dcf60a)
* [getName](#interfaceModelCenter_1_1IScriptComponent_1a88c3162ff460faee36d43d3903c7a498)
* [getPositionX](#interfaceModelCenter_1_1IScriptComponent_1aa032eb6b3c27a69052a8eb81053dfc34)
* [getPositionY](#interfaceModelCenter_1_1IScriptComponent_1a7b5ce3f6ce5bfd44702ff1fb874fb9fd)
* [getSource](#interfaceModelCenter_1_1IScriptComponent_1a3dc2690409dd67fc5b3023e50d7abed0)
* [getSourceScript](#interfaceModelCenter_1_1IScriptComponent_1af377a582a930edbc7b4a56b57cd54375)
* [getType](#interfaceModelCenter_1_1IScriptComponent_1a551d15c4f328f341d8cba0fe28bfd2b0)
* [getVariable](#interfaceModelCenter_1_1IScriptComponent_1ad88148c419a4c75c4c79b9d5e3c41eb6)
* [Groups](#interfaceModelCenter_1_1IScriptComponent_1a6d041596bb6e0be6dd0710c6c9e0e8c9)
* [IndexInParent](#interfaceModelCenter_1_1IScriptComponent_1a20f2c6a05beb38eb4d95a010cb48f94e)
* [invalidate](#interfaceModelCenter_1_1IScriptComponent_1a70b40fcdb20ca2991b3db649f77eb55f)
* [invokeMethod](#interfaceModelCenter_1_1IScriptComponent_1a03484bf5c7636d2015b3b11c3849ac30)
* [language](#interfaceModelCenter_1_1IScriptComponent_1af3d2bdfd6cd0c29ada055bee3686b2ff)
* [ParentAssembly](#interfaceModelCenter_1_1IScriptComponent_1a48996a90eb72b62a9dff1119708c9d42)
* [prevalidate](#interfaceModelCenter_1_1IScriptComponent_1a0f82cdd3e9fa556568265ef51c8bc0de)
* [reconnect](#interfaceModelCenter_1_1IScriptComponent_1a716d694026d6ef45a78ab51a8d1f6eae)
* [removeVariable](#interfaceModelCenter_1_1IScriptComponent_1a6b191d44fea8ec432315202d094acdb0)
* [rename](#interfaceModelCenter_1_1IScriptComponent_1a775db6663f994e82bb2529efe6585c8d)
* [run](#interfaceModelCenter_1_1IScriptComponent_1afcc83d74aabc7ddd66da4fccb708f0e9)
* [setMetadata](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a41eb816b08e0e89739822ba87e5416c6)
* [setSourceFromFile](#interfaceModelCenter_1_1IScriptComponent_1aa34064721143d9012bfe5c0c899415a8)
* [setSourceFromString](#interfaceModelCenter_1_1IScriptComponent_1ab41aea5c06252f82fc831ea6af40e1b1)
* [setVariables](#interfaceModelCenter_1_1IScriptComponent_1a03a16eed6dbd98df2286d42f3a47db56)
* [show](#interfaceModelCenter_1_1IScriptComponent_1ad7d6f94d38270f36b80ed3c0109312dd)
* [timeout](#interfaceModelCenter_1_1IScriptComponent_1a3a0d87f35ccd9845a8dc70e1ccf531eb)
* [userData](#interfaceModelCenter_1_1IScriptComponent_1ade9f3ed3c58d1f3eb9914c3a395eb7a6)
* [Variables](#interfaceModelCenter_1_1IScriptComponent_1a54219eed78fa8eed485e8da974458ea1)

## Properties

### Property Variables

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
VARIANT ModelCenter::IScriptComponent::Variables
```

**Return type**: VARIANT

### Property Groups

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
VARIANT ModelCenter::IScriptComponent::Groups
```

**Return type**: VARIANT

### Property userData

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
VARIANT ModelCenter::IScriptComponent::userData
```

**Return type**: VARIANT

### Property AssociatedFiles

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
VARIANT ModelCenter::IScriptComponent::AssociatedFiles
```

**Return type**: VARIANT

### Property IndexInParent

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
int ModelCenter::IScriptComponent::IndexInParent
```

**Return type**: int

### Property ParentAssembly

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
LPDISPATCH ModelCenter::IScriptComponent::ParentAssembly
```

**Return type**: LPDISPATCH

### Property language

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
BSTR ModelCenter::IScriptComponent::language
```

The script language. Must be set prior to setting the source.

**Return type**: BSTR

### Property timeout

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
double ModelCenter::IScriptComponent::timeout
```

The script timeout in seconds. Use -1 to set no timeout.

**Return type**: double

### Property forwardSchedule

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
boolean ModelCenter::IScriptComponent::forwardSchedule
```

True to run the component in forward scheduling mode.

**Return type**: boolean

### Property prevalidate

![][public]

**Definition**: `ModelCenter/src/ModelCenter.odl` (line 1)

```text theme={null}
boolean ModelCenter::IScriptComponent::prevalidate
```

True to pre-validate the component.

**Return type**: boolean

## Public functions

### Function getName

![][public]

```text theme={null}
BSTR ModelCenter::IScriptComponent::getName()
```

Gets the name of the Component.

**Returns**:

The name of the Component.

**Return type**: BSTR

**Reimplements**: [getName](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a19763f04596904ff5cab2f4f72f6f501)

### Function getFullName

![][public]

```text theme={null}
BSTR ModelCenter::IScriptComponent::getFullName()
```

Gets the full [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/namespaceModelCenter) path of the Component.

**Returns**:

the full ModelCenter path of the Component.

**Return type**: BSTR

**Reimplements**: [getFullName](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a9309a89032b2d7d28baf279a3b76b5e8)

### Function run

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::run()
```

Runs the Component.

**Return type**: void

**Reimplements**: [run](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1adf60ad0c84852250f14d27cfa689d8d0)

### Function getSource

![][public]

```text theme={null}
BSTR ModelCenter::IScriptComponent::getSource()
```

Gets the source of the Component.

**Returns**:

The source of the Component.

**Return type**: BSTR

**Reimplements**: [getSource](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a7ee6752f95f3bdfbe83132a3a7794cb2)

### Function invokeMethod

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::invokeMethod(BSTR method)
```

Invokes one of the Component's methods.

**Parameters**:

* **method**: The name of the method to invoke.

**Parameters**:

* BSTR **method**

**Return type**: void

**Reimplements**: [invokeMethod](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1afaddb2c21be03b26716594af883a51ee)

### Function invalidate

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::invalidate()
```

Invalidates the Component and all of its variables.

**Return type**: void

**Reimplements**: [invalidate](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a73c230184c72f5abcb7d3af5f91c9d1e)

### Function reconnect

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::reconnect()
```

Reconnect a Component.

**Return type**: void

**Reimplements**: [reconnect](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a44d641cc9d4a797f88e56495c466479c)

### Function downloadValues

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::downloadValues()
```

Downloads the component's variable values from [ModelCenter](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/namespaceModelCenter) Remote Execution, if it's a MCRE component.

**Return type**: void

**Reimplements**: [downloadValues](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a761c665246557b5b4201873a722d6fed)

### Function getVariable

![][public]

```text theme={null}
LPDISPATCH ModelCenter::IScriptComponent::getVariable(BSTR name)
```

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](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IVariable.md) object.

**Parameters**:

* BSTR **name**

**Return type**: LPDISPATCH

**Reimplements**: [getVariable](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1afb270ae53383589c63f87b4e3385f128)

### Function getPositionX

![][public]

```text theme={null}
int ModelCenter::IScriptComponent::getPositionX()
```

**Return type**: int

**Reimplements**: [getPositionX](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a0c3e0c952584ba25801114e01010eab0)

### Function getPositionY

![][public]

```text theme={null}
int ModelCenter::IScriptComponent::getPositionY()
```

**Return type**: int

**Reimplements**: [getPositionY](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1ad3da2b98a973112ea897cf3b146f0276)

### Function rename

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::rename(BSTR name)
```

Renames the current Component.

**Parameters**:

* **name**: New name of the Component.

**Parameters**:

* BSTR **name**

**Return type**: void

**Reimplements**: [rename](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a9cae71e48e01e94d48c0353d3db4d90c)

### Function getType

![][public]

```text theme={null}
BSTR ModelCenter::IScriptComponent::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](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1a04395c5a8d6ceff26ae08e6c001bdd45)

### Function show

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::show()
```

Show the GUI form associated with the component, if any.

**Return type**: void

**Reimplements**: [show](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IComponent.md#interfaceModelCenter_1_1IComponent_1aa35c0fb45f677b3c2daf475e53107773)

### Function setSourceFromString

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::setSourceFromString(BSTR script)
```

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

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::setSourceFromFile(BSTR file)
```

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

![][public]

```text theme={null}
LPDISPATCH ModelCenter::IScriptComponent::addVariable(BSTR name, BSTR type, BSTR state)
```

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](https://developer.synopsys.com/docs/modelcenter/modelcenter-apis/modelcenter-api-md/interfaceModelCenter_1_1IVariable.md) object of the newly created variable

**Parameters**:

* BSTR **name**
* BSTR **type**
* BSTR **state**

**Return type**: LPDISPATCH

### Function removeVariable

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::removeVariable(BSTR name)
```

Removes the variable from the component.
**Parameters**:

* **name**: the name of the variable to remove

**Parameters**:

* BSTR **name**

**Return type**: void

### Function setVariables

![][public]

```text theme={null}
void ModelCenter::IScriptComponent::setVariables(VARIANT inputs, BSTR outputs)
```

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

![][public]

```text theme={null}
BSTR ModelCenter::IScriptComponent::getSourceScript()
```

Gets the source script code of the script component.
**Returns**:

the source script

**Return type**: BSTR

[IDL]: https://img.shields.io/badge/language-IDL-blue "IDL"

[public]: https://img.shields.io/badge/-public-brightgreen "public"

[private]: https://img.shields.io/badge/-private-red "private"
