• No results found

General Output Variable Script Commands

In document scriptingMaxwell_onlinehelp (Page 134-141)

Following are script commands recognized by the oDesign object:

CreateOutputVariable

EditOutputVariable

DeleteOutputVariable

DoesOutputVariableExist

GetOutputVariables

GetOutputVariableValue

CreateOutputVariable

Use: Adds a new output variable to the output variable list. Output variables are associated with a name and an expression. The name of an output variable is not permitted to collide with design variables, Sim values, or other output variable names. It cannot have spaces or any arithmetic or other operators.

The definitions cannot be cyclic. For example, A = 2*B, B=3*A is not allowed.

Command: Maxwell3D>Results>Output Variables, Maxwell2D>Results>Output Variables, or RMxprt>Results>Output Variables.

Syntax: CreateOutputVariable <OutputVarName>, <Expression>,

<SolutionName>, <ReportTypeName>, <simValueContext>

Return Value: None

Parameters: <OutputVarName>

Type: <string>

Name of the output variable.

<Expression>

Type: <value>

Value to assign to the variable.

<SolutionName>

Type: <string>

Name of the solution as listed in the output variable UI.

For example: "Setup1 : Last Adaptive"

<ReportTypeName>

Type: <string>

The name of the report type as seen in the output variable UI.

<simValueContext>

Type: <variant>

Context for which the output variable expression is being evaluated

Example: Set oModule = oDesign.GetModule("OutputVariable") oModule.CreateOutputVariable "magforce",

"mag(Force1.Force_x)", _

"Setup1 : LastAdaptive", "Magnetostatic", Array()

EditOutputVariable

Use: Change the name or expression of an existing output variable.

Syntax: EditOutputVariable <OrigVarName>, <NewExpression>,

<NewVarName>, <SolutionName>, <ReportTypeName>,

<SimValueContext>

Provide empty quotes “” as the NewVarName or NewExpression if it should not be changed.

Return Value: None

Parameters: <OrigVarName>

Type: <string>

Original name of the variable.

<NewExpression>

Type: <value>

New value to assign to the variable.

<NewVarName>

Type: <string>

New name of the variable if any, or else pass an empty string.

<SolutionName>

Type: <string>

Name of the solution as seen in the output variable UI.

For example: "Setup1 : Last Adaptive"

<ReportTypeName>

Type: <string>

The name of the report type as seen in the output variable UI.

<SimValueContext>

Type: <variant>

Context for which the output variable expression is being evaluated.

Example: Set oModule = oDesign.GetModule("OutputVariable") oModule.EditOutputVariable "magforce",

"mag(Force1.Force_z)", _

"magforce", "Setup1 : LastAdaptive", "Magnetostatic",

Array()

DeleteOutputVariable

Use: Delete an existing output variable. The variable can only be deleted if it is not being used by any traces.

Command: Delete button on the Output Variables dialog.

Syntax: DeleteOutputVariable <VarName>

Return Value: None Parameters: <VarName>

Type: <string>

Name of the output variable.

Example: Set oModule = oDesign.GetModule("OutputVariable") oModule.DeleteOutputVariable "magforce"

DoesOutputVariableExist

Use: Determines whether a specified output variable exists.

Syntax: DoesOutputVariableExist <OutputVarName>

Return Value: Boolean

Parameters: <OutputVarName>

Type: <string>

Name of the output variable.

Example: OutputVarmagforceExists =

oDesign.DoesOutputVariableExist(magforce)

GetOutputVariables

Use: Gets a list of output variables.

Syntax: GetOutputVariables

Return Value: An array of output variable names.

Parameters: None

Example: Set oModule = oDesign.GetModule("OutputVariable") ov = oDesign.GetOutputVariables

GetOutputVariableValue

Use: Gets the double value of an output variable. Only those expressions that return a double value are supported. The expression is evaluated only for a single point.

Syntax: GetOutputVariableValue(<OutputVarName>,

<IntrinsicVariation>, <SolutionName>, <ReportTypeName>,

<SimValueContext>)

Return Value: Double value of the output variable.

Parameters: <OutputVarName>

Type: <string>

Original name of the variable

<Variation>

Type: <string>

A set of variable, value pairs to use when evaluating the output expres-sion. If no variables are present, a null string must be used.The Eddy-Current solution type requires at least the specification of frequency as shown here while the transient solver will require Time as a minimum entry.

For example: "" (Null String)

"freq=‘60’" (Eddy current example)

<SolutionName>

Type: <string>

Name of the solution as listed in the output variable dialog box as shown in SimValueContext.

For example: "Setup1 : Last Adaptive"

<ReportTypeName >

Type: <string>

The name of the report type as seen in the output variable dialog box as shown in SimValueContext.

<SimValueContext>

Type: <string>

Context for which the output variable expression is being evaluated.

This section is related to the Parameters or Geometry fields in the UI that specify a context for extracting data quantities. This can be an empty string if there is no context.

The Context section of the Output Variables dialog box contains the information that is required when getting the value of the Output Vari-able. Note these values when using the dialog box to create the Output Note If the Output Variable is based upon a field quantity, then the

ReportTypeName must be set to "Fields".

Variable.

Hint Variation variables can be identified by doing a Data Table report and viewing the variable specifications in the table header. For example:

Also, as shown below, the Trace and Families tabs on the Report dialog box can be used as illustrated to identify variation variables.

Example: Dim Val

Val= oModule.GetOutputVariableValue("tempmag",_

"freq='60' coilcurrent='1000' gapsize='-0.001'",_

"Setup1 : LastAdaptive", "EddyCurrent", "") Val= oModule.GetOutputVariableValue("tempmag",_

"coilcurrent='1000' gapsize='-0.001'",_

"Setup1 : LastAdaptive", "Magnetostatic", "") Val= oModule.GetOutputVariableValue("BFieldMag",_

"", "Setup1 : LastAdaptive", "Fields", "")

Val= oModule.GetOutputVariableValue("MagBatPoint1",_

"freq='60' coilcurrent='1000' gapsize='-0.001' Phase=’0deg’", "Setup1 : LastAdaptive", "Fields", Array("Context:=", "Point1"))

11 3D Modeler Editor Script

In document scriptingMaxwell_onlinehelp (Page 134-141)

Related documents