Skip to main content

ModelCenter APIs 2025 R2

IfComponent

Last update: 16.07.2025

public class IfComponent : Component

This is the wrapper class that handles the native COM calls to an IfComponent object.

Author

jdaley, 4-09

Properties

Name Summary
COMPONENT_TYPE_ASSEMBLY val COMPONENT_TYPE_ASSEMBLY: String = "Assembly"
COMPONENT_TYPE_COMPONENT val COMPONENT_TYPE_COMPONENT: String = "Component"
COMPONENT_TYPE_EMPTY val COMPONENT_TYPE_EMPTY: String = "Empty"
COMPONENT_TYPE_FOR_EACH val COMPONENT_TYPE_FOR_EACH: String = "ForEach"
COMPONENT_TYPE_IF val COMPONENT_TYPE_IF: String = "If"
COMPONENT_TYPE_LOOP val COMPONENT_TYPE_LOOP: String = "Loop"
COMPONENT_TYPE_PARALLEL val COMPONENT_TYPE_PARALLEL: String = "Parallel"
COMPONENT_TYPE_SCRIPTCOMPONENT val COMPONENT_TYPE_SCRIPTCOMPONENT: String = "ScriptComponent"
COMPONENT_TYPE_SEQUENCE val COMPONENT_TYPE_SEQUENCE: String = "Sequence"

Functions

Name Summary
disableGC public disableGC(gc: Boolean)
If true, prevents releaseObjects from doing anything.
downloadValues public downloadValues()
downloads the component's variable values from Analysis Server, if it's an Analysis Server component
getAssociatedFiles public getAssociatedFiles(): Array<Any>
gets the associated files of the component
getBranchCondition public getBranchCondition(index: Int): String
gets the branch condition
getBranchName public getBranchName(index: Int): String
returns the name of the branch
getExclusive public getExclusive(): Boolean
returns the if exclusive mode
getFullName public getFullName(): String
gets the full name of the current object, e.g.
getGroup public getGroup(index: Int): Group
public getGroup(name: String): Group
gets the specified group
getIndexInParent public getIndexInParent(): Int
Gets the index of the component in its parent assembly.
getMetadata public getMetadata(name: String): Variant
Get a metadata value.
getName public getName(): String
gets the name of the current object, e.g.
getNumBranches public getNumBranches(): Int
gets the number of branches
getNumGroups public getNumGroups(): Int
get the number of groups stored in this object
getNumVariables public getNumVariables(): Int
get the number of variables stored in this object
getParentAssembly public getParentAssembly(): Assembly
gets the parent assembly of this component (fails if this is the model/root assembly)
getPositionX public getPositionX(): Int
gets the X co-ordinate value of the current object,
getPositionY public getPositionY(): Int
gets the Y co-ordinate value of the current object,
getRunLastBranchByDefault public getRunLastBranchByDefault(): Boolean
returns the run last branch by default flag
getSource public getSource(): String
gets the server path for the component, e.g.
getType public getType(): String
gets the type of the component: COMPONENT_TYPE_COMPONENT = "Component" COMPONENT_TYPE_SCRIPTCOMPONENT = "ScriptComponent" COMPONENT_TYPE_ASSEMBLY = "Assembly" COMPONENT_TYPE_SEQUENCE = "Sequence" COMPONENT_TYPE_IF = "If" COMPONENT_TYPE_PARALLEL = "Parallel" COMPONENT_TYPE_EMPTY = "Empty" COMPONENT_TYPE_FOR_EACH = "ForEach"
getUserData public getUserData(): Any
Get user data of the component.
getVariable public getVariable(index: Int): Variable
gets the specified variable
public getVariable(name: String): Variable
gets the specified variable.
invalidate public invalidate()
causes the component to be invalidated
invokeMethod public invokeMethod(method: String)
invokes a method of the Component
reconnect public reconnect()
reconnects the component
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.
rename public rename(name: String)
Rename the component
renameBranch public renameBranch(index: Int, name: String)
renames the branch to the given name
run public run()
causes the component to run
setAssociatedFiles public setAssociatedFiles(val: Array<Any>)
sets the associated files of the component
setBranchCondition public setBranchCondition(index: Int, condition: String)
sets the branch condition
setExclusive public setExclusive(flag: Boolean)
sets the if exclusive mode
setMetadata public setMetadata(name: String, type: Variable.MetadataType, value: Any, access: Variable.MetadataAccess, archive: Boolean)
Set a metadata value on a component
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.
setRunLastBranchByDefault public setRunLastBranchByDefault(flag: Boolean)
sets the run last branch by default flag
setUserData public setUserData(val: Any)
Set user data of the Component
show public show()
Show the GUI form associated with the component, if any.

Connect with Ansys