Skip to main content

ModelCenter APIs 2025 R2

DataHistory

Last update: 16.07.2025

public class DataHistory : PHXCOMObject

This is the wrapper class that handles the native COM calls to a Data History. The class is used by Java plug-ins to ModelCenter.

Constructors

DataHistory constructor(pstrm: Long)
Connects this Java object to the specified session of ModelCenter
constructor(pstrm: Long, addRef: Boolean)
Internal use only

Functions

Name Summary
addVariable public addVariable(var: DHVariable)
adds variable var to DataHistory
addVariableStructs public addVariableStructs(dhVarStructs: Array<DataHistoryVariableStruct>, run: Long)
Sets the results for a run.
createVariable public createVariable(): DHVariable
creates a variable
deleteRun public deleteRun(run: Long)
deletes a run
deleteVariable public deleteVariable(index: Int)
public deleteVariable(index: String)
deletes a variable at the given index
disableGC public disableGC(gc: Boolean)
If true, prevents releaseObjects from doing anything.
endRuns public endRuns()
ends the runs
fromXML public fromXML(xmlStr: String, root: String)
from XML
fromXMLFile public fromXMLFile(fileName: String, root: String)
from XML file
getCenterLinkJobConnector public getCenterLinkJobConnector(): String
CenterLink is not supported by this version of ModelCenter.
getCenterLinkQueue public getCenterLinkQueue(): String
CenterLink is not supported by this version of ModelCenter.
getCenterLinkRunMatrixID public getCenterLinkRunMatrixID(): String
CenterLink is not supported by this version of ModelCenter.
getCenterLinkServer public getCenterLinkServer(): String
CenterLink is not supported by this version of ModelCenter.
getCompletedRunData public getCompletedRunData(startSequenceNumber: Int, maxLength: Int, allVariables: Boolean): CompletedRunData
Gets information about the completed run data, including the runIDs, error IDs, error messages, and variable values.
getDataExplorer public getDataExplorer(): DataExplorer
gets the DataExplorer --was IDispatch in COM
getDataHistoryToModel public getDataHistoryToModel(): IDataHistoryToModel
Gets the dataHistoryToModel.
getErrorID public getErrorID(run: Long): Long
returns the ID of the Error that occured in the DataHistory
getErrorMessage public getErrorMessage(run: Long): String
returns a string containing the error message for a given run
getFormattedValue public getFormattedValue(index: Int, run: Long): String
public getFormattedValue(index: String, run: Long): String
gets a value at the given index for a given run
getHighlightedRuns public getHighlightedRuns(): Array<Long>
Retrieve the set of currently highlighted run indices
getNumCustomVars public getNumCustomVars(): Long
gets the number of custom variables
getNumDesignVariables public getNumDesignVariables(): Long
gets the number of design variables
getNumExpectedRuns public getNumExpectedRuns(): Long
gets the number of expected runs
getNumFailedRuns public getNumFailedRuns(): Long
gets the number of failed runs
getNumNonEmptyRuns public getNumNonEmptyRuns(): Long
check to see if the menu item is enabled (t/f)
getNumRuns public getNumRuns(): Long
gets the number of runs for the DataHistory
getNumVariables public getNumVariables(): Long
gets the number for variables
getRunName public getRunName(runNum: Long): String
gets the name of the given run in the DataHistory
getSettingRun public getSettingRun(): Boolean
gets the Setting Run
getSuggestedCountFrom public getSuggestedCountFrom(): Long
gets the Suggested Count
getSuggestedDependentVars public getSuggestedDependentVars(): Any
gets the Suggested Dependent Variables()
getSuggestedIndependantVar public getSuggestedIndependantVar(): String
gets the Suggested Independent Variable
getSuggestedIndependentVar public getSuggestedIndependentVar(): String
gets the Suggested Independent Variable
getUniqueID public getUniqueID(): Long
gets the unique ID of the DataHistory
getValue public getValue(index: Int, run: Long): Any
public getValue(index: String, run: Long): Any
gets the value
getVariable public getVariable(index: Int): DHVariable
public getVariable(index: String): DHVariable
gets a variable
getVariableValues public getVariableValues(index: Int): Array<Any>
public getVariableValues(index: String): Array<Any>
gets values of a variable for all runs
highlight public highlight(run: Long, highlight: Boolean, handleEvent: Boolean)
highlight or unhighlight a run
insertRun public insertRun(insertBefore: Long)
inserts a new run before a given index
isHighlighted public isHighlighted(run: Long): Boolean
check highlight state
isModified public isModified(index: Int, run: Long): Boolean
public isModified(index: String, run: Long): Boolean
checks to see if the given object is midified
isRunning public isRunning(): Boolean
looks to see if the DataHistory is running
isValid public isValid(index: Int, run: Long): Boolean
public isValid(index: String, run: Long): Boolean
checks for valididty of an object given an index and run
newInstance public newInstance(): DataHistory
creates a new DataCollector object (that is connected to the same ModelCenter session) that is not currently attached to any thread.
release public release()
Releases the COM reference to ModelCenter for this object.
releaseObjects public releaseObjects()
This function attempts to release any COM resources left behind from objects which have been finalized but release() was never called on them.
setDataHistoryToModel public setDataHistoryToModel(dhtm: IDataHistoryToModel)
Sets the Data History to Model object.
setError public setError(run: Long, errorID: Long, message: String)
sets an error for the given run, ID and message
setFormattedResult public setFormattedResult(index: Int, run: Long, value: String, valid: Boolean, modified: Boolean)
public setFormattedResult(index: String, run: Long, value: String, valid: Boolean, modified: Boolean)
sets a formatted result
setHighlightedRuns public setHighlightedRuns(selectedRunIndices: Array<Long>)
Specify the set of currently highlighted run indices.
setNumExpectedRuns public setNumExpectedRuns(numRuns: Long)
sets the number of expected runs
setReferenceDebugMode public setReferenceDebugMode(on: Boolean)
When set to true, the system will keep a list of active COM objects that are allocated but not yet released since this method was invoked.
setResult public setResult(index: Int, run: Long, value: Any, valid: Boolean, modified: Boolean)
public setResult(index: String, run: Long, value: Any, valid: Boolean, modified: Boolean)
sets the Result
setRunName public setRunName(runNum: Long, name: String)
sets the run name for a given run number
setRunValues public setRunValues(run: Long, values: Array<Any>, valid: Boolean, modified: Boolean)
sets all values of a run as a single chunk.
setSettingRun public setSettingRun(running: Boolean)
sets the Setting Run
setSuggestedCountFrom public setSuggestedCountFrom(count: Long)
sets the Suggested Count
setSuggestedDependentVars public setSuggestedDependentVars(var: Any)
sets the Suggested Dependent Varianble
setSuggestedIndependantVar public setSuggestedIndependantVar(var: String)
sets the Suggested Independent Variable
setSuggestedIndependentVar public setSuggestedIndependentVar(var: String)
sets the Suggested Independent Variable
setVariableValues public setVariableValues(index: Int, run: Long, values: Array<Any>, valid: Boolean, modified: Boolean)
public setVariableValues(index: String, run: Long, values: Array<Any>, valid: Boolean, modified: Boolean)
sets all values of a variable as a chunk
startRuns public startRuns()
starts the runs
toCSV public toCSV(variablesInRows: Boolean, includeFailed: Boolean): String
to CSV
toCSVFile public toCSVFile(fileName: String, variablesInRows: Boolean, includeFailed: Boolean)
to CSV File
toXML public toXML(): String
public toXML(includeRunData: Boolean): String
to XML
toXMLFile public toXMLFile(fileName: String)
public toXMLFile(fileName: String, includeRunData: Boolean)
save data history data as an XML file

Connect with Ansys