Skip to main content

ModelCenter APIs 2025 R2

FileVariable

Last update: 16.07.2025

public class FileVariable : Variable

A variable type class for ModelCenter

Author

Woyak, 10/2001

Functions

Name Summary
dependentLinks public dependentLinks(): VariableLinks
Returns a list of links that immediately depend on the value of this variable.
disableGC public disableGC(gc: Boolean)
If true, prevents releaseObjects from doing anything.
fromFile public fromFile(fileName: String)
reads data from a file (same as readFile()).
fromString public fromString(str: String)
Sets the value for the variable from a string.
getDescription public getDescription(): String
gets the description text for the file
getDirectDependents public getDirectDependents(): Variables
public getDirectDependents(followSuspended: Boolean): Variables
Gets all the immediately linked outputs of this variable.
getDirectPrecedents public getDirectPrecedents(): Variables
public getDirectPrecedents(followSuspended: Boolean): Variables
Gets all the immediately linked inputs of this variable.
getDirectTransfer public getDirectTransfer(): Boolean
Gets the directTransfer flag.
getFileExtension public getFileExtension(): String
gets the extension used for the file (used to associate the file with an application).
getFullName public getFullName(): String
Gets the full name of the variable, e.g.
getHasChanged public getHasChanged(): Boolean
Boolean which indicates if the variable has changed since the last time the boolean was reset.
getHide public getHide(): Boolean
Gets whether the variable is hidden or not
getIsBinary public getIsBinary(): Boolean
gets a flag indicating if the file contents are binary
getMetadata public getMetadata(name: String): Variant
Get a metadata value.
getName public getName(): String
Gets the name of the variable, e.g.
getOwningComponent public getOwningComponent(): Component
Get the component which owns this variable.
getSaveWithModel public getSaveWithModel(): Boolean
Gets a flag indicating that the value of the file should be saved with the model.
getType public getType(): String
Gets the type of the variable.
invalidate public invalidate()
Invalidates the variable
isInput public isInput(): Boolean
Indicates whether the variable is an input or output
isInputToComponent public isInputToComponent(): Boolean
Indicates whether a variable is an input to a component
isInputToModel public isInputToModel(): Boolean
Indicates whether a variable is an input to the Model
isValid public isValid(): Boolean
Indicates whether the variable is currently valid or not
precedentLinks public precedentLinks(): VariableLinks
Returns a list of links that are immediate precedents to the value of this variable.
readFile public readFile(fileName: String)
reads data from a file (same as fromFile()).
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.
setDescription public setDescription(desc: String)
sets the description text for the file
setDirectTransfer public setDirectTransfer(flag: Boolean)
Sets the directTransfer flag.
setFileExtension public setFileExtension(ext: String)
sets the desired file extension for the file
setHasChanged public setHasChanged(flag: Boolean)
Boolean which indicates if the variable has changed since the last time the boolean was reset.
setHide public setHide(flag: Boolean)
Set whether the variable is hidden or not
setIsBinary public setIsBinary(flag: Boolean)
sets a flag indicating that this variable contains binary data
setMetadata public setMetadata(name: String, type: Variable.MetadataType, value: Any, access: Variable.MetadataAccess, archive: Boolean)
Set a metadata value on a variable.
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.
setSaveWithModel public setSaveWithModel(flag: Boolean)
Sets a flag indicating that the value of the file should be saved with the model.
toFile public toFile(fileName: String)
public toFile(fileName: String, encoding: String)
writes out contents to a file (same as writeFile()).
toFileAbsolute public toFileAbsolute(fileName: String)
writes out contents to a file without validating the variable (same as writeFile()).
public toFileAbsolute(fileName: String, encoding: String)
writes out contents to a file without validating the variable.
toString public toString(): String
Converts the variable value to a string representation.
toStringAbsolute public toStringAbsolute(): String
Converts the variable value to a string representation.
validate public validate()
Causes the scheduler to get a valid value for this variable.
writeFile public writeFile(fileName: String)
writes out contents to a file (same as toFile()).
writeFileAbsolute public writeFileAbsolute(fileName: String)
writes out contents to a file without validating the variable (same as toFileAbsolute()).

Connect with Ansys