Skip to main content

ModelCenter APIs 2026 R1 SP03

Interface ModelCenter::IDataCollector

Last update: 30.07.2026

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

COM Instance.

Members

Properties

Property isVisible

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

BOOL ModelCenter::IDataCollector::isVisible

Determine if the data collector is visible

Return type: BOOL

Public functions

Function storeCurrentDesignPoint

void ModelCenter::IDataCollector::storeCurrentDesignPoint()

Stores the current Model values into the Data Collector as a run.

Return type: void

Function enableGraphTab

void ModelCenter::IDataCollector::enableGraphTab(BOOL flag)

Enables or disables the graph tab.

Parameters:

  • flag: Enable(TRUE) or Disable(FALSE).

Parameters:

  • BOOL flag

Return type: void

Function show

void ModelCenter::IDataCollector::show()

Displays the Data Collector GUI.

Return type: void

Function addCustom

void ModelCenter::IDataCollector::addCustom(BSTR variable, BSTR label)

Adds a custom variable to the Data Collector.

Parameters:

  • variable: Name of the custom variable.
  • label: Label of the custom variable.

Parameters:

  • BSTR variable
  • BSTR label

Return type: void

Function selectX

void ModelCenter::IDataCollector::selectX(BSTR name)

Selects the x-axis variable for the Data Collector graph.

Parameters:

  • name: Full ModelCenter path of the variable.

Parameters:

  • BSTR name

Return type: void

Function selectY

void ModelCenter::IDataCollector::selectY(BSTR name)

Selects a y-axis variable for the Data Collector graph. More than one y-axis variable can be selected.

Parameters:

  • name: Full ModelCenter path of the variable.

Parameters:

  • BSTR name

Return type: void

Function setNumExpectedRuns

void ModelCenter::IDataCollector::setNumExpectedRuns(long numRuns)

Sets the range of the Data Collector progress meter.

Parameters:

  • numRuns: Number of expected runs.

Parameters:

  • long numRuns

Return type: void

Function startRuns

void ModelCenter::IDataCollector::startRuns()

Informs the Data Collector that data is about to be collected.

Return type: void

Function endRuns

void ModelCenter::IDataCollector::endRuns()

Informs the Data Collector that data collection is complete.

Return type: void

Function getNumFailedRuns

long ModelCenter::IDataCollector::getNumFailedRuns()

Finds out how many runs failed in the Data Collector.

Returns:

The number of failed runs.

Return type: long

Function getErrorID

int ModelCenter::IDataCollector::getErrorID(long run)

Gets the error ID for the specified run. If the ID is 0, then the run succeeded.

Parameters:

  • run: Index of the run you want the error ID for (0-based index).

Returns:

The error ID.

Parameters:

  • long run

Return type: int

Function getErrorMessage

BSTR ModelCenter::IDataCollector::getErrorMessage(long run)

Gets the error message for a specified run.

Parameters:

  • run: Index of the run you want the error ID for (0-based index).

Returns:

The error message.

Parameters:

  • long run

Return type: BSTR

Function getNumRuns

long ModelCenter::IDataCollector::getNumRuns()

Finds out how many runs are in the Data Collector.

Returns:

The number of runs.

Return type: long

Function getNumVariables

long ModelCenter::IDataCollector::getNumVariables()

Finds out how many variables are in the Data Collector.

Returns:

The number of variables.

Return type: long

Function getValue

VARIANT ModelCenter::IDataCollector::getValue(VARIANT index, long run)

Gets the value for a variable/run combination.

Parameters:

  • index: Index of the variable location (0-based index).
  • run: Index of the run (0-based index).

Returns:

The value.

Parameters:

  • VARIANT index
  • long run

Return type: VARIANT

Function getVariableDescription

IDispatch * ModelCenter::IDataCollector::getVariableDescription(VARIANT index)

Gets the description of a variable.

Parameters:

  • index: Index of the variable location (0-based index).

Returns:

An IDispatch* to the description of the variable.

Parameters:

  • VARIANT index

Return type: IDispatch *

Function isValid

BOOL ModelCenter::IDataCollector::isValid(VARIANT index, long run)

Finds out whether or not a variable/run combination is valid.

Parameters:

  • index: Index of the variable location (0-based index).
  • run: Index of the run (0-based index).

Returns:

yes(TRUE) or no(FALSE).

Parameters:

  • VARIANT index
  • long run

Return type: BOOL

Function save

void ModelCenter::IDataCollector::save(BSTR fileName, BSTR displayName, BSTR description, BSTR author, BOOL saveModel)

Saves the data to a .pxt(ModelCenter Trade Study) file.

Parameters:

  • fileName: Path of the .pxt file to be saved.
  • displayName: Display name of the Trade Study.
  • description: Description of the Trade Study.
  • author: Author of the Trade Study.
  • saveModel: Whether or not to save the Model as part of the Trade Study.

Parameters:

  • BSTR fileName
  • BSTR displayName
  • BSTR description
  • BSTR author
  • BOOL saveModel

Return type: void

Function exportToCSV

void ModelCenter::IDataCollector::exportToCSV(BSTR fileName)

Saves the Data Collector data as a comma separated list of values.

Parameters:

  • fileName: Path of the .csv file to write.

Parameters:

  • BSTR fileName

Return type: void

Function toString

BSTR ModelCenter::IDataCollector::toString()

Converts the Data Collector setup and data to a string.

Returns:

Converted value of the Data Collector as a string.

Return type: BSTR

Function fromString

void ModelCenter::IDataCollector::fromString(BSTR str)

Restores the Data Collector data and setup from a string.

Parameters:

  • str: String containing the Data Collector setup.

Parameters:

  • BSTR str

Return type: void

Function getDataExplorer

IDispatch * ModelCenter::IDataCollector::getDataExplorer()

Returns the ModelCenter 6.0 API style object for the Data Collector (termed the Data Explorer).

Returns:

An IDispatch* to a IDataExplorer object.

Return type: IDispatch *

Function hide

void ModelCenter::IDataCollector::hide()

Hides the Data Collector.

Return type: void

Private functions

Function enableCarpetPlotTab

void ModelCenter::IDataCollector::enableCarpetPlotTab(BSTR var1, BSTR var2, BSTR plotVar)

Parameters:

  • BSTR var1
  • BSTR var2
  • BSTR plotVar

Return type: void

Function storeCustomDesignPoint

void ModelCenter::IDataCollector::storeCustomDesignPoint(IDispatch *customDesignPoint)

Parameters:

  • IDispatch * customDesignPoint

Return type: void

Function createEmptyRuns

void ModelCenter::IDataCollector::createEmptyRuns(long numEmptyRuns)

Parameters:

  • long numEmptyRuns

Return type: void

Function setCustomRun

void ModelCenter::IDataCollector::setCustomRun(long index, IDispatch *customDesignPoint)

Parameters:

  • long index
  • IDispatch * customDesignPoint

Return type: void

Function newCustomDesignPoint

IDispatch * ModelCenter::IDataCollector::newCustomDesignPoint()

Return type: IDispatch *

Function enableMainEffectsTab

void ModelCenter::IDataCollector::enableMainEffectsTab()

Return type: void

Connect with Ansys