Skip to main content

ModelCenter APIs 2025 R1

Interface ModelCenter::IIfComponent

Last update: 16.07.2025

Definition: ModelCenter/src/ModelCenter.odl (line 1293)

COM Instance.

Inherits from:

Members

Properties

Property Variables

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

VARIANT ModelCenter::IIfComponent::Variables

Return type: VARIANT

Property Groups

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

VARIANT ModelCenter::IIfComponent::Groups

Return type: VARIANT

Property userData

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

VARIANT ModelCenter::IIfComponent::userData

Return type: VARIANT

Property AssociatedFiles

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

VARIANT ModelCenter::IIfComponent::AssociatedFiles

Return type: VARIANT

Property IndexInParent

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

int ModelCenter::IIfComponent::IndexInParent

Return type: int

Property ParentAssembly

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

LPDISPATCH ModelCenter::IIfComponent::ParentAssembly

Return type: LPDISPATCH

Property exclusive

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

boolean ModelCenter::IIfComponent::exclusive

The If exclusive mode.

Returns:

Yes (TRUE) or no (FALSE).

Return type: boolean

Property runLastBranchByDefault

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

boolean ModelCenter::IIfComponent::runLastBranchByDefault

The "has default" flag.

Returns:

YES (TRUE) or no (FALSE).

Return type: boolean

Public functions

Function getName

BSTR ModelCenter::IIfComponent::getName()

Gets the name of the Component.

Returns:

The name of the Component.

Return type: BSTR

Reimplements: getName

Function getFullName

BSTR ModelCenter::IIfComponent::getFullName()

Gets the full ModelCenter path of the Component.

Returns:

the full ModelCenter path of the Component.

Return type: BSTR

Reimplements: getFullName

Function run

void ModelCenter::IIfComponent::run()

Runs the Component.

Return type: void

Reimplements: run

Function getSource

BSTR ModelCenter::IIfComponent::getSource()

Gets the source of the Component.

Returns:

The source of the Component.

Return type: BSTR

Reimplements: getSource

Function invokeMethod

void ModelCenter::IIfComponent::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

Function invalidate

void ModelCenter::IIfComponent::invalidate()

Invalidates the Component and all of its variables.

Return type: void

Reimplements: invalidate

Function reconnect

void ModelCenter::IIfComponent::reconnect()

Reconnect a Component.

Return type: void

Reimplements: reconnect

Function downloadValues

void ModelCenter::IIfComponent::downloadValues()

Downloads the component's variable values from ModelCenter Remote Execution, if it's a MCRE component.

Return type: void

Reimplements: downloadValues

Function getVariable

LPDISPATCH ModelCenter::IIfComponent::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 object.

Parameters:

  • BSTR name

Return type: LPDISPATCH

Reimplements: getVariable

Function getPositionX

int ModelCenter::IIfComponent::getPositionX()

Gets the X position of the component in the Analysis View.

Returns:

The X position.

Return type: int

Reimplements: getPositionX

Function getPositionY

int ModelCenter::IIfComponent::getPositionY()

Gets the Y position of the component in the Analysis View.

Returns:

The Y position.

Return type: int

Reimplements: getPositionY

Function rename

void ModelCenter::IIfComponent::rename(BSTR name)

Renames the current Component.

Parameters:

  • name: New name of the Component.

Parameters:

  • BSTR name

Return type: void

Reimplements: rename

Function getType

BSTR ModelCenter::IIfComponent::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

void ModelCenter::IIfComponent::show()

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

Return type: void

Reimplements: show

Function getNumBranches

int ModelCenter::IIfComponent::getNumBranches()

Gets the number of branches.

Returns:

The number of branches.

Return type: int

Function getBranchCondition

BSTR ModelCenter::IIfComponent::getBranchCondition(int index)

Gets the branch condition.

Parameters:

  • index: Index of the branch.

Returns:

The branch condition.

Parameters:

  • int index

Return type: BSTR

Function setBranchCondition

void ModelCenter::IIfComponent::setBranchCondition(int index, BSTR condition)

Sets the branch condition.

Parameters:

  • index: Index of the branch.
  • condition: The new condition.

Parameters:

  • int index
  • BSTR condition

Return type: void

Function getBranchName

BSTR ModelCenter::IIfComponent::getBranchName(int index)

Returns the name of the branch.

Parameters:

  • index: Index of the branch.

Returns:

The name of the branch.

Parameters:

  • int index

Return type: BSTR

Function renameBranch

void ModelCenter::IIfComponent::renameBranch(int index, BSTR name)

Renames the branch to the given name.

Parameters:

  • index: Index of the branch.
  • name: New name of the branch.

Parameters:

  • int index
  • BSTR name

Return type: void

Connect with Ansys