Skip to main content
Definition: ModelCenter/src/ModelCenter.odl (line 121) COM Instance. Examples: Adding to the Model: This example is of adding a Trade Study or Data Collector Plug-In to the Model as a Component.
Adding an input: A sample Component Plug-In has input x and output y. Add another input x2.
Removing an output: A sample Component Plug-In has input x and outputs y, y2. Remove the y2 variable.

Members

Properties

Property prevalidateInputs

Definition: ModelCenter/src/ModelCenter.odl (line 1)
Whether or not pre-validate inputs before running is turned on for the Component. Returns: yes(TRUE) or no(FALSE). Example demonstrating how to set the prevalidateInputs property of the Component:
Return type: boolean

Property autoRun

Definition: ModelCenter/src/ModelCenter.odl (line 1)
Whether or not auto-run if inputs change is turned on for the Component. Returns: yes(TRUE) or no(FALSE). Example demonstrating how to set the autoRun property:
Return type: boolean

Public functions

Function addToModel

Adds a Trade Study or Data Collector Plug-In to the Model as a Component Plug-In. This method is not allowed to be called in the run() method. Return type: void

Function updateComponent

Reinitializes the inputs and outputs of a Component Plug-In. The addInput() and addOutput() methods must be called for each input and output for the new configuration before calling updateComponent(). This method is not allowed to be called in the run() method. Return type: void

Function getComponent

Gets a pointer to the IAddToModel object’s IComponent object. Returns: IDispatch* to an IComponent object. Return type: IDispatch *

Function getRegID

Gets the Plug-In Registry ID that is required for the createDataCollector method in the IModelCenter object. ModelCenter must must know the Registry ID of the Plug-In so Trade Study Files can be saved/restored if the user chooses to do so. Example demonstrating how to query the IAddToModel object for the Registry ID:
Returns: Registry ID of the Plug-In. Return type: BSTR

Function addInput

Adds a pending input variable to the IAddToModel object IO structure. The IAddToModel object’s input variables are updated when the addToModel() or updateComponent() methods are called. Parameters:
  • name: The name of the pending variable.
  • type: The type of the variable. Add ”[]” to the end of the type to indicate an array.
    Valid types include:
  • “double” - double
  • “int” - integer
  • “string” - string
  • “bool” - boolean
  • “ref” - reference
  • “file” - A binary or ascii file
  • “object” - object variable (The default class type “PHXNonStrictType” will be used)
  • “quad” - Quad Facet Geometry, a geometry type composed of multiple quadrilaterals.
  • “sor” - Surface of Revolution, a geometry type defined by a profile curve rotated about an axis.
  • “nurbs” - A geometry type for NURBS.
  • “bspline” - A geometry type for B-Spline curves.
  • “ruled” - A geometry type for ruled surfaces.
  • “skinned” - A geometry type for skinned surfaces.
  • “node” - A geometry type for displaying multiple points in space.
  • value: Value of the variable. If the variable is an array, then each variable value should be separated by a semi-colon:
    addInput( “myVar”, “double[]”, “0;1;2.3;4.56” )
Returns: IDispatch* to an IVariable object Parameters:
  • BSTR name
  • BSTR type
  • [optional] VARIANT value
Return type: IDispatch *

Function addOutput

Adds a pending output variable to the IAddToModel object IO structure. The IAddToModel object’s output variables are updated when the addToModel() or updateComponent() methods are called. Parameters:
  • name: The name of the pending variable.
  • type: The type of the variable. Add ”[]” to the end of the type to indicate an array.
    Valid types include:
  • “double” - double
  • “int” - integer
  • “string” - string
  • “bool” - boolean
  • “ref” - reference
  • “file” - A binary or ascii file
  • “object” - object variable (The default class type “PHXNonStrictType” will be used)
  • “quad” - Quad Facet Geometry, a geometry type composed of multiple quadrilaterals.
  • “sor” - Surface of Revolution, a geometry type defined by a profile curve rotated about an axis.
  • “nurbs” - A geometry type for NURBS.
  • “bspline” - A geometry type for B-Spline curves.
  • “ruled” - A geometry type for ruled surfaces.
  • “skinned” - A geometry type for skinned surfaces.
  • “node” - A geometry type for displaying multiple points in space.
  • value: Value of the variable. If the variable is an array, then each variable value should be separated by a semi-colon:
    addInput( “myVar”, “double[]”, “0;1;2.3;4.56” )
Returns: IDispatch* to an IVariable object Parameters:
  • BSTR name
  • BSTR type
  • [optional] VARIANT value
Return type: IDispatch *

Function getProgID

Gets the ProgID for COM Plug-Ins. The ProgID is the the string used to create an instance of a COM object (ex. “Phoenix.myPlugIn”). Example demonstrating how to get the ProgID of a Plug-In:
Returns: ProgID of the COM Plug-In. Return type: BSTR

Function setAuthor

Defines the author of this Plug-In. Use this method to set the Component metadata when you add a Trade Study or Data Collector Plug-In to the Model. Parameters:
  • author: The author of this Plug-In.
Parameters:
  • BSTR author
Return type: void

Function setDescription

Defines the description of this Plug-In. Use this method to set the Component metadata when you add a Trade Study or Data Collector Plug-In to the Model. Parameters:
  • description: The description for this Plug-In.
Parameters:
  • BSTR description
Return type: void

Function setVersion

Defines the version of this Plug-In. Use this method to set the Component metadata when you add a Trade Study or Data Collector Plug-In to the Model. Parameters:
  • version: The version information for this Plug-In.
Parameters:
  • BSTR version
Return type: void

Function setHelpURL

Defines the help URL of this Plug-In. Use this method to set the Component metadata when you add a Trade Study or Data Collector Plug-In to the Model. Parameters:
  • helpURL: The help URL for this Plug-In.
Parameters:
  • BSTR helpURL
Return type: void

Function setKeywords

Defines the keywords for this Plug-In. Use this method to set the Component metadata when you add a Trade Study or Data Collector Plug-In to the Model. Parameters:
  • keywords: The keywords for this Plug-In.
Parameters:
  • BSTR keywords
Return type: void

Function clearBusyFlag

Clears the busy state of ModelCenter. Return type: void

Function addToModel2

Adds a Trade Study or Data Collector Plug-In to the Model as a Component Plug-In. This method is not allowed to be called in the run() method. Returns: Whether or not the operation completed successfully. Return type: boolean

Function setComponentRequirements

Defines the requirements for this Plug-In. Use this method to set the Component metadata when you add a Trade Study or Data Collector Plug-In to the Model. Parameters:
  • compReq: A comma separated list of requirement specifiers for this Plug-In.
Parameters:
  • BSTR compReq
Return type: void

Function setIcon

Sets the Plug-In icon. Parameters:
  • iconFile: The file path to the icon file.
Parameters:
  • BSTR iconFile
Return type: void

Function addMethod

Adds the method. Parameters:
  • name: The name of the method.
  • displayName: The display name of the method.
Parameters:
  • BSTR name
  • [optional] VARIANT displayName
Return type: void

Function addInput2

Adds a pending input variable to the IAddToModel object IO structure. The IAddToModel object’s input variables are updated when the addToModel() or updateComponent() methods are called. This method can be used to add an “object” variable with a specified class type. Parameters:
  • name: The name of the pending variable.
  • type: The type of the variable. Add ”[]” to the end of the type to indicate an array.
    Valid types include:
  • “double” - double
  • “int” - integer
  • “string” - string
  • “bool” - boolean
  • “ref” - reference
  • “file” - A binary or ascii file
  • “object” - object variable (The default class type “PHXNonStrictType” will be used if classURL is empty)
  • “quad” - Quad Facet Geometry, a geometry type composed of multiple quadrilaterals.
  • “sor” - Surface of Revolution, a geometry type defined by a profile curve rotated about an axis.
  • “nurbs” - A geometry type for NURBS.
  • “bspline” - A geometry type for B-Spline curves.
  • “ruled” - A geometry type for ruled surfaces.
  • “skinned” - A geometry type for skinned surfaces.
  • “node” - A geometry type for displaying multiple points in space.
  • classURL: Class of the object variable. If an empty string is passed, PHXNonStrictType will be used.
  • value: Value of the variable. If the variable is an array, then each variable value should be separated by a semi-colon:
    addInput( “myVar”, “double[]”, “0;1;2.3;4.56” )
Returns: IDispatch* to an IVariable object Parameters:
  • BSTR name
  • BSTR type
  • BSTR classURL
  • [optional] VARIANT value
Return type: IDispatch *

Function addOutput2

Adds a pending output variable to the IAddToModel object IO structure. The IAddToModel object’s output variables are updated when the addToModel() or updateComponent() methods are called. Parameters:
  • name: The name of the pending variable.
  • type: The type of the variable. Add ”[]” to the end of the type to indicate an array.
    Valid types include:
  • “double” - double
  • “int” - integer
  • “string” - string
  • “bool” - boolean
  • “ref” - reference
  • “file” - A binary or ascii file
  • “object” - object variable (The default class type “PHXNonStrictType” will be used)
  • “quad” - Quad Facet Geometry, a geometry type composed of multiple quadrilaterals.
  • “sor” - Surface of Revolution, a geometry type defined by a profile curve rotated about an axis.
  • “nurbs” - A geometry type for NURBS.
  • “bspline” - A geometry type for B-Spline curves.
  • “ruled” - A geometry type for ruled surfaces.
  • “skinned” - A geometry type for skinned surfaces.
  • “node” - A geometry type for displaying multiple points in space.
  • classURL: Class of the object variable. If an empty string is passed, PHXNonStrictType will be used.
  • value: Value of the variable. If the variable is an array, then each variable value should be separated by a semi-colon:
    addInput( “myVar”, “double[]”, “0;1;2.3;4.56” )
Returns: IDispatch* to an IVariable object Parameters:
  • BSTR name
  • BSTR type
  • BSTR classURL
  • [optional] VARIANT value
Return type: IDispatch *

Function addToModel3

Adds a Trade Study or Data Collector Plug-In to the Model as a Component Plug-In. This method is not allowed to be called in the run() method. Parameters:
  • suggestedName: Desired name for the component. This name will be used unless a component of that name already exists, in which case the variable name will be the desired name plus a number tagged on to the end.
Returns: Whether or not the operation completed successfully. Parameters:
  • BSTR suggestedName
Return type: BSTR