Skip to main content

ModelCenter APIs 2025 R2

IModelCenter

Last update: 16.07.2025

interface IModelCenter

Interface for ModelCenter class.

Author

rshah

Inheritors

ModelCenter
ModelCenter

Functions

Name Summary
addIcon abstract fun addIcon(iconFile: String): Int
Registers an icon with ModelCenter.
addNewMacro abstract fun addNewMacro(macroName: String, isAppMacro: Boolean)
adds a new Macro to ModelCenter's macro facility
autoLink abstract fun autoLink(srcComp: String, destComp: String)
auto links the variables of two Components
breakLink abstract fun breakLink(variable: String)
Breaks the link of a specified variable
checkout abstract fun checkout(feature: String): Feature
Should check out a license feature from Ansys
checkout2 abstract fun checkout2(feature: String, productRelease: String): Feature
Should check out a license feature from Ansys
closeHTMLViewer abstract fun closeHTMLViewer(hwnd: Long): Boolean
closes the HTMLViewer embedded browser tool
closeModel abstract fun closeModel()
closes the model within ModelCenter
createAndInitComponent abstract fun createAndInitComponent(serverPath: String, name: String, parentName: String, initString: String, xPos: Long, yPos: Long): Component
Creates a new component and initializes it from string data.
createAssembly abstract fun createAssembly(name: String, parent: String): Assembly
abstract fun createAssembly(name: String, parent: String, assemblyType: String): Assembly
creates an assembly
createAssemblyVariable abstract fun createAssemblyVariable(name: String, type: String, parent: String): Variable
creates an assembly variable
createComponent abstract fun createComponent(serverPath: String, name: String, parentName: String)
abstract fun createComponent(serverPath: String, name: String, parentName: String, xPos: Long, yPos: Long)
Instantiates a new component into the Model
createDataCollector abstract fun createDataCollector(tradeStudyType: String, setup: String): DataCollector
creates a Data Collector for storing and displaying data
createDataExplorer abstract fun createDataExplorer(tradeStudyType: String, setup: String): DataExplorer
creates a Data Explorer for storing and displaying data
createDataHistoryVariable abstract fun createDataHistoryVariable(): DHVariable
Creates a new DHVariable instance.
createDataMonitor abstract fun createDataMonitor(component: String, title: String, x: Int, y: Int): DataMonitor
create a data monitor and associate it with a particular component
createJobManager abstract fun createJobManager(): JobManager
creates a JobManager object for performing trade study runs
abstract fun createJobManager(showProgressDialog: Boolean): JobManager
abstract fun createJobManager(progressDialogParent: Long): JobManager
Creates a JobManager for performing trade study runs.
createLink abstract fun createLink(varName: String, equation: String)
Creates a new link
createPlugInFrame abstract fun createPlugInFrame(name: String, title: String, reserved: String, plugin: Long, container: Container): Long
Create a frame window in which to embed the java plug-in
abstract fun createPlugInFrame(name: String, title: String, reserved: String, plugin: Long, container: Container, showFavorites: Boolean): Long
abstract fun createPlugInFrame(name: String, title: String, reserved: String, plugin: Long, container: Container, showFavorites: Boolean, defWidth: Long, defHeight: Long): Long
abstract fun createPlugInFrame(name: String, title: String, reserved: String, plugin: Long, container: Container, showFavorites: Boolean, defWidth: Long, defHeight: Long, minWidth: Long, minHeight: Long): Long
createTradeStudy abstract fun createTradeStudy(idStr: String): TradeStudy
Creates the specified trade study and returns a handle to it.
destroyPlugInFrame abstract fun destroyPlugInFrame(hwnd: Long)
Destroys the frame window which the java plug-in is embedded in
dumpComDebug abstract fun dumpComDebug()
Dumps COM debugging information on the ModelCenter process side; only has an effect if ModelCenter is compiled in Debug mode.
getActiveJobManager abstract fun getActiveJobManager(): JobManager
Gets the Job Manager associated with the currently running trade study.
getAppName abstract fun getAppName(): String
Gets the Application name
getAssembly abstract fun getAssembly(name: String): Assembly
Gets the specified assembly from the model.
getAssemblyStyle abstract fun getAssemblyStyle(assemblyName: String): ModelCenter.AssemblyStyleInfo
Get the visual style of an assembly.
getComponent abstract fun getComponent(name: String): Component
Gets the specified component from the Model
getDataCollector abstract fun getDataCollector(index: Long): DataCollector
getDataCollectorForDataExplorer abstract fun getDataCollectorForDataExplorer(dataExplorer: DataExplorer): DataCollector
Retrieves a DataCollector for the DataExplorer with the specified ID.
getDataExplorer abstract fun getDataExplorer(id: Variant): DataExplorer
gets a specific DataExplorer
getDataMonitor abstract fun getDataMonitor(component: String, index: Variant): DataMonitor
gets a specific data monitor associated with a particular component
getFileSystemInfo abstract fun getFileSystemInfo(uri: String): FileSystemInfo
Gets the FileSystemInfo for a given URI.
getFormatter abstract fun getFormatter(format: String): Format
Gets an instance of a formatter object
getFrame abstract fun getFrame(): JFrame
gets a Frame that should be used as the parent for all windows displayed by Java plug-ins.
getGlobalParameters abstract fun getGlobalParameters(): GlobalParameters
Gets the list of global parameters
getHaltStatus abstract fun getHaltStatus(): Boolean
checks to see if the halt button has been pressed
getIsInteractive abstract fun getIsInteractive(): Boolean
Determine if the current ModelCenter is running interactively - that is, if it has a GUI and a main window.
getLastErrorMessage abstract fun getLastErrorMessage(): String
retrieves the text associated with the last ModelCenter error
getLicensingPath abstract fun getLicensingPath(): String
Gets the ModelCenter licensing path returns ModelCenter licensing path
getLinks abstract fun getLinks(includeReferences: Boolean): VariableLinks
Retreive a list of all links in a model
getLogger abstract fun getLogger(): Logger
Retrieves a logger.
getMacroScript abstract fun getMacroScript(macroName: String): String
get the script for a macro if the macro exists
getMacroScriptLanguage abstract fun getMacroScriptLanguage(macroName: String): String
get the script lancuage for a macro if the macro exists
getModel abstract fun getModel(): Assembly
Gets the Model object
getModelCenterPath abstract fun getModelCenterPath(): String
Retrieves the install path for ModelCenter.
getModelDirectory abstract fun getModelDirectory(): String
Gets the Model directory returns an exception when Model is not open returns an empty string when Model has not been saved
getModelFileName abstract fun getModelFileName(): String
Gets the Model file name
getPreference abstract fun getPreference(prefName: String): Variant
gets a preference
getProcessID abstract fun getProcessID(): Long
Retrieves the process identifier (PID) of the ModelCenter process.
getRunOnlyMode abstract fun getRunOnlyMode(): Boolean
Gets the status of ModelCenter being in Run-Only Mode.
getScreenUpdating abstract fun getScreenUpdating(): Boolean
returns the current screen updating flag
getTradeStudyFilters abstract fun getTradeStudyFilters(): Array<String>
Get the filters for saving Trade Study files (for use in showFileBrowseDialog and showFileSaveDialog)
getValue abstract fun getValue(name: String): Variant
gets a value for the specified variable
getValueAbsolute abstract fun getValueAbsolute(name: String): Variant
gets a value for the specified variable without validating it
getVariable abstract fun getVariable(name: String): Variable
Gets the specified variable from the Model
getVariableMetaData abstract fun getVariableMetaData(name: String): DHVariable
Get metadata about the specified variable from the Model.
getVersion abstract fun getVersion(index: Int): Int
Gets the ModelCenter version
guiCloseAllMultiplexers abstract fun guiCloseAllMultiplexers(): Boolean
Attempts to close the DataExplorers of all vizualization multiplexers.
guiLoadFile abstract fun guiLoadFile(modelFile: String): Boolean
Loads a file in "GUI" mode, that is, unlike loadFile(...), will produce a prompt to the user to verify whether or not any currently opened model should be saved prior to loading the given file.
guiSaveModel abstract fun guiSaveModel()
Saves a file in "GUI" mode, which will pop up a dialog if the file has not yet been saved.
halt abstract fun halt()
Halts any running trade studies
hidePlugInFrame abstract fun hidePlugInFrame(hwnd: Long)
Hides the frame window which the java plugin is embedded in
HTMLViewerWaitForClose abstract fun HTMLViewerWaitForClose(hwnd: Long)
waits for the HTMLViewer embedded browser tool to close
internalLicensing abstract fun internalLicensing(one: String, two: Long)
For internal use only
invokeHelp abstract fun invokeHelp(helpID: Int)
Display a topic in ModelCenter's help system
isOkToClose abstract fun isOkToClose(): Boolean
Determine whether it's ok to shutdown ModelCenter or whether there are still windows open
launchDataCollectorPlugIn abstract fun launchDataCollectorPlugIn(plugInName: String, dataExplorer: DataExplorer)
Launches a specific Data Collector PlugIn, by name, on the specified Data Explorer.
launchHTMLViewer abstract fun launchHTMLViewer(url: String, popup: Boolean): Long
starts the HTMLViewer embedded browser tool
launchMacroEditor abstract fun launchMacroEditor(macroName: String)
launches the macro editor, displays the macro scrip if it exists
launchTradeStudy abstract fun launchTradeStudy(idStr: String)
Launches the specified trade study.
loadFile abstract fun loadFile(modelFile: String)
abstract fun loadFile(modelFile: String, connectErrorMode: Int)
opens the specified Model
loadModel abstract fun loadModel(modelFile: String)
abstract fun loadModel(modelFile: String, connectErrorMode: Int)
opens the specified Model
MessageBox abstract fun MessageBox(msg: String)
displays a Windows Message Box
moveComponent abstract fun moveComponent(component: String, parent: String, index: Int)
Moves a component.
newInstance abstract fun newInstance(): IModelCenter
creates a new ModelCenter object (that is connected to the same ModelCenter session) that is not currently attached to any thread.
newModel abstract fun newModel()
loads ModelCenter with a new, empty Model (data dependency model - MODEL_TYPE_DATA)
abstract fun newModel(modelType: String)
loads ModelCenter with a new, empty Model
parallelInstance abstract fun parallelInstance(): ModelCenter
For internal use only
release abstract fun release()
Releases the COM reference to ModelCenter for this object.
removeComponent abstract fun removeComponent(component: String)
Removes a specified component
removeDataMonitor abstract fun removeDataMonitor(component: String, index: Variant): Boolean
remove a specific data monitor associated with a particular component
run abstract fun run(variableArray: String)
A comma-separated list of ModelCenter variables to validate.
runAntFile abstract fun runAntFile(fileName: String)
runs an ANT testing file
runMacro abstract fun runMacro(macroName: String): Variant
runs a macro
runMacro2 abstract fun runMacro2(macroName: String): Variant
runs a macro and passes the current modelCenter object to the script (i.e.
saveModel abstract fun saveModel()
saves the current Model with it's existing file name
saveModelAs abstract fun saveModelAs(fileName: String)
saves the current Model with the specified file name
saveTradeStudy abstract fun saveTradeStudy(uri: String, fileType: Int, dataExplorer: DataExplorer)
Save the trade study inside of the Data Explorer
saveVersionedModel abstract fun saveVersionedModel(versionStatus: ModelCenter.VersionStatus, checkinMessage: String)
saves the current Model with it's existing file name
saveVersionedModelAs abstract fun saveVersionedModelAs(fileName: String, versionStatus: ModelCenter.VersionStatus, checkinMessage: String)
saves the current Model with the specified file name
setAssemblyStyle abstract fun setAssemblyStyle(assemblyName: String, style: ModelCenter.AssemblyStyle)
Set the visual style of an assembly.
abstract fun setAssemblyStyle(assemblyName: String, style: ModelCenter.AssemblyStyle, width: Int, height: Int)
Set the visual style of an assembly including (optionally) width and height.
setIconPlugInFrame abstract fun setIconPlugInFrame(hwnd: Long, iconFile: String)
Sets the icon for the frame window which the java plugin is embedded in
setLoginCallback abstract fun setLoginCallback(callback: ILoginCallback)
Set the login callback to use
setMacroScript abstract fun setMacroScript(macroName: String, script: String)
set the script for a macro if the macro exists
setMacroScriptLanguage abstract fun setMacroScriptLanguage(macroName: String, language: String)
set the script lancuage for a macro if the macro exists
setPassword abstract fun setPassword(password: String)
Sets the global default password combination in ModelCenter
setPreference abstract fun setPreference(prefName: String, value: String)
Sets a preference
setRunOnlyMode abstract fun setRunOnlyMode(shouldBeInRunOnly: Boolean)
Sets the status of ModelCenter being in Run-Only Mode to the specified value.
setScheduler abstract fun setScheduler(scheduler: String)
Sets the appropriate schdeuler.
setScreenUpdating abstract fun setScreenUpdating(flag: Boolean)
sets a flag indicating if the ModelCenter window should update due to Model changes.
setUserName abstract fun setUserName(username: String)
Sets the global default username combination in ModelCenter
setValue abstract fun setValue(varName: String, value: String)
sets the value for the specified variable
showFileBrowseDialog abstract fun showFileBrowseDialog(title: String, filters: Array<String>, initialUri: String): String
abstract fun showFileBrowseDialog(title: String, filters: Array<String>, initialUri: String, hwnd: Long): String
Displays file selection dialog for loading and returns URL of selected file.
showFileSaveDialog abstract fun showFileSaveDialog(title: String, selectedFilter: ValueHolder<Integer>, initialFileName: String, filters: Array<String>, initialUri: String, hwnd: Long): String
Displays file selection dialog for saving and returns URL of selected file.
showPlugInFrame abstract fun showPlugInFrame(hwnd: Long)
Shows the frame window which the java plugin is embedded in
startGUIMode abstract fun startGUIMode(showDialogs: Boolean)
THIS FUNCTION IS A BETA CAPABILITY Normally when invoked via COM, ModelCenter is in "server" mode and it hides all GUI and dialogs.
tradeStudyEnd abstract fun tradeStudyEnd()
lets ModelCenter know that a trade study is ending
tradeStudyStart abstract fun tradeStudyStart()
lets ModelCenter know that a trade study is beginning

Connect with Ansys