Skip to main content

ModelCenter APIs 2026 R1 SP03

Interface TradeStudyPlugIn::ITradeStudyPlugIn2

Last update: 30.07.2026

Definition: ModelCenter/src/InterfaceDLL_TradeStudyPlugIn/TradeStudyPlugIn.odl (line 41)

COM Instance.

Inherits from:

Inherited by:

Members

Properties

Property TradeStudyCallback

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

LPDISPATCH TradeStudyPlugIn::ITradeStudyPlugIn2::TradeStudyCallback

Gets or sets the trade study callback object.

Return type: LPDISPATCH

Property saveAllAnalyzerVariables

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

boolean TradeStudyPlugIn::ITradeStudyPlugIn2::saveAllAnalyzerVariables

Gets or sets whether all analyzer variables are saved in the data history when the trade study is run. Only affects variables added using addAnalyzerVariable(), otherwise the global ModelCenter setting is used (as per usual). The default is false.

NOTE: not fully supported in MC 10.2 - you can (and should) set this value as appropriate but setting to true may not have an effect until all of the requisite functionality is added.

Return type: boolean

Public functions

Function construct

void TradeStudyPlugIn::ITradeStudyPlugIn2::construct(IDispatch *modelCenter, IDispatch *addToModel, [defaultvalue(NULL)]IDispatch *dataCollector)

Called when the plug-in is launched from ModelCenter

Parameters:

  • modelCenter: the ModelCenter object
  • addToModel: the AddToModel API object

Parameters:

  • IDispatch * modelCenter
  • IDispatch * addToModel
  • [defaultvalue(NULL)] IDispatch * dataCollector

Return type: void

Reimplements: construct

Function show

boolean TradeStudyPlugIn::ITradeStudyPlugIn2::show()

Called to display the trade study.

Returns:

false always

Return type: boolean

Reimplements: show

Function toString

BSTR TradeStudyPlugIn::ITradeStudyPlugIn2::toString()

Called to save the state of the plug-in.

Returns:

a string containing state information

Return type: BSTR

Reimplements: toString

Function fromString

void TradeStudyPlugIn::ITradeStudyPlugIn2::fromString(BSTR setupString)

Called to restore the state of a plug-in

Parameters:

  • setupString: the state string

Parameters:

  • BSTR setupString

Return type: void

Reimplements: fromString

Function onEnd

void TradeStudyPlugIn::ITradeStudyPlugIn2::onEnd()

Called when the plug-in is about to be deleted. Informs the plug-in to do any necessary clean up.

Return type: void

Function addAnalyzerVariable

void TradeStudyPlugIn::ITradeStudyPlugIn2::addAnalyzerVariable(BSTR formula, [optional]VARIANT analyzerName)

Call to add a variable from an analyzer product. If there are any analyzer variables, the plugin should only accept analyzer variables as trade study parameters.

Parameters:

  • formula: the formula of the variable or expression in the ModelCenter model
  • analyzerName: the name of the variable used by the analyzer product; if not specified, the formula is used instead. The plugin should only display and accept aliases.

Parameters:

  • BSTR formula
  • [optional] VARIANT analyzerName

Return type: void

Function clearAnalyzerVariables

void TradeStudyPlugIn::ITradeStudyPlugIn2::clearAnalyzerVariables()

Remove all analyzer variables.

Return type: void

Connect with Ansys