Scriptingmaxwell Onlinehelp
Scriptingmaxwell Onlinehelp
ANSYS, Inc. 275 Technology Drive Canonsburg, PA 15317 USA Tel: (+1) 724-746-3304 Fax: (+1) 724-514-9494 General Information: [email protected] Technical Support: [email protected]
November 2011
The information contained in this document is subject to change without notice. ANSYS, Inc. makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. ANSYS, Inc. shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material. ANSYS, Inc, is a UL registered ISO 9001:2008 company. Unauthorized use, distribution, or duplication is prohibited. 2011 SAS IP, Inc. All rights reserved. Ansoft, Simplorer, Optimetrics, Maxwell, and RMxprt are registered trademarks or trademarks of SAS IP, Inc. All other trademarks are the property of their respective owners.
Printing History
New editions of this manual incorporate all material updated since the previous edition. The manual printing date, which indicates the manuals current edition, changes when a new edition is printed. Minor corrections and updates that are incorporated at reprint do not cause the date to change. Update packages may be issued between editions and contain additional and/or replacement pages to be merged into the manual by the user. Pages that are rearranged due to changes on a previous page are not considered to be revised. Edition 1 2 3 4 5 6 D a te October 2005 February 2006 February 2008 January 2010 September 2010 November 2011 S o f t w ar e Ve r s io n 11 11 SP 1 12 13 14 15.0
ii
Getting Help
Ansoft Technical Support
To contact Ansoft technical support staff in your geographical area, please log on to the ANSYS corporate website, http://www.ansys.com, click the Contact button, and then click Support. Your ANSYS sales engineer may also be contacted in order to obtain this information. E-mail can work well for technical support. All Ansoft software files are ASCII text and can be sent conveniently by e-mail. When reporting difficulties, it is extremely helpful to include very specific information about what steps were taken or what stages the simulation reached. This allows more rapid and effective debugging.
iii
iv
Table of Contents
1. Introduction to VBScript
Sample Maxwell Script . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 VBScript Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5
Declaring Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variable Naming Conventions . . . . . . . . . . . . . . . . . . . . . . Scope and Lifetime of Variables . . . . . . . . . . . . . . . . . . . . Array Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Operator Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5 1-6 1-6 1-6 1-8 1-8 1-9 1-9
Converting Between Data Types . . . . . . . . . . . . . . . . . . . . 1-12 Interacting with a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13 Recommended VBScript References . . . . . . . . . . . . . . . . 1-13
ExportOptionsFiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
GetActiveProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 GetLibraryDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 GetProjectDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 GetProjectList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 GetTempDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 GetVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 NewProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 OpenMultipleProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5 OpenProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 PauseScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 QuitApplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 RestoreWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 RunProgram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 RunScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 SetActiveProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 SetActiveProjectByPath . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8 SetLibraryDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 SetProjectDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 SetTempDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 Sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9
GetProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Additional Property Scripting Example . . . . . . . . . . . . . . . 6-24 Example: Using Record Script and Edit Properties . . . . . 6-25
Is2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14 Is3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14 GetOutputVariableValue, AddOutputVariable, EditOutputVariable, DeleteOutputVariable . . . . . . . . . . . . . . . . . . . . . . . 8-14 ChangeProperty, GetPropertyValue, SetPropertyValue, GetProperties, GetVariableValue, SetVariableValue, GetVariables 8-15 CreateReport, RemoveReport, GetReportNames . . . . . . 8-15 AddDataset, EditDataset, DeleteDataset . . . . . . . . . . . . . 8-15
CreateRegularPolyhedron . . . . . . . . . . . . . . . . . . . . . . . 10-11 CreateRegularPolygon . . . . . . . . . . . . . . . . . . . . . . . . . . 10-12 CreateSphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-12 CreateSpiral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13 CreateTorus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13 EditPolyline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14 InsertPolylineSegment . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14 PurgeHistory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15 DeletePolylinePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16 SweepAlongPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16 SweepAlongVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17 SweepAroundAxis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
CreateObjectFromFaces . . . . . . . . . . . . . . . . . . . . . . . . 10-31 CreateRelativeCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-32 DeleteLastOperation . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-32 DetachFaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-33 EditEntityList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-33 EditFaceCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-34 EditObjectCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-34 EditRelativeCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-36 Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-37 Fillet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-37 GenerateHistory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-38 Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-38 ImportDXF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-38 Intersect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-41 MoveFaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-42 Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-43 SeparateBody . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-43 SetModelUnits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-43 SetWCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-44 ShowWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-44 Split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-44 Subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-45 UncoverFaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-45 Unite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-46
GetMatchedObjectName . . . . . . . . . . . . . . . . . . . . . . . . 10-50 GetNumObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-50 GetSelections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-50 PageSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-51 RenamePart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-51 GetModelBoundingBox . . . . . . . . . . . . . . . . . . . . . . . . . 10-52
UpdateTracesContextAndSweeps . . . . . . . . . . . . . . . . . 11-17
EditRadiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12 AssignImpedance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12 EditImpedance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-12 AssignTangentialHField . . . . . . . . . . . . . . . . . . . . . . . . . 12-13 EditTangentialHField . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-13 AssignCylindricalHField . . . . . . . . . . . . . . . . . . . . . . . . . 12-13 EditCylindricalHField . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-14
EditSink . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-23
ExportCircuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-10 ExportSolnData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-11 RevertSetupToInitial . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-12 RevertAllToInitial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-12 ResetSetupToTimeZero . . . . . . . . . . . . . . . . . . . . . . . . . 14-13 ResetAllToTimeZero . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-13 GetSetups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-13 GetSetupNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-13 Analyze (Project Menu) . . . . . . . . . . . . . . . . . . . . . . . . . 14-14 CopySetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-14 PasteSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-14
EnterQty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-9 EnterScalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-9 EnterScalarFunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-9 EnterSurf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-10 EnterVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-10 EnterVectorFunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-10 EnterVol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-11 ExportOnGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-11 ExportToFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-12 GetTopEntryValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-12 LoadNamedExpressions . . . . . . . . . . . . . . . . . . . . . . . . 18-13 SaveNamedExpressions . . . . . . . . . . . . . . . . . . . . . . . . 18-13
EditForce . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-5 AssignTorque . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-6 EditTorque . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-6 AssignMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-6 EditMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18-7
Contents-17
Contents-18
Introduction to VBScript
Maxwell uses the Microsoft Visual Basic Scripting Edition (VBScript) scripting language to record macros. VBScript is based on the Microsoft Visual Basic programming language. Using scripts is a fast, effective way to accomplish tasks you want to repeat. You can write a script using any text editor, or you can record a script from within the Maxwell interface. After recording the script from within Maxwell, you can then modify it using a text editor. Although Maxwell records scripts in VBScript format, it can also execute scripts in JavaScriptTM format. If you are running a script from a command prompt, the script can be written in any language that provides the Microsoft COM methods. The Maxwell scripting documentation refers to VBScript format only. This chapter provides an overview of key VBScript components. For more details about VBScript, please see the Recommended VBScript References section at the end of this chapter. Related Topics: Sample Maxwell Script VBScript Variables VBScript Operators Controlling Program Execution Looping Through Code VBScript Procedures Converting Between Data Types Interacting with a Script
Introduction to VBScript 1-1
Set oDesign = oProject.SetActiveDesign("Maxwell Model1") Set oEditor = oDesign.SetActiveEditor("3D Modeler") oEditor.CreateBox Array("NAME:BoxParameters", "XPosition:=", _ "0mm", "YPosition:=", "0mm", "ZPosition:=", "0mm", _ "XSize:=", "1.6mm", "YSize:=", "1.2mm", "ZSize:=", _ "0.8mm"), Array("NAME:Attributes", "Name:=", "Box1", "Flags:=",_ "", "Color:=", "(132 132 193)", "Transparency:=", _ 0.400000005960464, "PartCoordinateSystem:=", _ "Global", "MaterialName:=", "vacuum", "SolveInside:=", true) oEditor.CreateBox is a Sub procedure that takes two array variables as input. The first array is for the boxs geometric parameters, and the second array is for the boxs attributes. You can modify the italicized entries to create a different box. In VBScript, Array is a function that returns a variant containing an array. The underscore character ( _ ) here indicates that the statement continues to the next line. The underscore character must be placed outside of string constants, or else VBScript recognizes the character as part of the string constant rather than an indication that the string continues on the next line. Following is an example of proper use of the underscore character: Msgbox(Please include units when creating variables "& _ "that require dimensions." Following is an example of improper use of the underscore character: Msgbox("Please include units when creating variables _ that require dimensions." For additional Maxwell script examples, see Example Scripts.
VBScript Variables
A VBScript variable is a placeholder representing information that may change while your script is running. Variables are useful because they let you assign a short and easy to remember name to each piece of data you plan to use. Use a variable name in a script to view or modify its value.
Declaring Variables Variable Naming conventions Scope and Lifetime of Variables Array Variables
Declaring Variables
To declare variables explicitly in a script, use the Dim, Public, or Private statements. For example: Dim box_xsize After declaring a variable, you can assign information to it. For example: box_xsize = "3mm" You can declare multiple variables by separating each variable name with a comma. For example: Dim Top, Bottom, Left, Right You can also declare a variable implicitly by simply using its name in your script. Doing so is not generally a good practice because you could misspell the variable name in one or more places, causing unexpected results when your script is run. For that reason, the Option Explicit statement is available to require explicit declaration of all variables. The Option Explicit statement should be the first statement in your script.
Begin with an alphabetic character. Cannot contain an embedded period. Must not exceed 255 characters. Must be unique in the scope in which it is declared. Do not use VBScript keywords.
Array Variables
Create an array variable when you want to assign more than one related value to a single variable. An array variable contains a series of values. For example: Dim Primitives(2) All arrays in VBScript are zero-based, so the array above actually contains 3 elements. You assign data to each of the arrays elements using an index into the array. Data can be assigned to the elements of an array as follows: Primitives(0) = "Box1" Primitives(1) = "Cone1" Primitives(2) = "Cylinder1" Similarly, the data can be retrieved from any element using an index into a particular array element. For example: one_prim = Primitives(1) You can also use the Array function to assign an array of elements to a variable. For example: Dim Primitives Primitives = Array ("Box1", "cone1", "Cylinder1") Note When using the Array function, do not use parentheses on the variable when it is declared. For example, use Dim myarray, not Dim myarray().
If you do not know the size of the array at declaration or the size changes during the time your script is running, you can use dynamic arrays. They are declared without size or number of dimensions inside the parentheses. For example: Dim FirstArray() ReDim SecondArray() To use a dynamic array, you must subsequently use ReDim to determine the number of dimensions and the size of each dimension. You can also use the Preserve keyword to preserve the contents of the array as the resizing takes place. ReDim FirstArray(25) ReDim Preserve FirstArray(30)
VBScript Operators
VBScript provides operators, which are grouped into three categories: arithmetic operators, comparison operators, and logical operators. Please see the online VBScript Users Guide for more details. Related Topics: Operator Precedence
Operator Precedence
When several operations occur in an expression, each part is evaluated and resolved in a predetermined order, called operator precedence. You can use parentheses to override the order of precedence and force some parts of an expression to be evaluated before others. Operations within parentheses are always performed before those outside the parentheses. Within parentheses, however, standard operator precedence is maintained. When expressions contain operators from more than one category, arithmetic operators are evaluated first, comparison operators are evaluated next, and logical operators are evaluated last. Comparison operators all have equal precedence, that is, they are evaluated in the left-toright order in which they appear. Arithmetic and logical operators are evaluated in the following order of precedence:
Arithmetic Operators
Following is a list of VBScripts arithmetic operators. Symbol ^ * / \ Mod + & Description Exponentiation Unary negation Multiplication Division Integer division Modulus arithmetic Addition Subtraction String concatenation
Comparison Operators
Following is a list of VBScripts comparison operators: Symbol = <> < > <= >= Is Description Equality Inequality Less than Greater than Less than or equal to Greater than or equal to Object equivalence
Logical Operators
Following is a list of VBScripts logical operators: Symbol Not And Or Xor Eqv Imp Description Logical negation Logical conjunction Logical disjunction Logical exclusion Logical equivalence Logical implication
Using If...Then...Else
Following is an example that demonstrates the If...Then...Else conditional statement: If obj = "Box1" Then <statements to execute> ElseIf obj = "Cylinder1" Then <statements to execute> Else <statements to execute> End If
For...Next: Uses a counter to run statements a specified number of times. Do...Loop: Loops while or until a condition is True.
Using a Do Loop
You can use Do...Loop statements to run a block of statements until (or while) a condition is true. Repeating Statements While a Condition is True Use the While keyword to check a condition in a Do...Loop statement. The syntax is as follows: Do While condition <statements to execute> Loop Repeating a Statement Until a Condition Becomes True Following is the syntax: Do Until condition <statements to execute> Loop You can exit early from a loop by using the Exit For statement.
VBScript Procedures
In VBScript, there are two kinds of procedures, Sub and Function. These procedures are called by name, they can receive arguments, and each performs a specific task with a group of VBScript statements. If there is no argument, then the Sub or Function statement must include an empty set of parentheses.
Function Procedures
A Function returns a value by assigning a value to its name in one or more statements. Following is the syntax of a Function: Function FunctionName([arguments]) <Function statements> End Function
Sub Procedures
A Sub procedure is like a function procedure, except that it does not return a value through its name. Following is the syntax of a Sub: Sub ProcedureName([arguments]) <Procedure statements> End Sub
This chapter provides an overview of Maxwell scripting using VBScript. Information is included on the following topics:
Maxwell script variables. Recording, running, pausing, resuming, and stopping a script from running or recording.
Modifying a script for easier playback. Maxwell scripting conventions, including script command syntax used in
this guide, named arguments, and setting numerical values.
oDesktop
oProject
oDesign
oEditor
oModule
oAnsoftApp
The oAnsoftApp object provides a handle for VBScript to access Maxwell.
oDesktop
The oDesktop object is used to perform desktop-level operations, including project management. See Chapter 4, Desktop Object Script Commands, for details about script commands recognized by the oDesktop object.
oProject
The oProject object corresponds to one project open in the product. It is used to manipulate the project and its data. Its data includes variables, material definitions and one or more designs. See the following chapters for details about the script commands recognized by the oProject object:
Chapter 5, Project Object Script Commands Chapter 6, Material Script Commands Chapter 7, Property Script Commands Chapter 8, Dataset Script Commands
oDesign
The oDesign object corresponds to an instance of a design in the project. This object is used to manipulate the design and its data. Its data includes variables, modules, and editors. See the following chapters for details about the script commands recognized by the oDesign object:
Chapter 9, Design Object Script Commands Chapter 10, Output Variable Script Commands Chapter 12, Reporter Editor Script Commands
oEditor
The oEditor object corresponds to an editor, such as the 3D Modeler. This object is used to add and modify data in the editor. The Maxwell product scripting supports the following editors: Editor 3D Modeler Editor Reporter Editor "3D Modeler" There is no Reporter editor object in the script. Instead, Reporter editor commands are executed by the Maxwell design object oDesign. Name in Script
See Chapter 11, 3D Modeler Editor Script Commands, for details about the script commands recognized by the oEditor object and Chapter 12, Reporter Editor Script Commands for details about Reporter editor commands.
oModule
The oModule object corresponds to a module in the design. Modules are used to handle a set of related functionality. The Maxwell product scripting supports the following modules: Module Boundary Module Corresponds to the Boundary and Excitation commands. Mesh Operations Module Corresponds to the Mesh Operations folder in the project tree. Analysis Module Corresponds to the Analysis folder in the project tree. Optimetrics Module Corresponds to the Optimetrics folder in the project tree. "Optimetrics" "AnalysisSetup" "MeshSetup" Name in Script "BoundarySetup" Chapter Chapter 13, Boundary and Excitation Module Script Commands Chapter 14, Mesh Operations Module Script Commands
Chapter 15, Analysis Module Script Commands Chapter 16, Optimetrics Script Commands
Solutions Module Corresponds to the operations in the Solution Data dialog box, which is accessed by clicking Maxwell>Results> Solution Data. Field Overlays Module Corresponds to the Field Overlays folder in the project tree. Model Module Corresponds to the Model folder in the project tree. Parameter Module Corresponds to the Parameters folder in the project tree.
"Solutions"
"FieldsReporter"
Chapter 18, Field Overlays Module Script Commands Chapter 20, Motion Setup Script Commands
"ModelSetup"
Recording a Script
Script commands can be found on the Tools menu in the Maxwell interface. Once you start to record a script, your subsequent actions are added to the script. Each interface command has one or more associated script commands that are recorded to the script. The script is recorded to a text file in .vbs (VBScript) file format. To record a script:
On the Tools menu, click Stop Script Recording. Maxwell stops recording to the script.
Running a Script
Script commands can be found on the Tools menu in the Maxwell interface. To run a script:
2 Use the file browser to locate the folder in which you saved the script, and then double-click 3
the folders name. Type the name of the script in the File name text box, or click its name, and then click Open. Maxwell executes the script.
To supply script arguments when running from Tools>Run Script, use the edit field at the bottom of the file selection dialog. You can access the script arguments using the AnsoftScriptHost.arguments collection from vbscript. This is a standard COM collection. To run a script from a command line (as described in the Online Help):
1 Type one of the following command line options at the command line:
-runscriptandexit or -runscript
2 Press Enter.
You can also pass the -scriptargs parameter to the script and specify arguments. Note If you run the script from DOS prompt as a .vbs file (that is, you do not launch Maxwell or ePhysics, but simply launch vbs directly, or use wscript.exe or cscript.exe), the arguments will be in the WSH.arguments collection, not the AnsoftScriptHost.arguments collection. To handle this, write the following: on error resume next dim args Set args = AnsoftScript.arguments if(IsEmpty(args)) then Set args = WSH.arguments End if on error goto 0 'At this point, args has the arguments no matter if you are running 'under windows script host or Ansoft script host msgbox "Count is " & args.Count for i = 0 to args.Count - 1 msgbox args(i) next
2-6 Maxwell and VBScript
Stopping a Script
Script commands can be found on the Tools menu in the Maxwell interface. To stop a script.
Click Tools>Stop Script. Maxwell stops executing the script that has been paused.
Syntax conventions Script command conventions Named arguments Setting numerical values
Syntax Conventions
The following data types will be used throughout this scripting guide: <string> <bool> A quoted string. A boolean value. Should be set to either true or false (no quotes). Example: "SolveInside:=", true
A double precision value. Example: 1.2 An integer. Example: 1 Can be a number, a VBScript variable, or a quoted string containing a valid Maxwell expression. Examples: -"XSize:=", 1 -"XSize:=", "3mm" -"XSize:=", VBScript_Var -"XSize:=", "Maxwell_Var + 10mm"
There is an issue if the user runs the script from a DOS prompt as a .vbs file (that is, you dont open Maxwell, but launch the vbs script directly, or use wscript.exe or cscript.exe). The arguments will be in the WSH.arguments collection, not the AnsoftScriptHost.arguments collection. To handle this, you can write this: on error resume next dim args Set args = AnsoftScript.arguments if(IsEmpty(args)) then Set args = WSH.arguments End if on error goto 0 'At this point, args has the arguments no matter if you are running 'under windows script host or Ansoft script host msgbox "Count is " & args.Count for i = 0 to args.Count - 1 msgbox args(i) next
Named Arguments
Many Maxwell script commands use named arguments. The names can appear in three ways: 1. Named data, name precedes data. For example: ...,"SolveInside:=", true, ... 2. Named Array, name precedes array. For example: ...,"Attributes:=", Array(...),.. 3. Named Array, name inside array. For example: ..., Array("NAME:Attributes",..),.. In the first and second examples, the name is formatted as <Name>:=. This signals Maxwell that this is a name for the next argument in the script command. In the third example, the name is formatted as NAME:<name> and is the first element of the Array. The names are used both to identify what the data means to you and to inform Maxwell which data is being given. The names must be included or the script will not play back correctly. However, if you are writing a script, you do not need to pass in every piece of data that the command can take. For example, if you are modifying a boundary, the script will be recorded to include every piece of data needed for the boundary, whether or not it was modified. If you are writing a script by hand, you can just add the data that changed and omit anything that you do not want to change. Maxwell will use the names to determine which data you provided.
Maxwell and VBScript 2-9
For example, when editing an impedance boundary, Maxwell records the edit impedance boundary command as follows: oModule.EditImpedance "Imped1", Array("NAME:Imped1", "Resistance:=",_ "100", "Reactance:=", "50", "InfGroundPlane:=", false) If you only want to change the resistance, then you can leave out the other data arguments when you are manually writing a script: oModule.EditImpedance "Imped1", Array("NAME:Imped1", "Resistance:=",_ "100")
Pass in the number directly. For example: oModule.EditVoltage "Voltage1", Array("NAME:Voltage1", "Voltage:=",_ 3.5)
Pass in a string containing the number with units. For example: oModule.EditVoltage "Voltage1", Array("NAME:Voltage1", "Voltage:=",_ "3.5V" )
Pass in an Maxwell defined variable name. For example: oModule.EditVoltage "Voltage1", Array("NAME:Voltage1", "Voltage:=",_ "$var1" )
Pass in a VBScript variable. For example: vb_var = "3.5V" oModule.EditVoltage "Voltage1", Array("NAME:Voltage1", "Voltage:=",_ vb_var)
Personal library directory. This is the PersonalLib subdirectory in the project directory. The project directory can be specified in the General Options dialog box (click Tools>Options>General Options to open this dialog box) under the Project Options tab. User library directory. This is the userlib subdirectory in the library directory. The library directory can be specified in the General Options dialog box (click Tools>Options>General Options to open this dialog box) under the Project Options tab. System library directory. This is the syslib subdirectory in the library directory. The library directory can be specified in the General Options dialog box (click Tools>Options>General Options to open this dialog box) under the Project Options tab. Maxwell installation directory.
Editing Properties
Any data that is shown in the dockable Properties dialog box or in the modal Properties pop-up window is called a property. For example, project and local variables are properties. The XSize of a box in the Geometry editor is also a property. See Chapter 7, Property Script Commands, for an explanation of how to manipulate properties in a script.
The Application object commands permit you to set parameters for RAM and processor use. Application object commands should be executed by the oAnsoftApp object. oAnsoftApp.<CommandName> <args>
GetAppDesktop
Use: GetAppDesktop is a function of oAnsoftApp. This function does not take an input and it returns an object. The object is assigned to the variable oDesktop. GetAppDesktop() Object. None Set oDesktop = oAnsoftApp.GetAppDesktop()
SetDesiredRamMBLimit
Use: Syntax: Return Value: Parameters: Sets the Desired RAM Limit (MB) value. SetDesiredRamMBLimit <DesiredRAMLimit>, <ProductName> None <DesiredRAMLimit> Type: <int> <ProductName> Type: <String> Values may be: Maxwell 3D, Maxwell 2D. If no ProductName is supplied, the setting is applied to both 2D and 3D. Note This function is not supported for RMxprt. oAnsoftApp.SetDesiredRamMBLimit 2000, "Maxwell 3D"
Example:
GetHPCLicenseType
Use: Syntax: Return Value: Parameters: Example: Returns the HPC license type if multiprocessing using HPC licenses has been enabled. GetHPCLicenseType <ProductName> <string> = "pack" or "pool" <ProductName> Type: <string> Dim oAnsoftApp Dim oDesktop Dim oProject Dim oDesign Dim oEditor Dim oModule Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface") Set oDesktop = oAnsoftApp.GetAppDesktop() oDesktop.RestoreWindow Set oProject = oDesktop.SetActiveProject("Project6") Set oDesign = oProject.SetActiveDesign("MaxwellDesign1") oAnsoftApp.GetUseHPCForMP oAnsoftApp.GetHPCLicenseType "Maxwell 15.0" oAnsoftApp.SetHPCLicenseType("Pool") oAnsoftApp.SetUseHPCForMP(1)
GetUseHPCForMP
Use: Returns "true" if Use HPC licenses for multiprocessing and distributed frequency has been enabled on the Maxwell 2D Options Solver tab or Maxwell 3D Options Solver tab. GetUseHPCForMP <ProductName> "true" if Use HPC licenses for multiprocessing and distributed frequency has been enabled on the Maxwell 2D Options Solver tab or Maxwell 3D Options Solver tab. <ProductName> Type: <string> Example: Dim oAnsoftApp
Ansoft Application Object Script Commands 3-3
Parameters:
Dim oDesktop Dim oProject Dim oDesign Dim oEditor Dim oModule Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface") Set oDesktop = oAnsoftApp.GetAppDesktop() oDesktop.RestoreWindow Set oProject = oDesktop.SetActiveProject("Project6") Set oDesign = oProject.SetActiveDesign("MaxwellDesign1") oAnsoftApp.GetUseHPCForMP "Maxwell 15.0" oAnsoftApp.GetHPCLicenseType oAnsoftApp.SetHPCLicenseType("Pool") oAnsoftApp.SetUseHPCForMP(1)
SetUseHPCForMP
Use: Command: Enables HPC licenses to be used for multiprocessing and distributed frequency sweeps. Tools>Options>Maxwell2D Options and Tools>Options>Maxwell3D Options, Solver tab - Use HPC licenses for multiprocessing and distributed frequency. SetUseHPCForMP <bool>, <ProductName> None <bool>; true = use HPC for MP <ProductName> Type: <string> Example: Dim oAnsoftApp Dim oDesktop Dim oProject Dim oDesign Dim oEditor Dim oModule Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface") Set oDesktop = oAnsoftApp.GetAppDesktop()
3-4 Ansoft Application Object Script Commands
oDesktop.RestoreWindow Set oProject = oDesktop.SetActiveProject("Project6") Set oDesign = oProject.SetActiveDesign("MaxwellDesign1") oAnsoftApp.GetUseHPCForMP oAnsoftApp.GetHPCLicenseType oAnsoftApp.SetHPCLicenseType("Pool") oAnsoftApp.SetUseHPCForMP "true", "Maxwell 15.0"
SetHPCLicenseType
Use: Command: Syntax: Return Value: Parameters: Sets the HPC License Type, either "Pack" or "Pool". Tools>Options>Maxwell2D Options and Tools>Options>Maxwell3D Options, on the Solver tab SetHPCLicenseType <string>, <ProductName> None LicenseType: <string> = pack or pool <ProductName> Type: <string> Example: Dim oAnsoftApp Dim oDesktop Dim oProject Dim oDesign Dim oEditor Dim oModule Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface") Set oDesktop = oAnsoftApp.GetAppDesktop() oDesktop.RestoreWindow Set oProject = oDesktop.SetActiveProject("Project6") Set oDesign = oProject.SetActiveDesign("MaxwellDesign1") oAnsoftApp.GetUseHPCForMP oAnsoftApp.GetHPCLicenseType oAnsoftApp.SetHPCLicenseType "pack", "Maxwell 15.0" oAnsoftApp.SetUseHPCForMP(1)
SetMaximumRamMBLimit
Use: Sets the Maximum RAM Limit (MB) value.
Ansoft Application Object Script Commands 3-5
SetMaximumRamMBLimit <MaximumRAMLimit>, <ProductName> None <MaximumRAMLimit> Type: <int> <ProductName> Type: <String> Values may be: Maxwell 3D, Maxwell 2D. If no ProductName is supplied, the setting is applied to both 2D and 3D.
Note
This function is not supported for RMxprt. oAnsoftApp.SetMaximumRamMBLimit 2000, "Maxwell 2D"
Example:
SetNumberOfProcessors
Use: Syntax: Return Value: Parameters: Sets the Number of Processors value. SetNumberOfProcessors <NumProcessors>, <ProductName> None <NumProcessors> Type: <int> <ProductName> Type: <String> Values may be: Maxwell 3D, Maxwell 2D. If no ProductName is supplied, the setting is applied to both 2D and 3D. Note This function is not supported for RMxprt. oAnsoftApp.SetNumberOfProcessors 2, "Maxwell 3D"
Example:
GetDesiredRamMBLimit
Use: Syntax: Return Value: Parameters: Gets the Desired RAM Limit (MB) value. GetDesiredRamMBLimit(<ProductName>) Returns the Desired RAM Limit in megabytes (MB). Type: <int> <ProductName> Type: <String> Values may be: Maxwell 3D, Maxwell 2D. Note This function is not supported for RMxprt.
Example:
GetMaximumRamMBLimit
Use: Syntax: Return Value: Parameters: Gets the Maximum RAM Limit (MB) value. GetMaximumRamMBLimit(<ProductName>) Returns the Maximum RAM Limit in megabytes (MB). Type: <int> <ProductName> Type: <String> Values may be: Maxwell 3D, Maxwell 2D. Note This function is not supported for RMxprt. max_ram = oAnsoftApp.GetMaximumRamMBLimit("Maxwell 3D")
Example:
GetNumberOfProcessors
Use: Syntax: Return Value: Parameters: Gets the Number of Processors value. GetNumberOfProcessors(<ProductName>) Returns the Number of Processors. Type: <int> <ProductName> Type: <String> Values may be: Maxwell 3D, Maxwell 2D. Note This function is not supported for RMxprt. numprocessors = oAnsoftApp.GetNumberOfProcessors("Maxwell 2D")
Example:
Desktop commands should be executed by the oDesktop object. Some commands permit you to query objects when you do not know the names. Set oAnsoftApp = CreateObject ("AnsoftMaxwell.MaxwellScriptInterface") Set oDesktop = oAnsoftApp.GetAppDesktop() oDesktop.CommandName <args>
CloseAllWindows
Use: Command: Syntax: Return Value: Parameters: Example: Closes all MDI child windows on the desktop. From the main menu, click Window>Close All. CloseAllWindows() None None Desktop.CloseAllWindows()
CloseProject
Use: Command: Syntax: Return Value: Parameters: Example: Closes a specified project. Changes to the project are not saved. Save the project using the Project command Save or SaveAs. File>Close CloseProject <ProjectName> None <ProjectName> Type: <string> oDesktop.CloseProject "Project1"
CloseProjectNoForce
Use: Closes a specified project unless there are simulations ongoing. Changes to the project will not be saved. Save the project using the Project command Save or SaveAs before closing to save changes. File>Close CloseProjectNoForce <ProjectName> None <ProjectName> Type: <string> Example: oDesktop.CloseProjectNoForce "Project1"
EnableAutoSave
Use: Command: Syntax: Return Value: Parameters: Example: Enables or disables the autosave feature. None EnableAutoSave(bool bEnable) None None oDesktop.EnableAutoSave(true), enables autosave
ExportOptionsFiles
Use: Command: Syntax: Return Value: Parameters: Copies the options config files to the DestinationDirectory. Tools>Options>Export Options Files ... ExportOptionsFiles <DestinationDirectory> None. <DestinationDirectory>
Desktop Object Script Commands 4-3
Type: String The path to the destination directory. Example: oDesktop.ExportOptionsFiles "D:/test/export/"
GetActiveProject
Use: Command: Syntax: Return Value: Parameters: Example: Returns the project that is active in the desktop. None GetActiveProject The project that is active in the desktop. None Set oProject = oDesktop.GetActiveProject ()
GetLibraryDirectory
Use: Syntax: Return Value: Parameters: Example: Gets the library directory path. GetLibraryDirectory Returns a directory path. Type: <string> None libdir = oDesktop.GetLibraryDirectory
GetProjectDirectory
Use: Syntax: Return Value: Parameters: Example: Gets the project directory path. GetProjectDirectory Returns a directory path. Type: <string> None projdir = oDesktop.GetProjectDirectory
GetProjectList
Use: Command: Syntax: Return Value: Parameters: Example: Returns a list of all projects that are open in the desktop. None GetProjectList An array of strings, which are the names of all open projects in the desktop. None list_of_projects = oDesktop.GetProjectList()
GetTempDirectory
Use: Syntax: Return Value: Parameters: Example: Gets the temp directory path. GetTempDirectory Returns a directory path. Type: <string> None tempdir = oDesktop.GetTempDirectory
GetVersion
Use: Command: Syntax: Return Value: Parameters: Example: Returns a string representing the version. None GetVersion() string None msgbox(oDesktop.GetVersion()), displays "12.0"
NewProject
Use: Command: Syntax: Return Value: Parameters: Example: Creates a new project. The new project becomes the active project. File>New NewProject The project that is added. None Set oProject = oDesktop.NewProject
OpenMultipleProjects
Use: Command: Syntax: Return Value: Parameters: Opens all files of a specified type in a specified directory. File>Multiple Open OpenMultipleProjects <Directory> <FileType> None <Directory> Type: <string> <FileType> Type: <string> Example: oDesktop.OpenMultipleProjects "D:/Projects", "*.mxwl"
Desktop Object Script Commands 4-5
OpenProject
Use: Command: Syntax: Return Value: Parameters: Example: Opens a specified project. File>Open OpenProject <FileName> The opened project. <FileName>: Full path and name of the project to open. Type: <string> oDesktop.OpenProject "D:/Projects/Project1.mxwl"
PauseScript
Use: Pauses the scripts execution and displays a message in a pop-up dialog box to the user. The script execution does not resume until the user clicks Tools>Resume Script. Tools>Pause Script PauseScript <Message> None <Message> Type: <string> Example: oDesktop.PauseScript "Text to display in pop-up dialog box"
Print
Use: Command: Syntax: Return Value: Parameters: Example: Prints the contents of the active view window. File>Print Print None None oDesktop.Print
QuitApplication
Use: Command: Syntax: Return Value: Parameters: Exits the desktop. File>Exit QuitApplication None None
Example:
oDesktop.QuitApplication
RestoreWindow
Use: Command: Syntax: Return Value: Parameters: Example: Restores a minimized Maxwell window. None RestoreWindow None None oDesktop.RestoreWindow
RunProgram
Use: Command: Syntax: Return Value: Parameters: Runs an external program. None RunProgram <ProgName>, <ProgPath>, <WorkPath>, <ArgArray> None <ProgName> Type: <string> Name of the program to run. <ProgPath> Type: <string> Location of the program. To use the system path, pass in an empty string. <WorkPath> Type: <string> Working directory in which program will start. <ArgArray> Type: Array of strings Arguments to pass to the program. If there are no arguments, pass in None. Example: oDesktop.RunProgram "winword.exe", _ "C:\Program Files\Microsoft Office\Office10",_ "", None
RunScript
Use: Launches another script from within the script currently being executed.
Desktop Object Script Commands 4-7
Tools>Run Script RunScript <ScriptPath> None <ScriptPath> Type: <string> Name or full path of the script to execute. If the full path to the script is not specified, Maxwell searches for the specified script in the following locations, in this order:
Personal library directory. This is the PersonalLib subdirectory in the project directory. The project directory can be specified in the General Options dialog box (invoked by clicking Tools>Options>General Options) under the Project Options tab.
User library directory. This is the userlib subdirectory in the library directory. It can be specified in the General Options dialog box.
System library directory. This is the syslib subdirectory in the library directory. It can be specified in the General Options dialog box.
Example:
oDesktop.RunScript "C:/Project/test1.vbs"
SetActiveProject
Use: Command: Syntax: Return Value: Parameters: Example: Returns a specified project as the active project in the desktop. None SetActiveProject <ProjectName> The specified project becomes active in the desktop. <ProjectName> Type: <string> Set oProject = oDesktop.SetActiveProject ("Project1")
SetActiveProjectByPath
Use: If a user has two projects open with the same name, the result of SetActiveProject is ambiguous (the first one listed in selected). The SetActiveProjectByPath command allows you to unambiguously specify the active project. SetActiveProjectByPath()
Syntax:
The specified project becomes active in the desktop. <fullPathProjectName> Set oProject = oDesktop.SetActiveProjectByPath("C:\working\rotation.mxwl ")
SetLibraryDirectory
Use: Syntax: Return Value: Parameters: Example: Sets the library directory path. The specified directory must already exist and contain a syslib folder. SetLibraryDirectory <DirectoryPath> None <DirectoryPath> Type: <string> oDesktop.SetLibraryDirectory "c:\libraries"
SetProjectDirectory
Use: Syntax: Return Value: Parameters: Example: Sets the project directory path. The directory will be automatically created if it does not already exist. SetProjectDirectory <DirectoryPath> None <DirectoryPath> Type: <string> oDesktop.SetProjectDirectory "c:\projects"
SetTempDirectory
Use: Syntax: Return Value: Parameters: Example: Sets the temp directory path. The directory will be automatically created if it does not already exist. SetTempDirectory <DirectoryPath> None <DirectoryPath> Type: <string> oDesktop.SetTempDirectory "c:\temp"
Sleep
Use: Suspends execution of Maxwell for the specified number of milliseconds, up to 60,000 milliseconds (1 minute).
Desktop Object Script Commands 4-9
Count
Use: Syntax: Return Value: Parameters: Example: Example: iterate through projects and designs using for each for each prj in oDesktop.GetProjects() msgbox prj.GetName() for each design in prj.GetDesigns() msgbox design.GetName() next next iterate through using integer index Dim projects set projects = oDesktop.GetProjects() for i = 0 to projects.Count - 1 msgbox projects(i).GetName() dim designs set designs = projects(i).GetDesigns() for j = 0 to designs.Count msgbox designs(j).GetName() next next
Desktop Object Script Commands 4-11
Gets the total number of queried projects or designs obtained by GetProjects() and GetDesigns() commands. See the example query. Count Returns an integer value. None set projects = oDesktop.GetProjects() numprojects = projects.Count
lookup by name
GetDesigns
Use: For querying designs within a queried project obtained by the GetProjects() command. Once you have the designs you can iterate through them using standard VBScript methods. See the example query. GetDesigns() Returns a COM collection of designs in the given project. None set projects = oDesktop.GetProjects() set designs = projects(0).GetDesigns()
GetDistributedAnalysisMachines
Use: Syntax: Return Value: Parameters: Example: Gets a list of machines used for distributed analysis. You can iterate through the list using standard VBScript methods. GetDistributedAnalysisMachines() Returns a COM collection of machines used for distributed analysis. None For each machine in oDesktop.GetDistributedAnalysisMachines() msgbox machine next
GetName (Desktop)
Use: Syntax: Return Value: Parameters: Example: Gets names of queried projects or designs obtained by GetProjects() and GetDesigns() commands. See the example query. GetName() Returns a name of type string. None set projects = oDesktop.GetProjects() project_name = projects(0).GetName()
GetProjects
Use: Syntax: For querying projects. Once you have the projects you can iterate through them using standard VBScript methods. See the example query. GetProjects()
Project commands should be executed by the oProject object. The following is an example of accessing the object: Set oProject = oDesktop.GetActiveProject() Note For design names, use the name as it appears in the project tree.
GetName GetPath GetActiveDesign SetActiveDesign GetTopDesignList GetDesign Close Save SaveAs InsertDesign CopyDesign Paste CutDesign DeleteDesign Undo Redo AnalyzeAll
GetName (Project)
Use: Command: Syntax: Return Value: Parameters: Example: Returns the project name. None GetName The active projects name. None name = oProject.GetName ()
GetPath
Use: Command: Syntax: Return Value: Parameters: Example: Returns the location of the project on disk. None GetPath The path to the project, which does not include the project name. None path = oProject.GetPath ()
GetActiveDesign
Use: Command: Syntax: Return Value: Parameters: Example: Returns the design in the active project. None GetActiveDesign The active design. None Set oDesign = oProject.GetActiveDesign ()
SetActiveDesign
Use: Command: Syntax: Return Value: Parameters: Sets a new design to be the active design. None SetActiveDesign <DesignName> The named design becomes active. <DesignName> Type: <string> Name of the design to set as the active design. Example: Set oDesign = oProject.SetActiveDesign ("MaxwellDesign2")
GetTopDesignList
Use: Command: Syntax: Return Value: Parameters: Example: Returns a list of the names of the top-level designs. None GetTopDesignList An array of strings that are the names of the top-level designs. None name_list = oProject.GetTopDesignList ()
GetDesign
Use: Command: Syntax: Return Value: Parameters: Returns the specified design. None GetDesign <DesignName> The specified design. <DesignName> Type: <string> Name of the design to return. Example: Set oDesign = oProject.GetDesign ("Maxwell3DDesign1")
Project Object Script Commands 5-3
Close
Use: Command: Syntax: Return Value: Parameters: Example: Closes the active project. Unsaved changes will be lost. None Close None None oProject.Close
Save
Use: Command: Syntax: Return Value: Parameters: Example: Saves the active project. File>Save Save None None oProject.Save
SaveAs
Use: Command: Syntax: Return Value: Parameters: Saves the project under a new name. File>Save As SaveAs <FileName> <OverWrite> None <FileName> Type: <string> New name for the file. <OverWrite> Type: <bool> Set to true if an existing project by that name should be overwritten. Example: oProject.SaveAs "D:/projects/project1.mxwl", true
InsertDesign
Use: Command: Inserts a new design in the project. In Maxwell scripts, the last argument will always be empty. Project>Insert Maxwell Design
InsertDesign <DesignType>, <DesignName>, <SolutionType>, "" None <DesignType> Type: <string> Type of design to insert. Can be "Maxwell 2D", "Maxwell 3D", or "RMxprt" <DesignName> Type: <string> Name of the new design. <SolutionType> Type: <string> Solution type of the new design where available types depend upon the DesignType chosen. DesignType Maxwell 3D Available SolutionType "Magnetostatic", "EddyCurrent", "Transient", "Electrostatic", "DCConduction", "ElectroDCConduction", "ElectricTransient" "Magnetostatic", "EddyCurrent", "Transient", "Electrostatic", "ACConduction", "DCConduction" "Three-Phase Induction Motor", "Single-Phase Induction Motor", "Three-Phase Synchronous Machine", "Brushless Permanent-Magnet DC Motor", "Adjust-Speed Synchronous Machine", "Permanent-Magnet DC Motor", "Switched Reluctance Motor", "Line-Start Permanent-Magnet Synchronous Motor", "Universal Motor", "DC Machine", "Claw-Pole Alternator", "Three-Phase Non-Salient Synchronous Machine"
Maxwell 2D RMxprt
Example:
"Magnetostatic", ""
CopyDesign
Use: Command: Copies a design. Edit>Copy
Project Object Script Commands 5-5
CopyDesign <DesignName> None oProject.CopyDesign "MaxwellModel1" Pastes a design in the active project. Edit>Paste Paste None None oProject.Paste
Paste (Project)
Use: Command: Syntax: Return Value: Parameters: Example:
CutDesign
Use: Command: Syntax: Return Value: Example: Warning Cuts a design from the active project. The design is stored in memory and can be pasted in any Maxwell project. Edit>Cut CutDesign <DesignName> None oProject.CutDesign "MaxwellDesign1" This is a legacy command that is no longer supported and should not be used as it may have unintended effects on solved designs.
DeleteDesign
Use: Command: Syntax: Return Value: Example: Deletes a specified design from the project. Edit>Delete DeleteDesign <DesignName> None oProject.DeleteDesign "MaxwellDesign2"
Undo (Project)
Use: Command: Syntax: Return Value: Parameters: Cancels the last project-level command. Edit>Undo Undo None None
Example:
oProject.Undo
Redo (Project)
Use: Command: Syntax: Return Value: Parameters: Example: Reapplies the last project-level command. Edit>Redo Redo None None oProject.Redo
Material commands should be executed by the oProject object. Set oProject = oDesktop.SetActiveProject("Project1") oProject.CommandName <args>
AddMaterial
Use: Command: Syntax: Return Value: Parameters: Adds a local material. Add Material command in the material editor. AddMaterial Array("NAME:<MaterialName>", <MatProperty>, <MatProperty>, ...) None <MatProperty> (simple material) "<PropertyName>:=", <value> <MatProperty> (anisotropic material) Array("NAME:<PropertyName>, "property_type:=", "AnisoProperty", "unit:=", <string>", "component1:=", <value>, "component2:=", <value>, "component3:=", <value>) <PropertyName> Type: <string> Should be one of the following: "permittivity", "permeability", "conductivity" "dielectric_loss_tangent", "magnetic_loss_tangent", "magnetic_coercivity", "core_loss_type", "mass_density", "stacking_type" property_type Type: <string> Should be one of the following: "AnisoProperty", "nonlinear" unit Type: <string> Possible values: delta_H: "Oe" saturation_mag: "Gauss", "uGauss", "Tesla", "uTesla"
6-2 Material Script Commands
other properties: "" (empty string) <MatProperty> (nonlinear material) Array("NAME:permeability, "property_type:=", "nonlinear", "BType:=", <string>, "Hunit:=", <string>", "Bunit:=", <string>, Array("NAME:BHCoordinates, Array("NAME:Coordinate, "X:=", <value>, "Y:=", <value>, ... Btype Type: <string> Should be one of the following: "Intrinsic", "Normal" (defaults to Normal if nothing is specified). An error message displays in the Message Window if the string does not match either "Normal" or "Intrinsic"; advising the user of this and informing the user that this property has been set to "Normal". Hunit Type: <string> Possible values: "Oe", "A_per_meter", "kA_per_meter" Bunit Type: <string> Possible values: "tesla", "kTesla "uGauss" <MatProperty> (vector material) Array("NAME:<PropertyName>", "property_type:=", "VectorProperty", " Magnitude:=", <value>", DirComp1:=", <value>, "DirComp2:=", <value>, "DirComp3:=", <value>)) <MatProperty> (choice material) Array("NAME:<PropertyName>", "property_type:=", "ChoiceProperty", "Choice:=", <string>") Example: oProject.AddMaterial Array("NAME:Material2",_ "dielectric_loss_tangent:=", "44",_ Array("NAME:saturation_mag",_ "property_type:=", "AnisoProperty",_ "unit:=", "Gauss",_ "component1:=", "11", _
Material Script Commands 6-3
"component2:=", "22", _ "component3:=", "33"), _ "delta_H:=", "44Oe") Example: oDefinitionManager.AddMaterial Array("NAME:Material5",_ "CoordinateSystemType:=", _"Cartesian",_ Array("NAME:AttachedData"),_ Array("NAME:magnetic_coercivity", "property_type:=", _ "VectorProperty", "Magnitude:=", "-1A_per_meter",_ "DirComp1:=", "1", "DirComp2:=", _"2", "DirComp3:=",_ "3")) Example: oDefinitionManager.AddMaterial Array("NAME:Material4",_ "CoordinateSystemType:=", _"Cartesian",_ _ Array("NAME:AttachedData"),_ Array("NAME:stacking_type", "property_type:=", "ChoiceProperty", "Choice:=", "Lamination"),_ "stacking_factor:=", "0",_ Array("NAME:stacking_direction", "property_type:=",_ "ChoiceProperty", "Choice:=", ""))
DoesMaterialExist
Use: Command: Syntax: Return Value: Parameters: Checks for the presence of a material in the library by name None DoesMaterialExist(<MaterialName>) Boolean <MaterialName> Type: <string> Name of the material to search for in the material database Example: Set oProject = oDesktop.SetActiveProject("cir_th") Set oDesign = oProject.SetActiveDesign("Design1") Set oDefinitionManager = oProject.GetDefinitionManager() if(oProject.DoesMaterialExist("modified_epoxy")) then MsgBox("It Exists") else MsgBox("It Doesn't Exist...Creating")
6-4 Material Script Commands
oProject.AddMaterial Array("NAME:Material2",_ "dielectric_loss_tangent:=", "44",_ Array("NAME:saturation_mag",_ "property_type:=", "AnisoProperty",_ "unit:=", "Gauss",_ "component1:=", "11", _ "component2:=", "22", _ "component3:=", "33"), _ "delta_H:=", "44Oe") end if
EditMaterial
Use: Command: Syntax: Return Value: Parameters: Modifies an existing material. View/Edit Materials command in the material editor. EditMaterial <OriginalName>, Array("NAME:<NewName>", <MatProperty>, <MatProperty>, ...) None <OriginalName> Type: <string> Name of the material before editing. <NewName> Type: <string> New name for the material. Refer to AddMaterial for detailed information on material properties. Example: Set oProject = oDesktop.SetActiveProject("example_magnetostatic") Set oDefinitionManager = oProject.GetDefinitionManager() oDefinitionManager.EditMaterial "lin_steel", Array("NAME:lin_steel", "CoordinateSystemType:=", _
"Cartesian", Array("NAME:AttachedData"), Array("NAME:ModifierData"), Array("NAME:permeability", "property_type:=", "nonlinear", "BType:=", "Intrinsic", "HUnit:=", "A_per_meter", "BUnit:=", "tesla", Array("NAME:BHCoordinates", Array("NAME:Coordinate", "X:=", _ 0, "Y:=", 0), Array("NAME:Coordinate", "X:=", 2.23, "Y:=", 33), Array("NAME:Coordinate", "X:=", _ 4, "Y:=", 42))), Array("NAME:magnetic_coercivity",
Material Script Commands 6-5
"property_type:=",
ExportMaterial
Use: Command: Syntax: Return Value: Parameters: Exports a local material to a library. Export to Library command in the material editor. ExportMaterial <ExportData>, <Library location> None <ExportData> Array("NAME:<LibraryName>", <MaterialName>, <MaterialName>, ...) Example: oProject.ExportMaterial Array("NAME:mo0907b",_ "Material1", "Material2", "Material3"), "UserLib"
RemoveMaterial
Use: Command: Syntax: Return Value: Parameters: Removes a material from a library. Remove Material(s) command in the material editor. RemoveMaterial <MaterialName>, <IsProjectMaterial>, <LibraryName>, <LibraryLocation> None <MaterialName> Type: <string> Name of the material to be removed. <IsProjectMaterial> Type: <bool> If true, Maxwell assumes the material is a project material, and the last two parameters are ignored. <LibraryName> Type: <string> The name of the user or personal library where the material resides. <LibraryLocation> Type: <string> Should be UserLib or PersonalLib. Example: oProject.RemoveMaterial "Material1", false, "mo0907",_
Property commands should be executed by the oProject object. Set oProject = oDesktop.SetActiveProject("Project1") oProject.CommandName <args>
<Property> Refers to a single item that can be modified in the dockable Properties dialog box or in the modal Properties pop-up window.
<PropServer> Refers to the item whose properties are being modified. This is usually a compound name giving all the information needed by the editor, design, or project to locate the item being edited.
<PropTab> Corresponds to one tab in the Property dialog box the tab under which properties are being edited.
<PropServer> and <PropTab> Names Project Project Variables: <PropServer> "ProjectVariables" <PropTab> "ProjectVariableTab" Maxwell Design Local Variables: <PropServer> "LocalVariables" <PropTab> "LocalVariableTab" Maxwell Modules <PropServer> Format is: <ModuleName>:<ItemName>, where <ItemName> is the solution setup name, etc., depending on which module is being edited. Example: <PropServer> for the boundary PerfE1 is BoundarySetup:PerfE1 <PropTab>
7-2 Property Script Commands
Boundary module: "MaxwellTab" Mesh Operations module: "MeshSetupTab" Analysis module: "MaxwellTab" Optimetrics module: "OptimetricsTab" Solutions module: Radiation module: 3D Model Editor Object in the module: <PropServer> Name of the object. For example: "Box1". <PropTab> "Geometry3DAttributeTab" Operation on an object: <PropServer> Format is <ObjName>:<OpperationName>:<int> Concatenation of object name, operation name, and the index of the operation. For example: "Box2:CreateBox:2" refers to the second "CreateBox" command in Box2s history. <PropTab> "Geometry3DCmdTab" Reporter Operations on Report properties: Format is <ReportSetup> For example, to set the Company Name in the plot header to My Company: Set oModule = oDesign.GetModule("ReportSetup") oModule.ChangeProperty Array("NAME:AllTabs",_ Array("NAME:Header",_ Array("NAME:PropServers",_ "XY Plot1:Header"), Array("NAME:ChangedProps",_ Array("NAME:Company Name", "Value:=", "My Company")))) Does not support properties. "RadFieldSetupTab" Field Overlays module: "FieldsPostProcessorTab"
ChangeProperty
Use: Changes to properties are scripted using the ChangeProperty command. This command can be executed by the oEditor to change editor properties, by the oDesign to change design level properties, and by the oProject to change project level properties. The command can be used to create, edit, and/or remove properties. In Maxwell, only Variable and Separator properties can be deleted. None ChangeProperty Array("Name:AllTabs", <PropTabArray>, <PropTabArray>, ...) None <PropTabArray> Array("Name:<PropTab>", <PropServersArray>, <NewPropsArray>, <ChangedPropsArray>, <DeletedPropsArray>) <PropServersArray> Array("Name:PropServers", <PropServer>, <PropServer>, ...) <NewPropsArray> Array("Name:NewProps", <PropDataArray>, <PropDataArray>,...) <ChangedPropsArray> Array("Name:ChangedProps",<PropDataArray>, <PropDataArray>, ...) <DeletedPropsArray> Array("Name:DeletedProps", <PropName>, <PropName>, ...) <PropDataArray> Array("NAME:<PropName>", "PropType:=", <PropType>, "NewName:=", <string>,
7-4 Property Script Commands
"Description:=", <string>, "NewRowPosition:=", <int>, "ReadOnly:=", <bool>, "Hidden:=", <bool>, <PropTypeSpecificArgs>) <PropType> Type: string Identifies the type of property when a new property is added. In Maxwell, only separator properties and variable properties can be added. "SeparatorProp" VariableProp" "TextProp" "NumberProp" "ValueProp" "CheckboxProp" "MenuProp" "PointProp" "VPointProp" "V3DPointProp" "ButtonProp" NewName Specify the new name of a property if the propertys name is being edited. In Maxwell, the name can only be changed for separators and variables. Description Specify a description of the property. In Maxwell, the description can only be changed for separators and variables. NewRowPosition Used to reorder rows in the Property dialog box. In Maxwell, this only applies to the Project>Project Variables panel and the Maxwell3D>Design Properties, Maxwell2D>Design Properties, or RMxprt>Design Properties panel. Specify the new zero-based row index of the variable or separator. ReadOnly Used to mark a property as "read only" so it can not be modified. In Maxwell, this flag can only be set for variables and separators.
Property Script Commands 7-5
Hidden Used to hide a property so it can not be viewed outside of the Property dialog box. In Maxwell, this flag can only be set for variables and separators. <PropTypeSpecificArgs> SeparatorProp: no arguments TextProp: "Value:=", <string> NumberProp: "Value:=", <double> ValueProp: "Value:=", <value> CheckboxProp: "Value:=", <bool> MenuProp: "Value:=", <string> PointProp"X:=", <double>, "Y:=", <double> VPointProp: "X:=", <value>, "Y:=", <value> V3DPointProp: "X:=",<value>, "Y:=",<value>, "Z:=",<value> Material Button: "Material:=", <string> Color Button: "R:=",<int>,"G:=",<int>,"B:=",<int> Transparency Button:"Value:=", <double> <PropTypeSpecificArgs> for VariableProps Syntax: "Value:=", <value>, <OptimizationFlagsArray>, <TuningFlagsArray>, <SensitivityFlagsArray>, <StatisticsFlagsArray> Parameters: <OptimizationFlagsArray> Array("NAME:Optimization", "Included:=", <bool>, "Min:=", <value>, "Max:=", <value>) <Tuning flagsArray> Array("NAME:Tuning", "Included:=", <bool>, "Step:=", <value>, "Min:=", <value>, "Max:=", <value>) <SensitivityFlagsArray> Array("NAME:Sensitivity", "Included:=", <bool>,
7-6 Property Script Commands
"Min:=", <value>, "Max:=", <value>, "IDisp:=", <value> ) <StatisticsFlagsArray> Array("NAME:Statistical", "Included:=", <bool>, "Dist:=", <Distribution>, "StdD:=", <value>, "Min:=", <value>, "Max:=", <value>, "Tol:=", <string>) <Distribution> Type: string Value should be "Gaussian" or "Uniform" StdD Standard deviation. Min Low cut-off for the distribution. Max High cut-off for the distribution. Tol Tolerance for uniform distributions. "<int>%". Example: "20%". Example: Adding a new project level variable "$width": oProject.ChangeProperty Array("NAME:AllTabs",_ Array("NAME:ProjectVariableTab",_ Array("NAME:PropServers", "ProjectVariables"),_ Array("NAME:NewProps",_ Array("NAME:$width",_ "PropType:=", "VariableProp",_ "Value:=", "3mm",_ "Description:=", "my new variable")))) Example: Changing the Company Name, Design Name, the background color, and the Axis scaling in a Report.
Property Script Commands 7-7
Format is
Set oProject = oDesktop.SetActiveProject("wgcombiner") Set oDesign = oProject.SetActiveDesign("HFSSDesign2") Set oModule = oDesign.GetModule("ReportSetup") oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:Header", _ Array("NAME:PropServers", "XY Plot1:Header"), _ Array("NAME:ChangedProps", Array("NAME:Company Name", _ "Value:=", "My Company")))) oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:Header",_ Array("NAME:PropServers", "XY Plot1:Header"), _ Array("NAME:ChangedProps", Array("NAME:Design Name", _ "Value:=", "WG Combiner")))) oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:General",_ Array("NAME:PropServers", "XY Plot1:General"), _ Array("NAME:ChangedProps", Array("NAME:Back Color", _ "R:=", 128, "G:=", 255, "B:=", 255)))) oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:Axis", _ Array("NAME:PropServers", "XY Plot1:AxisX"), _ Array("NAME:ChangedProps", Array("NAME:Axis Scaling", _ "Value:=", "Log"))))
Example: Deleting the design level variable "height": oDesign.ChangeProperty Array("NAME:AllTabs",_ Array("NAME:LocalVariableTab",_ Array("NAME:PropServers", "DefinitionParameters"),_ Array("NAME:DeletedProps", "height")) Example: Changing a propertys value. If the following command were executed, then the value of the property XSize of the PropServer Box1:CreateBox:1 on the Geometry3DCmdTab tab would be changed. (oEditor is the Geometry3D editor in Maxwell.) oEditor.ChangeProperty Array("NAME:AllTabs",_ Array("NAME:Geometry3DCmdTab",_
7-8 Property Script Commands
<propType>
<propTypeName>
Property Description
0 1 2 3 4 5 6 7 8 9 10
TextProp MenuProp CheckboxProp VariableProp VPointProp V3DPointProp NumberProp ColorProp PointProp ValueProp ButtonProp
Text Menu Checkbox Variable VPoint V3DPoint Number Color Point Value Button
<propType>
<propTypeName>
Property Description
11 12 13
<tabType>
Description
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
DefaultTab
PassedParameterTab
DefinitionParameterTab
LocalVariableTab ProjectVariableTab ConstantsTab BaseElementTab ComponentTab PropertyTab CircuitTab SystemTab PlanarEMTab HfssTab OptimetricsTab AltraSimTab Report3DTab FieldsPostProcessorTab MeshSetupTab RadFieldSetupTab Geometry3DAttributeTab Geometry3DCmdTab Geometry3DPolylineTab
Instances of designs, components, geometric objects Definitions of designs, components Definitions of designs, components
Projects Projects Geometric objects Designs, components
Report3d Fieldspostprocessor Manual meshing setup Radiation field geometry setup Geometry3D Geometry3D Geometry3D
Property Script Commands 7-11
<tabType>
Description
22 23 24 25 26 27 28
PropHost Functions
Following are commands that can be used to manipulate properties from a script. AddMenuProp AddMenuProp2
AddProp AddProp2 ExecuteScript GetCallback GetChangedProperty GetDescription GetEditor GetFileName GetHidden GetPropServers GetPropTabType GetReadOnly GetTabTypeName GetText GetValue PropertyExists RemoveProp SetCallabck SetDescription SetHidden SetReadOnly SetText SetValue
AddMenuProp
Use: Command: Syntax: Return Value: Creates a new Menu property in tabType with name specified; choices are set to the values in choices; initial selection is initialChoice. None AddMenuProp(<tabType>, <propName>, <choices>, <initialChoice>) None.
Property Script Commands 7-13
Example:
PropHost.AddProp(2, "ResChoices", "inline,upfront,parallel,series", "parallel"); creates a new MenuProp in the DefinitionParameters tab named ResChoices with choices inline, upfront, parallel, and series. The initial choice shown in the Menu is "parallel"
AddMenuProp2
Use: Command: Syntax: Return Value: Example: Creates a new Menu property in tabTypeName with name specified; choices are set to the values in choices; initial selection is initialChoice. None AddMenuProp2(<tabTypeName>, <propName>, <choices>, <initialChoice>) None. PropHost.AddMenuProp2("DefinitionParameterTab", "ResChoices", "inline,upfront,parallel,series", "parallel"); creates a new MenuProp in the DefinitionParameters tab named ResChoices with choices inline, upfront, parallel, and series. The initial choice shown in the Menu is "parallel".
AddProp
Use: Command: Syntax: Return Value: Example: Creates a new propType property in tabType with name and value specified. None AddProp(<tabType>, <propType>, <propName>, <valueText>) None. PropHost.AddProp(2, 3, "W1", "10mm"); creates a new VariableProp in the DefinitionParameters tab named W1 with value 10mm.
AddProp2
Use: Command: Syntax: Return Value: Creates a new propTypeName property in tabTypeName with name and value specified. None AddProp2(<tabTypeName>, <propTypeName>, <propName>, <valueText>) None.
Example:
PropHost.AddProp2(("DefinitionParameterTab", "VariableProp", "W1", "10mm"); creates a new VariableProp in the DefinitionParameters tab named W1 with value 10mm.
ExecuteScript
Use: Command: Syntax: Return Value: Example: Finds the named script in the Definitions/Scripts folder and runs that script; the script being run can also use the PropHost object. None ExecuteScript(<scriptName>) None. PropHost.ExecuteScript("PropChangeScript"); runs the script named PropChangeScript
GetCallback
Use: Command: Syntax: Return Value: Example: Finds named property and returns name of Callback script. None GetCallback(<propName>) String a = PropHost.GetCallback( "W1"); returns "SynchronizeResistors"
GetChangedProperty
Use: Command: Syntax: Return Value: Example: If the script was called by a Callback associated with a property, this function returns the name of that property. None GetChangedProperty() String pn = PropHost.GetChangedProperty(); returns "C" if the script was a Callback associated with the property named "C" and the script was called in response to the property "C" changing value.
GetDescription
Use: Command: Syntax: Return Value: Finds named property and returns description string. None GetDescription(<propName>) String
Property Script Commands 7-15
Example:
GetEditor
Use: Command: Syntax: Return Value: Example: Returns an interface to the editor requested IF the PropServer behind the PropHost is contained within that type of editor. None GetEditor(<editorName>) String Set oLayout2 = PropHost.GetEditor("Layout"); returns the interface to the layout containing a selected component. This interface can be used to call Layout Scripting functions.
GetFileName
Use: Command: Syntax: Return Value: Example: Finds the named buttonProp and if it is a FileName buttonProp, it returns the file's full path name; otherwise it returns an empty string . None GetFileName(<propName>) Full path file name or empty string. a = PropHost.GetFileName("SubstrateFile"); returns the full path filename associated with the ButtonProp named SubstrateFile.
GetHidden
Use: Command: Syntax: Return Value: Example: Finds named property and returns its Hidden flag. None GetHidden(<propName>) Returns 1 if property is hidden and 0 if it is not. a = PropHost.GetHidden( "W1"); returns 1
GetPropServers
Use: Command: Syntax: Return Value: Returns array of objects that have properties showing on tabTypeName. None GetPropServers(<tabTypeName>) Returns string.
Example:
objects = PropHost.GetPropServers("PassedParameterTab"); returns array containing PropServers that have properties shown on PassedParameterTab; this would include only components and designs; individual properties can be accessed using standard notation, e.g. objects(0) might contain "CompInst@CAP_;1".
GetPropTabType
Use: Command: Syntax: Return Value: Example: Finds named property and returns the id of the tab it is in. None GetPropTabType(<propName>) Returns string. a = PropHost.GetPropTabType( "W1"); returns 2 for property W1 since it is on the DefinitionParams tab
GetReadOnly
Use: Command: Syntax: Return Value: Example: Finds named property and returns its ReadOnly flag. None GetReadOnly(<propName>) Returns 1 if property is read-only and 0 if it is not. a = PropHost.GetReadOnly( "W1"); returns 1
GetTabTypeName
Use: Command: Syntax: Return Value: Example: Finds named property and returns the name of the tab it is on. None GetTabTypeName(<propName>) Returns string. a = PropHost.GetTabTypeName( "W1"); returns "DefinitionParameterTab" for property W1 since it is on the DefinitionParams tab.
GetText
Use: Command: Syntax: Return Value: Example: Finds property in any tab and returns its value as a text string. None GetText(<propName>) Returns string. a = PropHost.GetText("C"); a contains "13pF"
Property Script Commands 7-17
GetValue
Use: Command: Syntax: Return Value: Example: Finds property in any tab and returns its value as a double. None GetValue(<propName>) Returns double. a = PropHost.GetValue("C") ;
Note
Values are returned in SI units. Compound SI units are, in general, not supported. Temperature values are returned in Celcius
PropertyExists
Use: Command: Syntax: Return Value: Example: Finds named property and returns its property type. None PropertyExists(<propName>) Returns 1 if property exists in any tab, 0 if it does not. a = PropHost.PropertyExists( "W1"); returns 1 since this property is present on DefinitionParams tab
RemoveProp
Use: Command: Syntax: Return Value: Example: Removes the named property from whichever tab it is found. None RemoveProp(<propName>) None. PropHost.RemoveProp("W1"); removes the property named W1 from whatever tab it is in
SetCallback
Use: Command: Syntax: Return Value: Example: Finds named property and sets its Callback script. None SetCallback(<propName>, <scriptName>) None. PropHost.SetCallback( "W1", "SynchronizeResistors"); sets the Callback script for property W1 to SynchronizeResistors
SetDescription
Use: Command: Syntax: Return Value: Example: Finds named property and sets its description text. None SetDescription(<propName>, <valueText>) None. PropHost.SetDescription( "W1", "this is the width of the gate"); sets the description for property W1 to "this is the width of the gate"
SetHidden
Use: Command: Syntax: Return Value: Example: Finds named property and sets its Hidden flag. None SetHidden(<propName>, <bool>) None. PropHost.SetHidden( "W1", 1); makes property W1 invisible in Property Window
SetReadOnly
Use: Command: Syntax: Return Value: Example: Finds named property and sets its ReadOnly flag. None SetReadOnly(<propName>, <bool>) None. PropHost.SetReadOnly( "W1", 1); makes property W1 readonly
SetText
Use: Command: Syntax: Return Value: Example: Finds property in any tab and sets its value to a text string. None SetText(<propName>, <valueText>) None. PropHost.SetText("C", "22nF"); sets C to 22nF
SetValue
Use: Command: Finds property in any tab and sets its value to a double. None
Property Script Commands 7-19
GetPropertyValue
Use: Note Gets the value of a single property. This can be executed by the oProject, oDesign, or oEditor variables. To view the expected format for the tab name and property name string arguments, use the script recording feature and edit a property using the interface, and then view the resulting script entry. None GetPropertyValue(<PropTab>, <PropServer>, <PropName>) String representing the property value. value_string = _ oEditor.GetPropertyValue("Geometry3DCmdTab",_ "Box1:CreateBox:1", "XSize")
SetPropertyValue
Use: Sets the value of one property. This is not supported for properties of the following types: ButtonProp, PointProp, V3DPointProp, and VPointProp. Only the ChangeProperty command can be used to modify these properties. This can be executed by the oProject, oDesign, or oEditor variables. To view the expected format for the tab name and property name string arguments, use the script recording feature and edit a property using the interface, and then view the resulting script entry or use GetPropertyValue. None SetPropertyValue <PropTab>, <PropServer>, <PropName>, <PropValue>
Property Script Commands 7-21
Note
Command: Syntax:
None <PropValue> Type: String Contains the value to set the property. The formatting is different depending on what type of property is being edited. Use GetPropertyValue for the desired property to see the expected format.
Example:
GetProperties
Use: Gets a list of all the properties belonging to a specific PropServer and PropTab. It can be executed by the oProject, oDesign, or oEditor variables. None GetProperties( <PropTab>, <PropServer>) Variant array of strings the properties belonging to the prop server. Dim all_props all_props = oDesign.GetProperties("MaxwellTab",_ "BoundarySetup:Source1")
GetVariableValue
Use: Command: Syntax: Return Value: Parameters: Gets the value of a single variable. To get the value of project variables, use oProject. To get the value of local variables, use oDesign. None GetVariableValue(<VarName>) A string representing the value of the variable. <VarName> Type: string Name of the variable to access. Example: Example: project_var_value_string = oProject.GetVariableValue("var_name") local_var_value_string = oDesign.GetVariableValue("var_name")
SetVariableValue
Use: Syntax: Return Value: Parameters: Sets the value of a variable. To set the value of a project variable, use oProject. To set the value of a local variable, use oDesign. SetVariableValue <VarName>, <VarValue> None <VarValue> Type: <value> New value for the variable. Example: oProject.SetVariableValue "$Var1", "3mm" var_value = "2Ohm" oDesign.SetVariableValue "Var2", var_value
GetVariables
Use: Returns a list of all defined variables. To get a list of Project variables, execute this command using oProject. To get a list of local variables, use oDesign. GetVariables() Variant array of strings the names of the variables. Dim var_array project_var_array = oProject.GetVariables() local_var_array = oDesign.GetVariables()
Dataset commands should be executed by the oProject object. Set oProject = oDesktop.SetActiveProject("Project1") oProject.CommandName <args>
AddDataset
Use: Command: Syntax: Return Value: Parameters: Adds a dataset. Project>Datasets>Add AddDataset <DatasetDataArray> None <DatasetDataArray> Array("NAME:<DatasetName>", Array("NAME:Coordinates", <CoordinateArray>, <CoordinateArray>, ...) <DatasetName> Type: <string> Name of the dataset. <CoordinateArray> Array("NAME:Coordinate", "X:=", <double>, "Y:=", <double>) Example: oProject.AddDataset Array("NAME:ds1",_ Array("NAME:Coordinates",_ Array("NAME:Coordinate", "X:=", 1, "Y:=", 2,_ Array("NAME:Coordinate", "X:=", 3, "Y:=", 4),_ Array("NAME:Coordinate", "X:=", 5, "Y:=", 7),_ Array("NAME:Coordinate", "X:=", 6, "Y:=", 20)))
EditDataset
Use: Command: Syntax: Return Value: Modifies a dataset. When a dataset is modified, its name and data can be changed. Project>Datasets>Edit EditDataset <OriginalName> <DatasetDataArray> None
Parameters:
Example:
oProject.EditDataset "ds1" Array("NAME:ds2",_ Array("NAME:Coordinates",_ Array("NAME:Coordinate", "X:=", 1, "Y:=", 2),_ Array("NAME:Coordinate", "X:=", 3, "Y:=", 4)))
DeleteDataset
Use: Command: Syntax: Return Value: Parameters: Deletes the specified dataset. Project>Datasets>Remove DeleteDataset <DatasetName> None <DatasetName> Type: <string> Name of the dataset you want to delete.
Design object commands should be executed by the oDesign object. Set oDesign = oProject.SetActiveDesign("Mawell3DDesign1") oDesign.CommandName <args>
Boundary module: "BoundarySetup" Mesh Operations module: "MeshSetup" Analysis module: "AnalysisSetup" Optimetrics module: "Optimetrics" Solutions module: "Solutions" Field Overlays module: "FieldsReporter"
GetName GetModule SetDesignSettings DeleteVariation SetSolutionType SetActiveEditor Solve Undo Redo RenameDesignInstance ApplyMeshOps EditNotes AnalyzeAll (Maxwell menu) AnalyzeAllNominal Analyze AnalyzeDistributed SetConductivityThreshold ExportConvergence GetVariationVariableValue ExportMeshStats ExportProfile GetNominalVariation Is2D Is3D GetOutputVariableValue, AddOutputVariable, EditOutputVariable, DeleteOutputVariable ChangeProperty, GetPropertyValue, SetPropertyValue, GetProperties, GetVariableValue, SetVariableValue, GetVariables CreateReport, RemoveReport, GetReportNames AddDataset, EditDataset, DeleteDataset
GetName (Design)
Use: Command: Syntax: Return Value: Returns the name of the design. None GetName The name of the design. Type: <string>
Design Object Script Commands 9-3
Parameters: Example:
GetModule
Use: Command: Syntax: Return Value: Parameters: Returns the IDispatch for the specified module. None GetModule <ModuleName> Module object. <ModuleName> Type: <string> Name of the module. One of the following: -Boundary module: "BoundarySetup" -Mesh Operations module: "MeshSetup" -Reduce Matrix module: "ReduceMatrix" -Analysis module: -Solutions module: Example: "AnalysisSetup" "Optimetrics" "Solutions" -Optimetrics module:
SetDesignSettings
Use: Command: Syntax: Return Value: Parameters: Sets design settings for the active design. Settings vary with solution type. Click Maxwell3d>Design Settings, Maxwell2D>Design Setings, or rightclick a design instance in the project tree and select Design Settings. SetDesignSettings <DesignSettingsArray> None. <DesignSettingsArray> For 3D Transient solution type: Array(NAME:Design Settings Data, "Allow Material Override:=", <bool>, "PreservTranSolnAfterDatasetEdit:=", <bool>, "ComputeTransientInductance:=", <bool> "PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>, "EnableTranTranLinkWithSimplorer:=", <bool>,
9-4 Design Object Script Commands
"Multiplier:=", <int>) For 3D Magnetostatic solution type: Array(NAME:Design Settings Data, "Allow Material Override:=", <bool>, "ComputeIncrementalMatrix:=", <bool>, "PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>) For 3DEddy Current solution type: Array(NAME:Design Settings Data, "Allow Material Override:=", <bool>, "PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>) For 3D Electrostatic solution type: Array(NAME:Design Settings Data, "Allow Material Override:=", <bool>, "PreservTranSolnAfterDatasetEdit:=", <bool>, "PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>, "EnableTranTranLinkWithSimplorer:=", <bool>, "Multiplier:=", <int>) For 3D DC Conduction solution type: Array(NAME:Design Settings Data, "Allow Material Override:=", <bool>, "PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>) For 3D Electric Transient solution type: Array(NAME:Design Settings Data, "Allow Material Override:=", <bool>, "PreservTranSolnAfterDatasetEdit:=", <bool>, "PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>) For 2D Transient solution type: Array(NAME:Design Settings Data, "PreserveTranSolnAfterDatasetEdit:=", <bool>, "ComputeTransientInductance:=", <bool>,
Design Object Script Commands 9-5
"PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>, "EnableTranTranLinkWithSimplorer:=", <bool>, "BackgroundMaterialName:=", <string> "Multiplier:=", <int>) For 2D Magnetostatic solution type: Array(NAME:Design Settings Data, "PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>, "ComputeIncrementalMatrix:=", <bool>, "BackgroundMaterialName:=", <string>) For 2D Eddy Current, Electrostatic, DC Conduction, and AC Conduction solution types: Array(NAME:Design Settings Data, "PerfectConductorThreshold:=", <real>, "InsulatorThreshold:=", <real>, "BackgroundMaterialName:=", <string>)
DeleteVariation
Use: Command: Syntax: Return Value: Parameters: Delete the matrix, field, and/or mesh solution data for specific variations, across all solutions. Maxwell3D or Maxwell2D>Results>Clean Up Solutions DeleteVariation <VariationArray>, <FullVariations>, <MeshAndFieldsOnly>, <FieldsOnly> None <VariationArray> Array(<DesignVariationKey>, <DesignVariationKey>,...) Parameters: <DesignVariationKey> Type: <string> Design variation string <FullVariations> Type: <bool> Whether to delete meshes, fields, matrix data, profile, and convergence data. <MeshAndFieldsOnly>
9-6 Design Object Script Commands
Type: <bool> Whether to delete only meshes and fields. <FieldsOnly> Type: <bool> Whether to delete fields only. Example: oDesign.DeleteVariation Array("width='2in'",_ "width='2.5in'"), TRUE, FALSE, FALSE
SetSolutionType
Use: Command: Syntax: Return Value: Parameters: Sets the solution type for the design. Click Maxwell3D>Solution Type, Maxwell2D>Solution Type, or right-click a design instance in the project tree and select Solution Type. SetSolutionType <SolutionType>, <GeomMode> None <SolutionType> Type: <string> Possible values for 3D designs are: "Magnetostatic", "EddyCurrent", "Transient", "Electrostatic", "DCConduction", "ElectroDCConduction", "ElectricTransient" Possible values for 2D designs are: "Magnetostatic", "EddyCurrent", "Transient", "Electrostatic", "DCConduction", "ACConduction" <GeomMode> Type: <string> Possible values for 2D geometry mode: "XY", "about Z" Example: oDesign.SetSolutionType "ElectroDCConduction" oDesign.SetSolutionType "Electrostatic", "XY" oDesign.SetSolutionType "EddyCurrent", "about Z" Sets the active editor. None SetActiveEditor(<EditorName>) Editor object <EditorName> Type: <string> Predefined editor name.
Design Object Script Commands 9-7
SetActiveEditor
Use: Command: Syntax: Return Value: Parameters:
Example:
Solve
Use: Command: Syntax: Return Value: Performs a blocking simulation. The next script command will not be executed until the simulation is complete. Maxwell3D or Maxwell2D>Analyze. Or right-click the Analysis option in the project tree and choose "Analyze". Solve <SetupNameArray> Type: <int> -1: command execution error 1: simulation error 0: normal completion Parameters: <SetupNameArray>: Array(<SetupName>, <SetupName>, ...) <SetupName> Type: <string> Name of the solution setup to solve. Example: return_status = oDesign.Solve Array(Setup1, Setup2)
Undo (Design)
Use: Command: Syntax: Return Value: Example: Cancels the last design-level command. Edit>Undo Undo None oDesign.Undo
Redo (Design)
Use: Command: Syntax: Return Value: Example: Reapplies the last design-level command. Edit>Redo Redo None oDesign.Redo
RenameDesignInstance
Use: Renames a design instance.
Right-click a design instance in the project tree, and then click Rename on the shortcut menu. RenameDesignInstance <OldName>, <NewName> None <OldName> Type: <string> Old design name. <NewName> Type: <string> New design name.
Example:
oDesign.RenameDesignInstance "Maxwell2DDesign1",_ "MaxwellDesign2" If there are any mesh seed operations that were defined and not yet simulated in the current variation for the specified solve setups, this command applies them to modify the current mesh. If necessary, the command computes an initial mesh first. No further simulating is done. Click Maxwell3D or Maxwell2D>Analysis Setup>Apply Mesh Operations, or right-click the Analysis folder in the project tree and select Apply Mesh Operations. ApplyMeshOps <SetupNameArray> Type: <int> -1: completed with error 0: completed successfully
ApplyMeshOps
Use:
Command:
Parameters:
<SetupNameArray > Array(<SetupName1>, < SetupName 2>,...) <SetupName> Type: <string> Name of the solution setup on which to apply the mesh.
Example:
oDesign.ApplyMeshOps Array("Setup1","Setup2")
EditNotes
Use: Command: Syntax: Return Value: Edits design notes. Click Maxwell>Edit Notes, or right-click a design instance in the project tree and select Edit Notes. EditNotes <DesignNotes> None
Design Object Script Commands 9-9
Parameters:
Example:
AnalyzeAllNominal
Use: Command: Syntax: Return Value: Parameters: Example: Analyzes the nominal problems for all the setups under the design. Right-click the Analysis folder in the project tree, and select Analyze. AnalyzeAllNominal None None oDesign.AnalyzeAllNominal
Analyze
Use: Command: Syntax: Return Value: Parameters: Analyzes the nominal problem for the designated setup under the design. Right-click the solve setup, and select Analyze. Analyze <SetupName> None <SetupName> Type: <string> Name of the solution setup to solve. Example: oDesign.Analyze "Setup1"
AnalyzeDistributed
Use: Performs a distributed analysis.
Right-click Analysis setup (or Parametrics setup), and select Distribute Analysis. AnalyzeDistributed <SetupName> <AnalysisStatus> Type: <int> -1: completed with error 0: completed successfully
Parameters: Example:
SetConductivityThreshold
Use: Command: Syntax: Return Value: Parameters: Sets the thresholds for a perfect conductor and an insulator/conductor. Maxwell>Set Material Thresholds or right click on design instance in project tree and choose "Set Material Thresholds" SetConductivityThreshold <PerfectConductorThreshold> <Insulator/ConductorThreshold> None <PerfectConductorThreshold> Type: <double> Perfect conductor threshold <Insulator/ConductorThreshold> Type: <double> Insulator/conductor threshold Example: oDesign.SetConductivityThreshold 1E+030, 1.00
ExportConvergence
Use: Command: Syntax: Return Value: Parameters: Exports convergence data to file for the given variation. None ExportConvergence <SetupName>, <VariationString>, <FilePath> None <SetupName> Type: <string> Example: "Setup1" <VariationString>
Design Object Script Commands 9-11
Type: <string> Example: "radius = 3mm" The empty variation string ("") is interpreted to mean the current nominal variation. <FilePath> Type: <string> Example: "c:\convergence.conv" overwriteIfExists <Boolean> Type: <string> Example: overwriteIfExists=TRUE If "overwriteIfExists" is TRUE, then the playback of the script overwrites an existing file. If FALSE, it does not. The default is "TRUE". Example: oDesign.ExportConvergence "Setup1", "x_size = 2mm", "c:\convergence.conv"
GetVariationVariableValue
Use: Command: Syntax: Return Value: Parameters: Finds the value of a variable for a specific variation string. None GetVariationVariableValue(<VariationString>, <VariableName>) Returns a double precision value in SI units, interpreted to mean the value of the variable contained in the variation string. <VariationString> Type: string <VariableName> Type: string Example: Example: varval = oDesign.GetVariationVariableValue("x_size = 2mm y_size = 1mm", "y_size")
ExportMeshStats
Use: Command: Parameters: Exports the mesh statistics to a file. None. <SetupName> Type: <string>
9-12 Design Object Script Commands
Example: "Setup1 " <VariationString> Type: <string> Example: "radius = 3mm" The empty variation string ("") is interpreted to mean the current nominal variation. <FilePath> Type: <string> Example: "c:\convergence.conv" overwriteIfExists <Boolean> Type: <string> Example: overwriteIfExists=TRUE If "overwriteIfExists" is TRUE, then the playback of the script overwrites an existing file. If FALSE, it does not. The default is "TRUE". Example: oDesign.ExportMeshStats "Setup1", "offset=" & Chr(39) & "0.09in" & Chr(39) & "","C:\mydir\meshstats.ms" "tat"
ExportProfile
Use: Syntax: Return Value: Parameters: Exports a solution profile to file. ExportProfile <SetupName>, <VariationString>, <FilePath> None <SetupName> Type: <string> Example: "Setup1" <VariationString> Type: <string> Example: "radius = 3mm" The empty variation string ("") is interpreted to mean the current nominal variation. <FilePath> Type: <string> Example: "c:\profile.prof" overwriteIfExists <Boolean> Type: <string> Example: overwriteIfExists=TRUE
Design Object Script Commands 9-13
If "overwriteIfExists" is TRUE, then the playback of the script overwrites an existing file. If FALSE, it does not. The default is "TRUE". Example: oDesign.ExportProfile "Setup1", "", "c:\profile.prof"
GetNominalVariation
Use: Command: Syntax: Return Value: Parameters: Example: Gets the nominal variation string None GetNominalVariation() Returns a string representing the nominal variation None var = oDesign.GetNominalVariation()
Is2D
Use: Command: Syntax: Return Value: Parameters: Example: Determines if the current design is 2D. None Is2D Boolean True if the design is 2D. None oDesign.Is2D
Is3D
Use: Command: Syntax: Return Value: Parameters: Example: Determines if the current design is 3D. None Is3D Boolean True if the design is 3D. None oDesign.Is3D
10
The Output variable commands should be executed by the "OutputVariable" module. First obtain the output variable module from oDesign and use it for outputvariable commands. Set oModule = oDesign.GetModule("OutputVariable") oModule.CommandName <args> The old output variable commands are still supported but they are deprecated and produce a warning in the message window. The old Output variable commands were executed by the oModule object. Set oDesign = Project.SetActiveDesign("MaxwellModel1") oDesign.CommandName <args>
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. Maxwell3D>Results>Output Variables, Maxwell2D>Results>Output Variables, or RMxprt>Results>Output Variables. CreateOutputVariable <OutputVarName>, <Expression>, <SolutionName>, <ReportTypeName>, <simValueContext> None <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
10-2 Output Variable Script Commands
Example:
Set oModule = oDesign.GetModule("OutputVariable") oModule.CreateOutputVariable "magforce", "mag(Force1.Force_x)", _ "Setup1 : LastAdaptive", "Magnetostatic", Array()
EditOutputVariable
Use: Syntax: Change the name or expression of an existing output variable. EditOutputVariable <OrigVarName>, <NewExpression>, <NewVarName>, <SolutionName>, <ReportTypeName>, <SimValueContext> Provide empty quotes as the NewVarName or NewExpression if it should not be changed. Return Value: Parameters: None <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",
Output Variable Script Commands 10-3
Array()
DeleteOutputVariable
Use: Command: Syntax: Return Value: Parameters: Delete an existing output variable. The variable can only be deleted if it is not being used by any traces. Delete button on the Output Variables dialog. DeleteOutputVariable <VarName> None <VarName> Type: <string> Name of the output variable. Example: Set oModule = oDesign.GetModule("OutputVariable") oModule.DeleteOutputVariable "magforce"
DoesOutputVariableExist
Use: Syntax: Return Value: Parameters: Determines whether a specified output variable exists. DoesOutputVariableExist <OutputVarName> Boolean <OutputVarName> Type: <string> Name of the output variable. Example: OutputVarmagforceExists = oDesign.DoesOutputVariableExist(magforce)
GetOutputVariables
Use: Syntax: Return Value: Parameters: Example: Gets a list of output variables. GetOutputVariables An array of output variable names. None 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>) Double value of the output variable. <OutputVarName> Type: <string> Original name of the variable <Variation> Type: <string> A set of variable, value pairs to use when evaluating the output expression. If no variables are present, a null string must be used.The EddyCurrent 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. Note If the Output Variable is based upon a field quantity, then the ReportTypeName must be set to "Fields".
<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 Variable. Note these values when using the dialog box to create the Output
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
Modeler commands should be executed by the 3D Modeler editor. Set oEditor = oDesign.SetActiveEditor("3D Modeler") oEditor.CommandName <args>
Example: "Flags:=", "NonModel#Wireframe" Color Format is a string containing an R,G,B triple formatted as "(R G B)". Example: "Color:=", "(255 Transparency Specify a number between 0 and 1. PartCoordinateSystem Orientation of the primitive. Specify the name of one of the defined coordinate systems. <SelectionsArray> Array("NAME:Selections", "Selections:=", <string>) Selections Comma-separated list of parts on which to perform the operation. Example: "Selections:=", "Rect1, Rect2" 255 255)"
CreateBondwire CreateBox CreateCircle CreateCone CreateCutplane CreateCylinder CreateEllipse CreateHelix CreatePoint CreateUserDefinedPart CreatePolyline CreateRectangle CreateRegularPolyhedron CreateRegularPolygon CreateSphere CreateSpiral CreateTorus DeletePolylinePoint EditPolyline InsertPolylineSegment PurgeHistory SweepAlongPath SweepAlongVector SweepAroundAxis
CreateBondwire
Use: Command: Syntax: Return Value: Parameters: Creates a bondwire primitive. Draw>Bondwire CreateBondwire <ParametersArray>, <AttributesArray> None <ParametersArray> Array("NAME:BondwireParameters", "WireType:=", <string>,
3D Modeler Editor Script Commands 11-3
"WireDiameter:=", <value>, "NumSides:=", <value>, "XPadPos:=", <value>, "YPadPos:=", <value>, "ZPadPos:=", <value>, "XDir:=", <value>, "YDir:=", <value>, "ZDir:=", <value>, "Distance:=", <value>, "h1:=", <value>, "h2:=", <value>, "alpha:=", <value>, "beta:=", <value>, "WhichAxis:=", <string>) WireType Should be one of: "JEDEC_4Points", "JEDEC_5Points" Example: "WireType:=", "JEDEC_4Points" WhichAxis Axis normal to the plane where the wire is drawn. sible values are: "X", "Y", "Z" Pos-
Example: "WhichAxis:=", "Z" means the bond wire will be drawn on the XY plane.
CreateBox
Use: Command: Syntax: Return Value: Parameters: Creates a box primitive. Draw>Box CreateBox <BoxParametersArray>, <AttributesArray> None <BoxParametersArray> Array("NAME:BoxParameters", "XPosition:=", <value>, "YPosition:=", <value>, "ZPosition:=", <value>, "XSize:=",<value>, "YSize:=",<value>, "ZSize:=",<value>)
11-4 3D Modeler Editor Script Commands
Example:
Set oEditor = oDesign.SetActiveEditor("3D Modeler") oEditor.CreateBox Array("NAME:BoxParameters", _ "CoordinateSystemID:=", -1, "XPosition:=", _ "1mm", "YPosition:=", "1mm", "ZPosition:=", "0mm", _ "XSize:=", "1mm", "YSize:=", "1mm", "ZSize:=", "1mm"),_ Array("NAME:Attributes", "Name:=", "Box1", "Flags:=", "", _"Color:=", "(132 132 193)", "Transparency:=", 0, _ "PartCoordinateSystem:=", "Global", "MaterialName:=", "vacuum", "SolveInside:=", true)_ oEditor.DuplicateAlongLine Array("NAME:Selections", "Selections:=", "Box1"), _ Array("NAME:DuplicateToAlongLineParameters",_ "CoordinateSystemID:=", -1, "CreateNewObjects:=", true, _ "XComponent:=", "1mm", "YComponent:=", "1mm", "ZComponent:=", _ "0mm", "NumClones:=", "2"), _ Array("NAME:Options", "DuplicateBoundaries:=", true) _
CreateCircle
Use: Command: Syntax: Return Value: Parameters: Creates a circle primitive. Draw>Circle CreateCircle <CircleParametersArray>, <AttributesArray> None <CircleParametersArray> Array("NAME:CircleParameters", "XCenter:=", <value>, "YCenter:=", <value>, "ZCenter:=", <value>, "Radius:=", <value>, "WhichAxis:=", <string>) WhichAxis Axis of the normal vector to the circle. Possible values are: "X", "Y", "Z" Example: "WhichAxis:=", "Z" means the circle will be drawn in the XY plane.
CreateCone
Use: Command: Syntax: Return Value: Parameters: Creates a cone primitive. Draw>Cone CreateCone <ConeParametersArray>, <AttributesArray> None <ConeParametersArray> Array("NAME:ConeParameters", "XCenter:=", <value>, "YCenter:=", <value>, "ZCenter:=", <value>, "WhichAxis:=", <string>, "Height:=", <value>, "BottomRadius:=", <value>, "TopRadius:=", <value>) WhichAxis Axis of the cone. Possible values are: "X", "Y", "Z" Example: "WhichAxis:=", "Z"
CreateCutplane
Use: Command: Syntax: Return Value: Parameters: Creates a cutplane. Only the name and color attributes from <AttributesArray> are supported. Draw>Plane CreateCutplane <CutplaneParametersArray>, <AttributesArray> None <CutplaneParametersArray> Array("NAME:PlaneParameters", "PlaneBaseX:=", <value>, "PlaneBaseY:=", <value>, "PlaneBaseZ:=", <value>, "PlaneNormalX:=", <value>, "PlaneNormalY:=", <value>), "PlaneNormalZ:=", <value>)
CreateCylinder
Use: Command: Syntax: Return Value: Parameters: Creates a cylinder primitive. Draw>Cylinder CreateCylinder <CylinderParametersArray>, <AttributesArray> None <CylinderParametersArray> Array("NAME:CylinderParameters", "XCenter:=", <value>, "YCenter:=", <value>, "ZCenter:=", <value>, "Radius:=", <value>, "Height:=", <value>, "WhichAxis:=", <string>) WhichAxis Axis of the cylinder. Possible values are:"X", "Y", "Z" Example: "WhichAxis:=", "Z"
CreateEllipse
Use: Command: Syntax: Return Value: Parameters: Creates an ellipse primitive. Draw>Ellipse CreateEllipse <EllipseParametersArray>, <AttributesArray> None <EllipseParametersArray> Array("NAME:EllipseParameters", "XCenter:=", <value>, "YCenter:=", <value>, "ZCenter:=", <value>, "MajRadius:=", <value>, "Ratio:=", <value>, "WhichAxis:=", <string>) WhichAxis Axis of the normal vector to the ellipse. Possible values are: "X", "Y", "Z" Example: "WhichAxis:=", "Z" means the ellipse is drawn in the XY plane.
3D Modeler Editor Script Commands 11-7
CreateHelix
Use: Command: Syntax: Return Value: Parameters: Creates a helix by sweeping the specified 2D objects. Draw>Helix CreateHelix <SelectionsArray>, <HelixParametersArray> None <SelectionsArray> Array("NAME:Selections", "Selections:=", <string>) Selections Comma-separated list of parts to sweep. Example: "Selections:=", "Rect1, Rect2" <HelixParametersArray> Array("NAME:HelixParameters", "XCenter:=", <value>, "YCenter:=", <value>, "ZCenter:=", <value>, "XStartDir:=", <value>, "YStartDir:=", <value>, "ZStartDir:=", <value>, "Thread:=", <value>, "NumThread:=", <value>, "RightHand:=", <bool>)
CreatePoint
Use: Command: Syntax: Return Value: Parameters: Creates a point. Only the name and color attributes from <AttributesArray> are supported. Draw>Point CreatePoint <PointParametersArray>, <AttributesArray> None <PointParametersArray> Array(NAME:PointParameters, "PointX:=", <value>, "PointY:=", <value>, "PointZ:=", <value>)
CreateUserDefinedPart
Use: Command: Syntax: Return Value: Parameters: <UserDefinedParametersArray> Array("NAME:UserDefinedPrimitiveParameters", CoordinateSystemID:=", <value>, "DllName:=", <string>, "Library:=", <string>, Array("NAME:ParamVector", Array("NAME:Pair", "Name:=", <string>, "Value:=", <value>)) Example: oEditor.CreateUserDefinedPart Array("NAME:UserDefinedPrimitiveParameters",_ "CoordinateSystemID:=", -1, "DllName:=",_ "Examples/RectangularSpiral", "NoOfParameters:=", 6,_ "Library:=", "syslib", Array("NAME:ParamVector",_ Array("NAME:Pair", "Name:=", "Xpos", "Value:=", "0mm"),_ Array("NAME:Pair", "Name:=", "Ypos", "Value:=", "0mm"),_ Array("NAME:Pair", "Name:=", "TurnSep", "Value:=", "5mm"),_ Array("NAME:Pair", "Name:=", "Turns", "Value:=", "2"),_ Array("NAME:Pair", "Name:=", "Width", "Value:=", "2mm"),_ Array("NAME:Pair", "Name:=", "Height", "Value:=", "2mm"))),_ Array("NAME:Attributes", "Name:=", "RectangularSpiral1",_ "Flags:=", "", "Color:=", "(132 132 193)", "Transparency:=", _ 0, "PartCoordinateSystem:=", "Global", "MaterialName:=",_ "copper", "SolveInside:=", false) Creates a user-defined part. Draw>User Defined Primitive CreateUserDefinedPart <UserDefinedParametersArray>, <AttributesArray> None
CreatePolyline
Use: Command: Syntax: Creates a polyline primitive. Draw>Polyline CreatePolyline <PolylineParametersArray>,
3D Modeler Editor Script Commands 11-9
<AttributesArray> Return Value: Parameters: None <PolylineParametersArray> Array("NAME:PolylineParameters", "IsPolylineCovered:=", <bool>, "IsPolylineClosed:=", <bool>, <PolylinePointsArray>, <PolylineSegmentsArray>) <PolylinePointsArray> Array("NAME:PolylinePoints", <OnePointArray>, <OnePointArray>, ...) <OnePointArray> Array("NAME:PLPoint", "X:=", <value>, "Y:=", <value>, Z:=", <value>)) <PolylineSegmentsArray> Array("NAME:PolylineSegments", <OneSegmentArray>, <OneSegmentArray>, ...) <OneSegmentArray> Array("NAME:PLSegment", "SegmentType:=", <string>, "StartIndex:=", <value>, "NoOfPoints:=", <value>) SegmentType Can be "Line", "Arc", "Spline", or "AngularArc"
CreateRectangle
Use: Command: Syntax: Return Value: Parameters: Creates a rectangle primitive. Draw>Rectangle CreateRectangle <RectangleParametersArray>, <AttributesArray> None <RectangleParametersArray> Array("NAME:RectangleParameters",
11-10 3D Modeler Editor Script Commands
"XStart:=", <value>, "YStart:=", <value>, "ZStart:=", <value>, "Width:=", <value>, "Height:=", <value>, "WhichAxis:=", <string>) WhichAxis Axis of the normal vector to the rectangle. Possible values for 3D Designs are: "X", "Y", "Z". For 2D XY Designs "Whichaxis:=" should be set to "Z". For 2D RZ Designs "Whichaxis:=" should be set to "Y". Example: "WhichAxis:=", "Z" means the rectangle will be drawn in the XY plane.
CreateRegularPolyhedron
Use: Command: Syntax: Return Value: Parameters: Creates a regular polyhedron primitive. Draw>Regular Polyhedron CreateRegularPolyhedron <PolyhedronParametersArray>, <AttributesArray> None <PolyhedronParametersArray> Array("NAME:PolyhedronParameters", "XCenter:=", <value>, "YCenter:=", <value>, "ZCenter:=", <value>, "XStart:=", "YStart:=", "ZStart:=", "Height:=", <value>, <value>, <value>, <value>,
"NumSides:=", <value>, "WhichAxis:=", <string>) NumSides: Specify a number greater than 2. WhichAxis Axis of the polyhedron. Possible values for 3D Designs are: "X", "Y", "Z"
3D Modeler Editor Script Commands 11-11
For 2D XY Designs "Whichaxis:=" should be set to "Z". For 2D RZ Designs "Whichaxis:=" should be set to "Y". Example: "WhichAxis:=", "Z"
CreateRegularPolygon
Use: Command: Syntax: Return Value: Parameters: Creates a regular polygon primitive. Draw>Regular Polygon CreateRegularPolygon <PolygonParametersArray>, <AttributesArray> None <PolygonParametersArray> Array("NAME:RegularPolygonParameters", "XCenter:=",<value>, "YCenter:=",<value>, "ZCenter:=",<value>, "XStart:=", <value>, "YStart:=", <value>, "ZStart:=", <value>, "NumSides:=", "12", "WhichAxis:=", <string>) NumSides Specify a number greater than 2. WhichAxis Axis of normal vector to the polygon. Possible values for 3D Designs are: "X", "Y", "Z" For 2D XY Designs "Whichaxis:=" should be set to "Z". For 2D RZ Designs "Whichaxis:=" should be set to "Y". Example: "WhichAxis:=", "Z" means the polygon will be drawn in the XY plane.
CreateSphere
Use: Command: Syntax: Return Value: Parameters: Creates a sphere primitive. Draw>Sphere CreateSphere <SphereParametersArray>, <AttributesArray> None <SphereParametersArray>
CreateSpiral
Use: Command: Syntax: Return Value: Parameters: Creates a spiral by sweeping the specified 2D objects. Draw>Spiral CreateSpiral <SelectionsArray>, <SpiralParametersArray> None <SelectionsArray> Array("NAME:Selections", "Selections:=", <string>) Selections Comma-separated list of parts to sweep. Example: Selections:=, Rect1, Rect2 <SpiralParametersArray> Array("NAME:SpiralParameters", "XCenter:=", <value>, "YCenter:=", <value>, "ZCenter:=", <value>, "XStartDir:=", <value>, "YStartDir:=", <value>, "ZStartDir:=", <value>, "NumThread:=", <value>, "RightHand:=", <bool>, "RadiusIncrement:=", <value>)
CreateTorus
Use: Command: Syntax: Return Value: Parameters: Creates a torus primitive. Draw>Torus CreateTorus <TorusParametersArray>, <AttributesArray> None <TorusParametersArray> Array("NAME:TorusParameters", "XCenter:=", <value>, "YCenter:=", <value>, "ZCenter:=", <value>,
3D Modeler Editor Script Commands 11-13
"MajorRadius:=", <value>, "MinorRadius:=", <value>, "WhichAxis:=", <string>) WhichAxis Axis of the torus. Possible values are: "X", "Y", "Z" Example: "WhichAxis:=", "Z"
EditPolyline
Use: Command: Modifies a polyline primitive. Specify the name of the polyline to modify and the new set of data for the polyline. Draw>Line Segment>Insert Segment Before>Straight Draw>Line Segment>Insert Segment Before>Spline Draw>Line Segment>Insert Segment Before>3 Point Arc Draw>Line Segment>Insert Segment Before>Center Point Arc Draw>Line Segment>Insert Segment After>Straight Draw>Line Segment>Insert Segment After>Spline Draw>Line Segment>Insert Segment After>3 Point Arc Draw>Line Segment>Insert Segment After>Center Point Arc Syntax: Return Value: Parameters: EditPolyline <SelectionsArray>, <PolylineParametersArray>, None <SelectionsArray> Array("NAME:Selections", "Selections:=", "string") Selections Name of the polyline to modify. The name should be formatted as "<PolylineName>:CreatePolyline:1". Example: "Selections:=", "Polyline1:CreatePolyline:1"
InsertPolylineSegment
Use: Command: Inserts a polyline segment either before or after an existing segment of a polyline primitive. Draw>Line Segment>Insert Segment Before>Straight Draw>Line Segment>Insert Segment Before>Spline Draw>Line Segment>Insert Segment Before>3 Point Arc Draw>Line Segment>Insert Segment Before>Center Point Arc Draw>Line Segment>Insert Segment After>Straight
11-14 3D Modeler Editor Script Commands
Draw>Line Segment>Insert Segment After>Spline Draw>Line Segment>Insert Segment After>3 Point Arc Draw>Line Segment>Insert Segment After>Center Point Arc Syntax: Return Value: Parameters: InsertPolylineSegment <InsertPolylineSegmentArray> None <InsertPolylineSegmentArray> Array("Name:Insert Polyline Segment", "Selections:=", <string>, "Segment Index:=", <value>, "At Start:=", <bool>, "SegmentType:=", <string> <PolylinePointsArray>) <PolylinePointsArray> Array("Name:Polyline Points", <OnePointArray>, <OnePointArray>, ...) <OnePointArray> Array("Name:PLPoint", "X:=", <value>, "Y:=", <value>, "Z:=", <value>) Selections Name of the polyline to modify. The name should be formatted as "<PolylineName>:CreatePolyline:1". Example: "Selections:=", "Polyline1:CreatePolyline:1" SegmentType Can be "Line", "Arc", "Spline", or "AngularArc"
PurgeHistory
Use: Command: Syntax: Purges the construction history of the selected object. For complex objects this simplifies the object and can improve modeler speed. Modeler>Purge History PurgeHistory <PurgeHistoryArray>
3D Modeler Editor Script Commands 11-15
None <PurgeHistoryArray> Array(Name:Selections, Selections:=, <string>, NewPartsModelFlag:=, <string>) Selections Name of the object to purge. NewPartsModelFlag Flag to indicate model properties, Model or NonModel.
Example:
DeletePolylinePoint
Use: Command: Syntax: Return Value: Parameters: Deletes either a start or end point from an existing polyline segment. Edit>Delete Start Point Edit>Delete End Point DeletePolylinePoint <DeletePointArray> None <DeletePointArray> Array(Name:Delete Point, Selections:=, <string>, Segment Index:=, <value>, At Start:=, <bool>) Selections Name of the polyline to modify. The name should be formatted as <PolylineName>:CreatePolyline:1. Example: Selections:=, Polyline1:CreatePolyline:1
SweepAlongPath
Use: Command: Syntax: Return Value: Sweeps the specified 1D or 2D parts along a path. The last 1D object specified identifies the path for the sweep. Draw>Sweep>Along Path SweepAlongPath <SelectionsArray>, <PathSweepParametersArray> None
Parameters:
<PathSweepParametersArray> Array("NAME:PathSweepParameters", "DraftAngle:=", <value>, "DraftType:=", <string>, "TwistAngle:=", <value>) DraftType Possible values are "Extended", "Round", "Natural"
Example:
oEditor.SweepAlongPath _ Array("NAME:Selections", "Selections:=",_ "Polygon1,Polyline1"),_ Array("NAME:PathSweepParameters", _ "DraftAngle:=", "0deg",_ "DraftType:=", "Round",_ "TwistAngle:=", "30deg")
SweepAlongVector
Use: Command: Syntax: Return Value: Parameters: Sweeps the specified 1D or 2D parts along a vector. Draw>Sweep>Along Vector SweepAlongVector <SelectionsArray>, <VecSweepParametersArray> None <VecSweepParametersArray> Array("NAME:VectorSweepParameters", "DraftAngle:=", <value>, "DraftType:=", <string>, "SweepVectorX:=", <value>, _ "SweepVectorY:=", <value>, "SweepVectorZ:=", <value) DraftType Possible values are "Extended", "Round", "Natural"
SweepAroundAxis
Use: Command: Syntax: Sweeps the specified 1D or 2D parts around an axis. Draw>Sweep>Around Axis SweepAroundAxis <SelectionsArray>,
3D Modeler Editor Script Commands 11-17
<AxisSweepParametersArray> Return Value: Parameters: None <AxisSweepParametersArray> Array("NAME:AxisSweepParameters", "DraftAngle:=", <value>, "DraftType:=", <string>, "SweepAxis:=", <string>, "SweepAngle:=", <value>) DraftType Possible values are "Extended", "Round", "Natural" SweepAxis Possible values are "X", "Y", "Z"
Copy DuplicateAlongLine DuplicateAroundAxis DuplicateMirror Mirror Move OffsetFaces Paste Rotate Scale
Copy
Use: Command: Syntax: Return Value: Copies specified parts. Edit>Copy Copy <SelectionsArray> None
DuplicateAlongLine
Use: Command: Syntax: Return Value: Parameters: Duplicates specified parts along a line. Edit>Duplicate>Along Line DuplicateAlongLine <SelectionsArray>, <DupLineParametersArray> None <DupLineParametersArray> Array("NAME:DuplicateToAlongLineParameters", "XComponent:=", <value>, "YComponent:=", <value>, "ZComponent:=", <value>, "NumClones:=", <value>) NumClones Specify a number greater than 1.
DuplicateAroundAxis
Use: Command: Syntax: Return Value: Parameters: Duplicates specified parts around an axis. Edit>Duplicate>Around Axis DuplicateAroundAxis <SelectionsArray>, <DupAxisParametersArray> None <DupAxisParametersArray> Array("NAME:DuplicateAroundAxisParameters", "WhichAxis:=", <string>, "AngleStr:=", <value>, "NumClones:=",<value>) WhichAxis Axis to duplicate around. Possible values for 3D Designs are: "X", "Y", "Z". For 2D XY Designs, "Whichaxis:=" should be set to "Z". For 2D RZ Designs, "Whichaxis:=" should be set to "Y". Example: "WhichAxis:=", "Z" NumClones: Specify a number greater than 1.
DuplicateMirror
Use: Command: Syntax: Return Value: Parameters: Duplicates specified parts according to a mirror plane. Edit>Duplicate>Mirror DuplicateMirror <SelectionsArray>, <DupMirrorParametersArray> None <DupMirrorParametersArray> Array("NAME:DuplicateToMirrorParameters", "DuplicateMirrorBaseX:=", <value>, "DuplicateMirrorBaseY:=", <value>, "DuplicateMirrorBaseZ:=", <value>, "DuplicateMirrorNormalX:=", <value>, "DuplicateMirrorNormalY:=", <value>, "DuplicateMirrorNormalZ:=", <value>)
11-20 3D Modeler Editor Script Commands
For 2D XY Designs, Z parameters should be set to "0". For 2D RZ Designs, Y parameters should be set to "0".
Mirror
Use: Command: Syntax: Return Value: Parameters: Mirrors specified parts. Edit>Arrange>Mirror Mirror <SelectionsArray>, <MirrorParametersArray> None <MirrorParametersArray> Array("NAME:MirrorParameters", "MirrorBaseX:=", <value>, "MirrorBaseY:=", <value>, "MirrorBaseZ:=", <value>, "MirrorNormalX:=", <value>, "MirrorNormalY:=", <value>, "MirrorNormalZ:=", <value>)
Move
Use: Command: Syntax: Return Value: Parameters: Moves specified parts. Edit>Arrange>Move Move <SelectionsArray>, <MoveParametersArray> None <MoveParametersArray> Array("NAME:TranslateParameters", "TranslateVectorX:=", <value>, "TranslateVectorY:=", <value>, "TranslateVectorZ:=", <value>) For 2D XY Designs, "TranslateVectorZ:=" should be set to "0". For 2D RZ Designs, "TranslateVectorY:=" should be set to "0".
OffsetFaces
Use: Command: Offsets the faces of specified parts. Edit>Arrange>Offset
3D Modeler Editor Script Commands 11-21
Paste (Modeler)
Use: Command: Syntax: Return Value: Pastes copied data. Edit>Paste Paste None
Rotate
Use: Command: Syntax: Return Value: Parameters: Rotates specified parts. Edit>Arrange>Rotate Rotate <SelectionsArray>, <RotateParametersArray> None <RotateParametersArray> Array("NAME:RotateParameters", "RotateAxis:=", <string> "RotateAngle:=", <value>) RotateAxis Possible values for 3D Designs are: "X", "Y", "Z". For 2D XY Designs, "RotateAxis:=" should be set to "Z". For 2D RZ Designs, "RotateAxis:=" should be set to "Y".
Scale
Use: Command: Syntax: Return Value: Parameters: Scales specified parts. Edit>Scale Scale <SelectionsArray>, <ScaleParametersArray> None <ScaleParametersArray> Array("NAME:ScaleParameters", "ScaleX:=", <value>, "ScaleY:=", <value>,
11-22 3D Modeler Editor Script Commands
"ScaleZ:=", <value>) For 2D XY Designs, "ScaleZ:=" should be set to "0". For 2D RZ Designs, "ScaleY:=" should be set to "0".
AssignMaterial Chamfer Connect CoverLines CoverSurfaces CreateEntityList CreateFaceCS CreateObjectCS CreateObjectFromEdges CreateObjectFromFaces CreateRelativeCS DeleteLastOperation DetachFaces EditEntityList EditFaceCS EditObjectCS EditRelativeCS Export Fillet GenerateHistory Import ImportDXF Intersect MoveFaces Section SeparateBody SetModelUnits SetWCS ShowWindow Split Subtract UncoverFaces Unite
AssignMaterial
Use: Command: Syntax: Return Value: Example: Assigns a material to the specified objects. Only the MaterialName and SolveInside parameters of <AttributesArray> are supported. Modeler>Assign Material AssignMaterial <SelectionsArray>, <AttributesArray> None oEditor.AssignMaterial _ Array("NAME:Selections", "Selections:=", "Polygon1"),_ Array("NAME:Attributes", _ "MaterialName:=", "tungsten",_ "SolveInside:=", false)
Chamfer
Use: Command: Syntax: Return Value: Parameters: Creates a chamfer. Modeler>Chamfer (Only available for 3D Projects and 3D Objects) Chamfer (<ObjectName> <ChamferParameters>) None <ObjectName> Array("NAME:Selections", _ "Selections:=", <string>), <ChamferParameters> Array("NAME:Parameters", _ Array("NAME:ChamferParameters", _ "CoordinateSystemID:=", <value>, "Edges:=", <ArrayOfEdgeIDs>, "LeftRange:=", <value>)) Example: oEditor.Chamfer Array("Name:Selections", _ "Selections:=", "Box1"), Array("NAME:Parameters", _ Array("NAME:ChamferParameters", _ "CoordinateSystemID:=", -1, _ "Edges:=", Array(13), "LeftRange:=", "1mm"))
Connect
Use: Connects specified 1D parts to form a sheet.
3D Modeler Editor Script Commands 11-25
CoverLines
Use: Command: Syntax: Return Value: Covers the specified 1D objects to form a sheet. Modeler>Surface>Cover Lines CoverLines <SelectionsArray> None
CoverSurfaces
Use: Command: Syntax: Return Value: Covers the specified objects to form a solid object. Modeler>Surface>Cover Faces CoverSurfaces <SelectionsArray> None
CreateEntityList
Use: Command: Syntax: Return Value: Parameters: Creates a list of entities. The list can contain objects or faces but not both. Only the Name attribute from <AttributesArray> is supported. Modeler>List>Create>Object List Modeler>List>Create>Face List CreateEntityList <EntityListParametersArray>, <AttributesArray> None <EntityListParametersArray> Array("NAME:GeometryEntityListParameters", "EntityType:=", <string>, "EntityList:=", <array> EntityType Possible values are "Object", "Face" EntityList Array of integers the IDs of the objects or faces to put in the list.
CreateFaceCS
Use: Command: Syntax: Return Value: Parameters: Creates a face coordinate system. Only the Name attribute of the <AttributesArray> parameter is supported. Modeler>Coordinate System>Create>Face CS CreateFaceCS <FaceCSParametersArray>, <AttributesArray> None <FaceCSParametersArray> Array("NAME:FaceCSParameters", "FaceID:=", <int>, "PartID:=", <int>, Array("NAME:OriginPosn", "IsAttachedToEntity:=", <bool>, "EntityID:=", <value>, "PositionType:=", <string>, "UParam:=", <value>, "VParam:=", <value>, "XPosition:=", <value>, "YPosition:=", <value>, "ZPosition:=", <value>) Array("NAME:AxisPosn", "IsAttachedToEntity:=", <bool> "EntityID:=", <value> "PositionType:=", <string>, "UParam:=", <value>, "VParam:=", <value>, "XPosition:=", <value>, "YPosition:=", <value>, "ZPosition:=", <value>) "WhichAxis:=", <string>) FaceID ID of the face on which to create the coordinate system. PartID ID of the object on which the face ID lies. IsAttachedToEntity Specifies whether the point is anchored (to a vertex, edge, or face).
3D Modeler Editor Script Commands 11-27
If IsAttachedToEntity is true, provide the UParam and VParam parameters. Otherwise, provide the XPosition, YPosition, and ZPosition parameters. EntityID ID of the vertex, edge, or face to which the point is anchored. PositionType Place where the point is anchored. Possible values are: "FaceCenter", "EdgeCenter", "OnVertex", "OnEdge", "OnFace" UParam, VParam Numbers between 0 and 1 representing the relative position of the point on the edge or face. Example: UParam = .5, VParam = .5 of a face. XPosition, YPosition, ZPosition Fixed position of the point. For 2D XY Designs, ZPosition should be set to "0". For 2D RZ Designs, YPosition should be set to "0". WhichAxis Possible values are "X", "Y", "Z". For 2D XY Designs, WhichAxis must be set to "Z". For 2D RZ Designs, WhichAxis must be set to "Y". would be the center
CreateObjectCS
Use: Command: Syntax: Return Value: Parameters: Creates an Object coordinate system. Modeler>Coordinate System>Create>Object><Offset | Rotated | Both> CreateObjectCS <ParameterArrays> None Array("NAME:ObjectCSParameters", "PartID:=", <ID>, "ReverseXAxis:=", <Boolean>, "ReverseYAxis:=", <Boolean>, Array("NAME:Origin", "IsAttachedToEntity:=", <Boolean>, "EntityID:=", <ID>,
11-28 3D Modeler Editor Script Commands
"PositionType:=", "<OnPositionID>, String, one of OnVertex, FaceCenter, OnEdge, AbsolutePosition "UParam:=", <integer>, "VParam:=", <Integer>, "XPosition:=", "<Integer>", "YPosition:=", "<Integer>", "ZPosition:=", "<Integer>"), Array("NAME:xAxis", "DirectionType:=", "AbsoluteDirection", "EdgeID:=", <Int>, "FaceID:=", <Int>, "xDirection:=", "<int>", "yDirection:=", "<Int>", "zDirection:=", "<Int>", "UParam:=", <int>, "VParam:=", <Int>), Array("NAME:yAxis", "DirectionType:=", "AbsoluteDirection", "EdgeID:=", <Int>, "FaceID:=", <int>, "xDirection:=", "<int>", "yDirection:=", "<int>", "zDirection:=", "<int>", "UParam:=", <int>, "VParam:=", <int>)), Array("NAME:Attributes", "Name:=", "<ObjectCSName>") Example: Dim oAnsoftApp Dim oDesktop Dim oProject Dim oDesign Dim oEditor Dim oModule Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface")
3D Modeler Editor Script Commands 11-29
Set oDesktop = oAnsoftApp.GetAppDesktop() oDesktop.RestoreWindow Set oProject = oDesktop.SetActiveProject("coax_bend") Set oDesign = oProject.SetActiveDesign("MaxwellDesign1") Set oEditor = oDesign.SetActiveEditor("3D Modeler") oEditor.CreateObjectCS Array("NAME:ObjectCSParameters", "PartID:=", 24, "ReverseXAxis:=", false, "ReverseYAxis:=", false, Array("NAME:Origin", "IsAttachedToEntity:=", true, "EntityID:=", 30, "PositionType:=", "OnVertex", "UParam:=", 0, "VParam:=", 0, "XPosition:=", "0", "YPosition:=", "0", "ZPosition:=", "0"), Array("NAME:xAxis", "DirectionType:=", "AbsoluteDirection", "EdgeID:=", -1, "FaceID:=", -1, "xDirection:=", "1", "yDirection:=", "0", "zDirection:=", "0", "UParam:=", 0, "VParam:=", 0), Array("NAME:yAxis", "DirectionType:=", "AbsoluteDirection", "EdgeID:=", -1, "FaceID:=", -1, "xDirection:=", "0", "yDirection:=", "1", "zDirection:=", "0", "UParam:=", 0, "VParam:=", 0)), Array("NAME:Attributes", "Name:=", "ObjectCS1")
CreateObjectFromEdges
Use: Command: Creates a polyline from the specified object edge. Modeler>Create Object From Edge
CreateObjectFromEdges <SelectionsArray>, <ObjFromEdgeParametersArray> None <SelectionsArray> Array("NAME:Selections", "Selections:=" <ObjName>) <ObjFromEdgeParametersArray> Array("NAME:Parameters", <EdgeParametersArray>) <EdgeParametersArray> Array("Name:BodyFromEdgeToParameters", "CoordinateSystemID:=", <int>, "Edges:=", <EdgeIDarray>)
Example:
oEditor.CreateEdgeFromEdges _ Array("NAME:Selections", "Selections:=", "Box1"),_ Array("NAME:Parameters", _ Array("NAME:BodyFromEdgeToParameters", _ "CoordinateSystemID:=", -1, _ "Edges:=", Array(13)))
CreateObjectFromFaces
Use: Command: Syntax: Return Value: Parameters: Creates 2D objects from the specified faces. Modeler>Surface>Create Object From Face CreateObjectFromFaces <SelectionsArray>, <ObjFromFaceParametersArray> None <ObjFromFaceParametersArray> Array("NAME:Parameters", <FacesOfOneObjToDetach>, <FacesOfOneObjToDetach>, ...) <FacesOfOneObjToDetach> Array("Name:BodyFromFaceToParameters", "FacesToDetach:=", <array>)
3D Modeler Editor Script Commands 11-31
FacesToDetach Array of integers the IDs of the faces to use to create objects. Example: oEditor.CreateObjectFromFaces _ Array("NAME:Selections", "Selections:=", "Box1"),_ Array("NAME:Parameters", _ Array("NAME:BodyFromFaceToParameters", _ "FacesToDetach:=", Array(185)))
CreateRelativeCS
Use: Command: Creates a relative coordinate system. Only the Name attribute of the <AttributesArray> parameter is supported. Modeler>Coordinate System>Create>Relative CS>Offset Modeler>Coordinate System>Create>Relative CS>Rotated Modeler>Coordinate System>Create>Relative CS>Both Syntax: Return Value: Parameters: CreateRelativeCS <RelativeCSParametersArray>, <AttributesArray> None <RelativeCSParametersArray> Array("NAME:RelativeCSParameters", "OriginX:=", <value>, "OriginY:=", <value>, "OriginZ:=", <value>, "XAxisXvec:=", <value>, "XAxisYvec:=", <value>, "XAxisZvec:=", <value>, "YAxisXvec:=", <value>, "YAxisYvec:=", <value>, "YAxisZvec:=", <value>) For 2D XY Designs, OriginZ, XAxisZvec, and YAxisZvec should be set to "0". For 2D RZ Designs, OriginY, XAxisYvec, and YAxisYvec should be set to "0".
DeleteLastOperation
Use: Deletes the last operation for specified objects.
DetachFaces
Use: Command: Syntax: Return Value: Parameters: Detaches the specified faces. Modeler>Surface>Detach Faces DetachFaces <SelectionsArray>, <DetachFacesParametersArray> None <DetachFacesParametersArray> Array("NAME:Parameters", <FacesOfOneObjToDetach>, <FacesOfOneObjToDetach>, ...) <FacesOfOneObjToDetach> Array("Name:DetachFacesToParameters", "FacesToDetach:=", <array>) FacesToDetach An array of integers the IDs of the faces to detach. Example: oEditor.DetachFaces _ Array("NAME:Selections", "Selections:=",_ "Box5,Box4"),_ Array("NAME:Parameters", _ Array("NAME:DetachFacesToParameters", _ "FacesToDetach:=", Array(123, 122)),_ Array("NAME:DetachFacesToParameters", _ "FacesToDetach:=", Array(94)))
EditEntityList
Use: Command: Syntax: Return Value: Modifies an entity list. Modeler>List>Reassign EditEntityList <SelectionsArray>, <EntityListParametersArray> None
EditFaceCS
Use: Recreates an existing face coordinate system. The name of the coordinate system to modify should be specified in the <AttributesArray> parameter. Modeler>Coordinate System>Edit EditFaceCS <FaceCSParametersArray>, <AttributesArray> None
EditObjectCS
Use: Command: Syntax: Return Value: Parameters: Edit an existing Object CS. Modeler>Coordinate System>Edit EditObjectCS <Array> None Array("NAME:ObjectCSParameters", "PartID:=", <ID>, "ReverseXAxis:=", <Boolean>, "ReverseYAxis:=", <Boolean>, Array("NAME:Origin", "IsAttachedToEntity:=", <Boolean>, "EntityID:=", <ID>, "PositionType:=", "<OnPositionID>, String, one of OnVertex, FaceCenter, OnEdge, AbsolutePosition "UParam:=", <integer>, "VParam:=", <Integer>, "XPosition:=", "<Integer>", "YPosition:=", "<Integer>", "ZPosition:=", "<Integer>"), Array("NAME:xAxis", "DirectionType:=", "AbsoluteDirection", "EdgeID:=", <Int>, "FaceID:=", <Int>, "xDirection:=", "<int>", "yDirection:=", "<Int>", "zDirection:=", "<Int>", "UParam:=", <int>, "VParam:=", <Int>),
11-34 3D Modeler Editor Script Commands
Array("NAME:yAxis", "DirectionType:=", "AbsoluteDirection", "EdgeID:=", <Int>, "FaceID:=", <int>, "xDirection:=", "<int>", "yDirection:=", "<int>", "zDirection:=", "<int>", "UParam:=", <int>, "VParam:=", <int>)), Array("NAME:Attributes", "Name:=", "<ObjectCSName>") Example: Dim oAnsoftApp Dim oDesktop Dim oProject Dim oDesign Dim oEditor Dim oModule Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface") Set oDesktop = oAnsoftApp.GetAppDesktop() oDesktop.RestoreWindow Set oProject = oDesktop.SetActiveProject("Project53") Set oDesign = oProject.SetActiveDesign("MaxwellDesign1") Set oEditor = oDesign.SetActiveEditor("3D Modeler") oEditor.SetWCS Array("NAME:SetWCS Parameter", "Working Coordinate System:=", "ObjectCS1") oEditor.EditObjectCS Array("NAME:ObjectCSParameters", "PartID:=", 6, "ReverseXAxis:=", false, "ReverseYAxis:=", false, Array("NAME:Origin", "IsAttachedToEntity:=", false, "EntityID:=", -1, "PositionType:=", "AbsolutePosition", "UParam:=", 0, "VParam:=", 0, "XPosition:=", "0mm", "YPosition:=", "0mm",
3D Modeler Editor Script Commands 11-35
"ZPosition:=", "0mm"), Array("NAME:xAxisPos", "IsAttachedToEntity:=", true, "EntityID:=", 13, "PositionType:=", "OnEdge", "UParam:=", 0.75, "VParam:=", 0, "XPosition:=", "0", "YPosition:=", "0", "ZPosition:=", "0"), Array("NAME:yAxisPos", "IsAttachedToEntity:=", true, "EntityID:=", 7, "PositionType:=", "FaceCenter", "UParam:=", 0, "VParam:=", 0, "XPosition:=", "0", "YPosition:=", "0", "ZPosition:=", "0")), Array("NAME:Attributes", "Name:=", "ObjectCS1")
EditRelativeCS
Use: Command: Syntax: Return Value: Parameters: Modifies a relative coordinate system. Use <AttributesArray> to indicate the name of the coordinate system to modify. Modeler>Coordinate System>Edit EditRelativeCS <RelativeCSParametersArray>, <AttributesArray> None <ParametersArray> Array("NAME:RelativeCSParameters", "OriginX:=", <value>, "OriginY:=", <value>, "OriginZ:=", <value>, "XAxisXvec:=", <value>, "XAxisYvec:=", <value>, "XAxisZvec:=", <value>, "YAxisXvec:=", <value>, "YAxisYvec:=", <value>, "YAxisZvec:=", <value>) For 2D XY Designs, OriginZ, XAxisZvec, and YAxisZvec should be set to "0". For 2D RZ Designs, OriginY, XAxisYvec, and YAxisYvec should be set to "0".
Export
Use: Command: Syntax: Return Value: Parameters: Exports the model to a file. Modeler>Export Export <ExportParametersArray> None <ExportParametersArray> Array("NAME:ExportParameters", "File Name:=", <string>, "Major Version:=", <int>, "Minor Version:=", <int>) Major Version Can be 1 or any ACIS major version supported by Maxwell. Minor Version Can be 1 or any ACIS minor version supported by Maxwell software.
Fillet
Use: Command: Syntax: Return Value: Parameters: Creates a fillet. Modeler>Fillet (Only Available for 3D Projects and 3D Objects) Fillet(<ObjectName> <FilletParameters>) None <ObjectName> Array("NAME:Selections", _ "Selections:=", <string>), <FilletParameters> Array("NAME:Parameters", _ Array("NAME:FilletParameters", _ "CoordinateSystemID:=", <value>, "Edges:=", <ArrayOfEdgeIDs>, "Radius:=", <value>, "Setback:=", <value>)) Example: oEditor.Fillet Array("Name:Selections", "Selections:=", _ "Box1"), Array("NAME:Parameters", Array("NAME:FilletParameters", _ "CoordinateSystemID:=", -1, "Edges:=", Array(13),
3D Modeler Editor Script Commands 11-37
GenerateHistory
Use: Command: Syntax: Return Value: Generates the history for specified 1D objects. Modeler>Generate History GenerateHistory <SelectionsArray> None
Import
Use: Command: Syntax: Return Value: Parameters: Imports a 3D model file. Modeler>Import Import <ImportParametersArray> None <ImportParametersArray> Array("NAME:NativeBodyParameters", "AutoHeal:=", <bool>, "Options:=", <string>, "SourceFile:=", <string>)
ImportDXF
Use: Command: Syntax: Import a DXF file into a design. ImportDXF ImportDXF Array("NAME:options", "FileName:=", <"filename">, "Scale:=", <scale>, "AutoDetectClosed:=", <detect closed>, "SelfStitch:=", <stitch>, "DefeatureGeometry:=", <defeature>, "DefeatureDistance:=", <defeature distance>, "RoundCoordinates:=", <round>, "RoundNumDigits:=", <round digits>, "WritePolyWithWidthAsFilledPoly:=", <filled poly>, "ImportMethod:=", <import method> "2DSheetBodies:=", <2D sheet>
11-38 3D Modeler Editor Script Commands
Array("NAME:LayerInfo", Array("NAME:<layer>", "source:=", <"layer">, "display_source:=", "<display>", "import:=", <import>, "dest:=", "<destination layer>", "dest_selected:=", <destination selected>, "layer_type:=", <"layer type">), )) Return Value: Parameters: None <"filename"> Type: text Description: name of the DXF file to import <scale> Type: double Description: scale factor to be applied to incoming coordinate values; converts the incoming units to meters. <detect closed> Type: boolean (true or false) Description: if true, polylines are checked to see whether or not they are closed. If a polyline is closed, Designer creates a polygon in the design. <stitch> Type: boolean (true or false) Description: if true, multiple straight line segments are joined to form polylines. If the resulting polyline is closed, a polygon is created in Designer. <defeature> Type: boolean (true or false) Description: if true, certain small features in the imported geometry are removed to reduce complexity. The features that are removed include: multiple points placed within the specified distance; thin or narrow regions ("thins" and "spikes"); and extraneous points along straight line segments. <defeature distance> Type: double Description: defeaturing distance/ <round>
3D Modeler Editor Script Commands 11-39
Type: boolean (true or false) Description: if true, all imported data is rounded to the specify number of decimal points. <round digits> Type: integer Description: number of rounding decimal points <filled poly> Type: boolean (true or false) Description: if true, import wide polylines as polygons. There is more flexibility to change the shape of a polygon. <import method> Type: integer Description: 0 for Script, 1 for Acis. <2D sheet> Type: boolean (true or false) Description: if true, import geometry as 2D sheet bodies. <layer> Type: text Description: import layer name (as found in the DXF file). <import> Type: boolean (true or false) Description: if true, the layer is import (note: there's no need to list all layers, just supply the layers to be imported). <destination layer> Type: text Description: destination layer name <destination selected> Type: boolean (true or false) Description: if true, the destination layer must be an existing layer (else a new layer will be created). <"layer type"> Type: text Description: the layer type, "undefined", "signal", "dielectric", "metalizedsignal", "ground", "etching", "resistance", "capacitance", "cover", "rat", "error", "symbol", "measures", "voids", "assembly", "silkscreen", "soldermask", "solderpaste", "glue", "wirebond", "jumper", "user", "generic".
11-40 3D Modeler Editor Script Commands
Example: oEditor.ImportDXF Array("NAME:options", "FileName:=", "C:/Designs/dxfiles/spiral_export.dxf", "Scale:=", 0.001, "AutoDetectClosed:=", true, "SelfStitch:=", true, "DefeatureGeometry:=", true, "DefeatureDistance:=", 1E-008, "RoundCoordinates:=", true, "RoundNumDigits:=", 4, "WritePolyWithWidthAsFilledPoly:=", true, "ImportMethod:=", 1, "2DSheetBodies:=", true, Array("NAME:LayerInfo", Array("NAME:0", "source:=", "0", "display_source:=", "0", "import:=", true, "dest:=", "0", "dest_selected:=", false, "layer_type:=", "signal"), Array("NAME:spiral_export", "source:=", "spiral_export", "display_source:=", "spiral_export", "import:=", true, "dest:=", "spiral_export", "dest_selected:=", false, "layer_type:=", "signal")))
Intersect
Use: Command: Syntax: Return Value: Parameters: Intersects specified objects. Modeler>Boolean>Instersect Intersect <SelectionsArray>, <IntersectParametersArray> None <IntersectParametersArray>
3D Modeler Editor Script Commands 11-41
MoveFaces
Use: Command: Moves the specified faces along the normal or along a vector. Modeler>Surface>Move Faces>Along Normal Modeler>Surface>Move Faces>Along Vector (Command available for 3D Projects only) Syntax: Return Value: Parameters: MoveFaces <SelectionsArray>, <MoveFacesParametersArray> None <MoveFacesParametersArray> Array("NAME:Parameters", <FacesOfOneObjToMove>, <FacesOfOneObjToMove>, ...) <FacesOfOneObjToMove> Array("Name:MoveFacesParameters", "MoveAlongNormalFlag:=", <bool>, "OffsetDistance:=", <value>, "MoveVectorX:=", <value>, "MoveVectorY:=", <value>, "MoveVectorZ:=", <value>, "FacesToMove:=", <array>) MoveAlongNormalFlag Specifies whether to move along the face normal or along a vector. If false, provide the MoveVectorX, MoveVectorY, and MoveVectorZ parameters. FacesToMove Array of integers the IDs of the faces to move Example: oEditor.MoveFaces _ Array("NAME:Selections", "Selections:=", _ "Box2,Box1"), _ Array("NAME:Parameters", _ Array("NAME:MoveFacesParameters", _ "MoveAlongNormalFlag:=", true, _ "OffsetDistance:=", "1mm", _ "FacesToMove:=", Array(218)),_ Array("NAME:MoveFacesParameters", _ "MoveAlongNormalFlag:=", false,_
11-42 3D Modeler Editor Script Commands
"OffsetDistance:=", "1mm", _ "MoveVectorX:=", "1mm", _"MoveVectorY:=", "0mm", _ "MoveVectorZ:=", "0mm", _"FacesToMove:=",_ Array(185)))
Section
Use: Command: Syntax: Return Value: Parameters: Creates a 2D cross-section of the selection in the specified plane. Modeler>Surface>Section Section <SelectionsArray>, <SectionParametersArray> None <SectionParametersArray> Array("NAME:SectionToParameters", "SectionPlane:=", <string>) Section Plane Possible values are "XY", "YZ", "ZX".
SeparateBody
Use: Command: Syntax: Return Value: Separates bodies of specified multi-lump objects. Modeler>Boolean>Separate Bodies SeparateBody <SelectionsArray> None
SetModelUnits
Use: Command: Syntax: Return Value: Parameters: Sets the model units. Modeler>Units SetModelUnits <ModelUnitsParametersArray> None <ModelUnitsParametersArray> Array("NAME:Units Parameter", "Units:=", <string>, "Rescale:=", <bool>) Units Possible values are: "cm", "ft", "in", "meter", "mil", "mm", "nm", "uin", "um".
SetWCS
Use: Command: Syntax: Return Value: Parameters: Sets the working coordinate system. Modeler>Coordinate System>Set Working CS SetWCS <WCSParametersArray> None <WCSParametersArray> Array("NAME:SetWCS Parameter", "Working Coordinate System:=", <string>) Working Coordinate System Name of the coordinate system to set as the WCS.
ShowWindow
Use: Syntax: Return Value: Parameters: Example: Opens the selected 3D model editor window. ShowWindow None None Set oDesign = oProject.GetActiveDesign Set oModeler = oDesign.SetActiveEditor("3D Modeler") oEditor.ShowWindow
Split
Use: Command: Syntax: Return Value: Parameters: Splits specified objects along a plane. Modeler>Boolean>Split Split <SelectionsArray>, <SplitParametersArray> None <SplitParametersArray> Array("NAME:SplitToParameters", "SplitPlane:=", <string>, "WhichSide:=", <string>) SplitPlane Possible values for 3D Designs are "XY", "YZ", "ZX". Possible values for 2D XY Designs are "YZ", "ZX". Possible values for 2D RZ Designs are "XY", "YZ".
Subtract
Use: Command: Syntax: Return Value: Parameters: Subtracts specified objects. Modeler>Boolean>Subtract Subtract <SubtractSelectionsArray>, <SubtractParametersArray> None <SubtractSelectionsArray> Array(NAME:Selections, "Blank Parts:=", <string>, "Tool Parts:=", <string>) Blank Parts Comma-separated list of parts to use as the blank in the subtract operation. Example: "Blank Parts:=", "Box1, Box2" Tool Parts Comma-separated list of parts to use as the tool in the subtract operation. Example: "Blank Parts:=", "Box3, Box4" <SubtractParametersArray> Array("NAME:SubtractParameters", "KeepOriginals:=", Example: oEditor.Subtract _ Array("NAME:Selections", _ "Blank Parts:=", "Polygon1",_ "Tool Parts:=", "Box1"),_ Array("NAME:SubtractParameters", _ "KeepOriginals:=", false) <bool>)
UncoverFaces
Use: Command: Syntax: Uncovers specified faces. Modeler>Surface>Uncover Faces UncoverFaces <SelectionsArray>, <UncoverParametersArray>
3D Modeler Editor Script Commands 11-45
None <UncoverParametersArray> Array("NAME:Parameters", <FacesOfOneObjToUncover>, <FacesOfOneObjToUncover>,...) <FacesOfOneObjToUncover> Array("Name:UncoverFacesParameters", "FacesToUncover:=", <array>) FacesToUncover An array of integers the IDs of the faces to uncover.
Example:
oEditor.UncoverFaces _ Array("NAME:Selections", "Selections:=", _ "Box3,Box2"),_ Array("NAME:Parameters", _ Array("NAME:UncoverFacesParameters", _ "FacesToUncover:=", Array(69)), _ Array("NAME:UncoverFacesParameters", _ "FacesToUncover:=", Array(36)))
Unite
Use: Command: Syntax: Return Value: Parameters: Unites the specified objects. Modeler>Boolean>Unite Unite <SelectionsArray>, <UniteParametersArray> None <UniteParametersArray> Array("NAME:UniteParameters", "KeepOriginals:=", <bool>)
Delete GetEdgeByPosition GetFaceByPosition GetUserPosition GetObjectName GetObjectNameByFaceID GetObjectIDByName GetMatchedObjectName GetNumObjects GetSelections PageSetup RenamePart GetModelBoundingBox
Delete
Use: Command: Syntax: Return Value: Deletes specified objects, coordinate systems, points, planes, etc. None Delete <SelectionsArray> None
GetModelBoundingBox
Use: Command: Syntax: Return Value: Parameters: Example: Gets the bounding box of the current model. None GetModelBoundingBox() Returns the Xmin, Ymin, Zmin, Xmax, Ymax, Zmax values that define the bounding box. None Dim oBoundingBox oBoundingBox = oEditor.GetModelBoundingBox()
GetEdgeByPosition
Use: Syntax: Gets the edge id corresponding to position input. GetEdgeByPosition(<PositionParameters>)
3D Modeler Editor Script Commands 11-47
Returns an integer edge id. <PositionParameters> Array("NAME:EdgeParameters", _ "BodyName:=", <string>, "Xposition:=", <value>, "YPosition:=", <value>, "ZPosition:=", <value>) For 2D XY Designs, ZPosition should be set to "0" For 2D RZ Designs, YPosition should be set to "0"
Example:
edgeid = oEditor.GetEdgeByPosition(Array("NAME:EdgeParameters", _ "BodyName:=", "Box1", "XPosition:=", "3.4mm", _ "YPosition:=", "2.8mm", "ZPosition:=", "0.4mm"))
GetFaceByPosition
Use: Command: Syntax: Return Value: Parameters: Gets the ID of a face by position. None GetFaceByPosition <FaceByPositionParametersArray> An integer containing the face ID. <FaceByPositionParametersArray> Array("NAME:Parameters", "BodyName:=", <string>, "XPosition:=", <value>, "YPosition:=", <value>, "ZPosition:=", <value>) For 2D XY Designs, ZPosition should be set to "0" For 2D RZ Designs, YPosition should be set to "0" BodyName Name of the body on which the point lies. Example: Dim FaceID FaceID = oEditor.GetFaceByPosition_ (Array("NAME:Parameters",_ "BodyName:=", "Box1",_
11-48 3D Modeler Editor Script Commands
GetUserPosition
Use: Syntax: Return Value: Parameters: Example: Returns the coordinates of an interactive position input in the 3D model window. GetUserPosition(<PositionInputPrompt>) Array of coordinates <PositionInputPrompt> Type: <string> Dim position Dim coord position = oEditor.GetUserPosition("Enter a point") For Each coord in position Msgbox(coord) Next
GetObjectName
Use: Syntax: Return Value: Parameters: Gets an object name corresponding to the 0 base index of the creation order. GetObjectName(<Index>) Returns the object name of corresponding object. <Index> Type: <string> The 0 base index of the creation order. Example: objectname = oEditor.GetObjectName(3)
GetObjectIDByName
Use: Syntax: Return Value: Parameters: Example: Gets an object name corresponding to the input face ID. GetObjectIDByName(<ObjectName>) Returns the ID of the corresponding object Name. <ObjectName> Type: <string> oObjectID = oEditor.GetObjectIDByName("Box2")
3D Modeler Editor Script Commands 11-49
GetObjectNameByFaceID
Use: Syntax: Return Value: Parameters: Example: Gets an object name corresponding to the input face ID. GetObjectName(<FaceID>) Returns the name of the corresponding object. <FaceID> Type: <string> objectname = oEditor.GetObjectNameByFaceID(Face10)
GetMatchedObjectName
Use: Syntax: Return Value: Parameters: Gets all object names containing the input text string. GetMatchedObjectName(<ObjectNameWildcardText>) Array of object names containing wildcard text. <ObjectNameWildcardText> Type: <string> Text to be used for object name matching. Example: objectnames = oEditor.GetMatchedObjectName("Box*")
GetNumObjects
Use: Syntax: Return Value: Parameters: Example: Gets the number of objects in a design. GetNumObjects Returns the number of objects. Type: <int> None totalobjects = oEditor.GetNumObjects
GetSelections
Use: Command: Syntax: Return Value: Parameters: Example: Informational. None. GetSelections Returns an array of IDs. None Set oProject = oDesktop.SetActiveProject("Project6") Set oDesign = oProject.SetActiveDesign("MaxwellDesign1") Set oEditor = oDesign.SetActiveEditor("3D Modeler")
11-50 3D Modeler Editor Script Commands
Dim A A = Array() A = oEditor.GetSelections Dim B B = Join(A,",") 'Debug.Write "The Selections are " &B MsgBox(B) Dim C C = Array("NAME:Selections", "Selections:=", B) oEditor.Delete C
PageSetup
Use: Command: Syntax: Return Value: Parameters: Specifies the page settings for printing. File>Page Setup PageSetup <PageSetupParametersArray> None <PageSetupParametersArray> Array("NAME:PageSetupData", "margins:=", Array("left:=", <value>, "right:=", <value>, "top:=", <value>, "bottom:=", <value>))
RenamePart
Use: Command: Syntax: Return Value: Parameters: Renames an object. None RenamePart <RenameParametersArray> None <RenameParametersArray> Array("NAME:Rename Data", "Old Name:=", <string>, "New Name:=", <string>)
GetModelBoundingBox
Use: Syntax: Return Value: Parameters: Example: Gets the bounding box of the current model. GetModelBoundingBox() Returns the X, Y, and Z position values and the dX, dY, and dZ size values that define the bounding box. None Dim oBoundingBox oBoundingBox = oEditor.GetModelBoundingBox()
12
Reporter commands should be executed by the oDesign module. Following is an example of how to access this object: Set oDesign = Project.SetActiveDesign("Maxwell3DDesign1") Set oModule=oDesign.GetModule("ReportSetup") All Report properties can be edited using the ChangeProperty commands. This includes Title properties, General properties, and Background properties such as border color, fonts, X and Y axis scaling, units, and number display. Note Maxwell supports Reporter scripting. When you click Tools>Record Script, Maxwell operations performed in the Reporter are automatically recorded.
AddCartesianXMarker AddDeltaMarker AddMarker AddNote AddTraces ClearAllMarkers CopyReportData CopyReportDefinition CopyTraceData CopyTraceDefinition CreateReport CreateReportFromTemplate DeleteAllReports DeleteReports DeleteTraces ExportToFile FFTOnReport GetAllReportNames GetDisplayType ImportIntoReport PasteReports PasteTraces RenameReport RenameTrace UpdateTraces UpdateTracesContextAndSweeps
AddCartesianXMarker
Use: Command: Syntax: Return Value: Parameters: Adds a marker to a report on the X axis. Report2D>Marker>Add X Marker AddCartesianXMarker <ReportName>, <MarkerID>, <Xcoord> None <ReportName> Type: <string>
12-2 Reporter Editor Script Commands
Name of Report. <MarkerID> Type: <string> ID of the marker, for example: M1. <XCoord> Type: <real> X location for the marker. Example: oModule.AddCartesianXMarker "XY Plot1", "MX1", 0
AddDeltaMarker
Use: Command: Syntax: Return Value: Parameters: Add markers to calculate differences between two trace points on a plot. Report2D>Marker>Add Delta Marker AddDeltaMarker <ReportName>, <MarkerID_1>, <TraceID_1>, <Xcoord_1>, <MarkerID_2>, <TraceID_2> <Xcoord_2> None <ReportName> Type: <string> Name of Report. <MarkerID> Type: <string> ID for the markers. <TraceID> Type: <string> Typically given by expression plus solution name plus coordinate system type. <XCoord> Type: <real> X location for the marker. Example: oModule.AddDeltaMarker "XY Plot 1", "m3", "dB(S(LumpPort1 LumpPort1)) : Setup1 : Sweep1 : Cartesian", _ "3.22GHz", _ "m4", "dB(S(LumpPort1 LumpPort1)) : Setup1 : Sweep1 : Cartesian",_ "3.93GHz"
AddMarker
Use: Command: Syntax: Return Value: Parameters: Adds a marker to a trace on a report. Report2D>Marker>Add Marker AddMarker <ReportName>, <MarkerID>, <TraceID>, <Xcoord>, None <ReportName> Type: <string> Name of Report. <MarkerID> Type: <string> ID for the marker. <TraceID> Type: <string> Typically given by expression plus solution name plus coordinate system type. <XCoord> Type: <real> X location for the marker. Example: Set oModule = oDesign.GetModule("ReportSetup") oModule.AddMarker "XY Plot1", "m1", _ "mag(S(Port1 Port1)) : Setup1 : LastAdaptive : Cartesian", "0.3in"
AddNote
Use: Command: Syntax: Return Value: Parameters: Adds a note at a specified location to a given report. Right-click on the plot and select Add Note AddNote <ReportName> <NoteDataArray>) None <ReportName> Type: <string> Name of report. <NoteDataArray> Type: Array Array(NAME:<NoteDataName>, <NoteArray>)
<NoteDataName> Type: String <NoteArray> Array(NAME:<NoteDataSourceName>, SourceName:=, <SourceName>, "HaveDefaultPos:=", <boolean>, "DefaultXPos:=", <XPos>, "DefaultYPos:=", <YPos>, String:=, <Note>)) Example: Set oModule = oDesign.GetModule("ReportSetup") oModule.AddNote "XY Plot1", Array("NAME:NoteDataSource", Array("NAME:NoteDataSource", "SourceName:=", "Note1", "HaveDefaultPos:=", true, "DefaultXPos:=", 1996, "DefaultYPos:=", _ 3177, "String:=", "This is a note"))
AddTraces
Use: Command: Syntax: Creates a new trace and adds it to the specified report. Modify Report>Add Trace AddTraces <ReportName>, <SolutionName>, <SimulatedValueContextArray>, <PointSetDefinitionArray>, <TracesExpressionsArray>, <ExtendedTraceInformationArray> None <ReportName> Type: <string> Name of Report. <SolutionName> Type: <string> Name of the solution as listed in the Modify Report dialog box. For example: "Setup1 : Last Adaptive" <SimulatedValueContextArray> Type: Array of strings Context for which the expression is being evaluated. This can be an empty string if there is no context. Array(Domain:=, <DomainType>) <DomainType>
Reporter Editor Script Commands 12-5
ex. Sweep or Time Array(Context:=, <GeometryType>) <GeometryType> ex. Infinite Spheren, Spheren, Polylinen <FamiliesArray> Type: Array of strings Contains sweep definitions for the report. Array(<VariableName>:= , <ValueArray>) <ValueArray> Array(All) or Array(Value1, Value2, ...Valuen) examples of <VariableName> Freq, Theta, Distance <ReportDataArray> Type: Array of strings This array contains the report quantity and X, Y, and (Z) axis definitions. Array(X Component:=, <VariableName>, Y Component:=, <VariableName> | <ReportQuantityArray>) <ReportQuantityArray> ex. Array(dB(S(Port1, Port1))) Example: oModule.AddTraces "XY Plot1", "Setup1 : Sweep1", _ Array("Domain:=", "Time", "HoldTime:=", 1, "RiseTime:=", 0, _ "StepTime:=", 6.24999373748E-012, "Step:=", false, _ "WindowWidth:=", 1, _ "WindowType:=", 0, "KaiserParameter:=", 1, _ "MaximumTime:=", 6.2437437437444E-009), _ Array("Time:=", Array("All"), "OverridingValues:=", Array("0s", _ "6.24999373748188e-012s", ... )), Array("X Component:=", "Time", _ "Y Component:=", Array("TDRZ(WavePort1)")), _ Array()
ClearAllMarkers
Use: Command: Syntax: Clears all markers from a report. Report2d>Markers>ClearAllMarkers ClearAllMarkers <ReportName>
Example:
CopyTracesData
Use: Command: Syntax: Return Value: Parameters: Copy trace data for a paste operation. Select a trace in the Project tree, right-click and select Copy Data CopyTracesData <ReportName> <TracesArray>) None <ReportName> Type: <string> Name of Report. <TracesArray> Type: Array of Strings Trace definitions from which to copy corresponding data. Example: oModule.CopyTracesData "XY Plot 1", Array("magforce")
CopyReportData
Use: Command: Syntax: Return Value: Parameters: Copy all data corresponding to the specified reports. Select a report in the Project tree, right-click and select Copy Data CopyReportData <ReportsArray> None <ReportsArray> Type: Array of strings Names of reports from which to copy data. Example: oModule.CopyReportData Array("XY Plot 1")
CopyReportDefinitions
Use: Command: Syntax: Copy the definition of a report for paste operations. Select a report in the Project tree, right-click and select Copy Definition CopyReportDefinitions <ReportsArray>
Reporter Editor Script Commands 12-7
None <ReportsArray> Type: Array of strings Names of reports from which to copy the definitions.
CopyTraceDefinitions
Use: Command: Syntax: Return Value: Parameters: Copy trace definitions for a paste operation. Select a trace in the Project tree, right-click and select Copy Definition CopyTraceDefinitions <ReportName> <TracesArray> None <ReportName> Type: <string> Name of Report. <TracesArray> Type: Array of strings. Trace definitions to copy. Example: oModule.CopyTraceDefinitions "XY Plot 1", Array("magforce")
CreateReport
Use: Creates a new report with a single trace and adds it to the Results branch in the project tree. To add more traces, use the AddTraces command. To edit the display properties, use the ChangeProperty Script command. Maxwell2D or Maxwell3D>Results>Create<type> Report CreateReport <ReportName> <ReportType> <DisplayType> <SolutionName> <ContextArray> <FamiliesArray><ReportDataArray> None <ReportName> Type: <string> Name of Report. ReportType Possible values are:
12-8 Reporter Editor Script Commands
Command: Syntax:
Matrix. DC R/L Fields. AC R/L Fields. C Fields. DisplayType Rectangular Plot, Data Table, or 3D Rectangular Plot. <TraceArray> Array("NAME:Traces", <OneTraceArray>, <OneTraceArray>,...) <OneTraceArray> Array("NAME:<TraceName>, "SolutionName:=","string", "Context:=",string, <DisplayTypeDependentData>) <SolutionName> Name of the solution as listed in the Traces dialog box. For example: Setup1 : Last Adaptive <Context> Context for which the output variable expression is being evaluated. This can be an empty string if there is no context. Example: Line1 or Field reports usually require a polyline (e.g. "Line1") unless they are integrations. Q3D Extractor matrix data requires a Reduce Matrix operation(e.g. "Original"). <DisplayTypeDependentData> This data varies according to the display type. See the examples below. <FamiliesArray> Type: Array of strings Contains sweep definitions for the report. Array(<VariableName>:= , <ValueArray>) <ValueArray> Array(All) or Array(Value1, Value2, ...Valuen) examples of <VariableName>
Reporter Editor Script Commands 12-9
Freq, Theta, Distance <ReportDataArray> Type: Array of strings This array contains the report quantity and X, Y, and (Z) axis definitions. Array(X Component:=, <VariableName>, Y Component:=, <VariableName> | <ReportQuantityArray>) <ReportQuantityArray> ex. Array(dB(S(Port1, Port1))) Example: oDesign.CreateReport Array("NAME:Rept2DRectTime",_ "ReportType:=","Matrix",_ "DisplayType:=","Rectangular Plot", _ Array("NAME:Traces", _ Array("NAME:Trace1", _ SolutionName:=", _ "Setup1 : Adaptive_2, _ Context:=",Original, _ "XComponent:=", "Pass", _ "YComponent:=", C(Box1, Box1)",_ "YAxis:=", 1)))
CreateReportFromTemplate
Use: Command: Syntax: Return Value: Parameters: <ReportTemplateFileName> Type: string The report template file name. Example: oModule.CreateReportFromTemplate _ "C:\Program Files\Ansoft\HFSS11\userlib\ReportTemplates\ThreePortSParams.rpt"
12-10 Reporter Editor Script Commands
Create a report from a report template file. Select results folder in project tree, right-click, Report Templates, select appropriate template file name. CreateReportFromTemplate <ReportTemplateFileName> None
DeleteTraces
Use: Command: Syntax: Return Value: Parameters: Deletes an existing traces or traces. Right-click the report to delete in the project tree, and then click Delete on the shortcut menu. DeleteTraces(<TraceSelectionArray>) None <TraceSelectionArray> Type: Array of strings Array(<ReportName>:=, <TracesArray>, <TracesArray>,... ) <ReportName> Type: <string> Name of Report. <TracesArray> Type: Array of strings This array contains the traces to delete within a report. Array(<Trace>, <Trace>, ...) <Trace> Type: string Example: Delete 3 traces from one report: oModule.DeleteTraces Array("XY Plot 3:=", Array("Matrix1.MagFlux(Current1)", "Matrix1.MagFluxNom(Current1)", "Force1.Force_mag")) Delete 2 traces from 2 different reports: oModule.DeleteTraces Array("XY Plot 1:=", Array("magforce"), "XY Plot 3:=", Array("Matrix1.MagFlux(Current1)"))
ExportToFile
Use: Syntax: Return Value: From a data table or plot, generates text format, comma delimited, tab delimited, or .dat type output files. ExportToFile <ReportName>, <FileName> None
Reporter Editor Script Commands 12-11
Parameters:
<ReportName> Type: string <FileName> Type: string .txt .csv .tab .dat Post processor format file Comma-delimited data file Tab-separated file Ansoft plot data file
Example:
FFTOnReport
Use: Command: Syntax: Return Value: Parameters: Perform an FFT on a selected report. Right-click Results in the project tree, and then choose Perform FFT on Report on the shortcut menu.s FFTOnReport <plotName>, <FFTWindowType>, <function> Creates a plot named FFT PlotName <plotName> Type: String The name of the plot. <FFTWindowType> Type: String Rectangular, Tri, Van Hann, Hamming, Blackman,Lanczos, Weber, Welch. <function> Type: string <none>, ang_deg, ang_rad, arg, cang_deg, cang_rad, dB, dB1 normalize, dB20normalize, dBc, im, mag, normalize, re Example: Dim oAnsoftApp Dim oDesktop Dim oProject Dim oDesign Dim oEditor Dim oModule
12-12 Reporter Editor Script Commands
Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface") Set oDesktop = oAnsoftApp.GetAppDesktop() oDesktop.RestoreWindow Set oProject = oDesktop.SetActiveProject("Solenoid") Set oDesign = oProject.SetActiveDesign("SolModel") Set oModule = oDesign.GetModule("Solutions") oModule.FFTOnReport "XY Plot 1", "Rectangular", "dB"
GetAllReportNames
Use: Syntax: Return Value: Parameters: Example: Gets the names of existing reports in a design. GetAllReportNames() Array of report names. None Set reportnames = oDesign.GetAllReportNames() For Each name in reportnames Msgbox name Next
GetDisplayType
Use: Command: Syntax: Return Value: Parameters: <ReportName> Type: string The name of report to find the display type for. Example: Dim displayType displayType = oModule.GetDisplayType("XY Plot 1") Get Display type of a report. None GetDisplayType <ReportName> String for display type
ImportIntoReport
Use: Command: Syntax: Imports .tab, .csv, and .dat format files into a report. Right-click on report name in the Project tree and select Export Data. ImportIntoReport <ReportName>, <FileName>
Reporter Editor Script Commands 12-13
None <ReportName> Type: string <FileName> Type: string Path and file name. .csv .tab .dat Comma-delimited data file Tab-separated file Ansoft plot data file
PasteReports
Use: Command: Syntax: Return Value: Parameters: Example: Paste Reports from clipboard. Command: Select results folder in project tree, right-click, paste. PasteReports None None oModule.PasteReports
PasteTraces
Use: Command: Syntax: Return Value: Parameters: <ReportName> Type: string The name of report, where traces are to be pasted. Example: oModule.PasteTraces "Mag_Force" Paste traces from clipboard in a report. Select report in project tree, right click, paste. PasteTraces <ReportName> None
DeleteAllReports
Use: Command: Syntax: Return Value: Example: Deletes all existing reports. Right-click the report to delete in the project tree, and then click Delete All Reports on the shortcut menu. DeleteAllReports None oModule.DeleteAllReports
DeleteReports
Use: Command: Syntax: Return Value: Parameters: Example: Deletes an existing report or reports. Right-click the report to delete in the project tree, and then click Delete on the shortcut menu. DeleteReports(<ReportNameArray>) None <ReportNameArray> Type: Array of strings oModule.DeleteReports Array(Rept2DRectFreq)
RenameReport
Use: Command: Syntax: Return Value: Parameters: Renames an existing report. Select a report on the Project tree, right-click and select Rename RenameReport <OldReportName>, <NewReportName> None <OldReportName> Type: string <NewReportName> Type: string Example: oModule.RenameReport "XY Plot1", "MagneticForce"
RenameTrace
Use: Command: Syntax: Return Value: Edit the name of an existing trace. 'Right click, Rename" on trace item in project tree. RenameTrace <ReportName>, <OldTraceName>, <NewTraceName> None
Reporter Editor Script Commands 12-15
Parameters: <ReportName> Type: string Name of report, which contains the trace whose name, is to be edited. <OldTraceName> Type: string Old name of trace. <NewTraceName> Type: string New name of trace. Example: oModule.RenameTrace "XY Plot 1", "Flux", "RotorFlux"
UpdateTraces
Use: Command: Syntax: Edits traces of an existing report. Apply Trace button in the Create Report dialog UpdateTraces <ReportName>, <TraceNames>, <SolutionName>, <SimulatedValueContextArray>, <PointSetDefinitionArray>, <TracesExpressionArray>, <ExtendedTraceInformationArray> None <ReportName> Type: string The name of report, which contains traces to be edited. <TraceNames> Type: Array of strings The names of traces to be edited. <SolutionName> see CreateReport section <SimulatedValueContextArray> see CreateReport section <PointSetDefinitionArray> see CreateReport section <TracesExpressionsArray> see CreateReport section <ExtendedTraceInformationArray>
12-16 Reporter Editor Script Commands
see CreateReport section Example: oModule.UpdateTraces "XY Plot 1", Array("dB(S(Port1,Port1))"), "Setup1 : Sweep1", Array("Domain:=", _ "Sweep"), Array("Freq:=", Array("All"), "offset:=", Array("Nominal")), Array("X Component:=", _ "Freq", "Y Component:=", Array("dB(S(Port2,Port1))")), Array()
UpdateTracesContextAndSweeps
Use: Command: Syntax: Edits context and sweeps of traces of an existing report. 'Apply Trace' button in the Create Report dialog after selecting multiple traces in project tree. UpdateTracesContextAndSweeps <ReportName>, <TraceNames>, <SolutionName>, <SimulatedValueContextArray>, <PointSetDefinitionArray> None see UpdateTraces section oModule.UpdateTracesContextAndSweeps "S Parameters", Array("S21", "S11"), _ "Setup1 : Sweep1", Array("Domain:=", "Sweep"), Array("Freq:=", Array("8GHz", _ "8.05GHz", "8.1GHz", "8.15GHz", "8.2GHz", "8.25GHz", "8.3GHz", "8.35GHz", _ "8.4GHz", "8.45GHz", "8.5GHz", "8.55GHz", "8.6GHz", "8.65GHz", "8.7GHz", _ "8.75GHz", "8.8GHz", "8.85GHz", "8.9GHz", "8.95GHz", "9GHz"), "offset:=", Array( _ "Nominal"))
13
Boundary and excitation commands should be executed by the BoundarySetup module. Set oModule = oDesign.GetModule("BoundarySetup") oModule.CommandName <args>
DeleteBoundaries DeleteAllBoundaries DeleteAllExcitations GetBoundaries GetBoundariesOfType GetBoundaryAssignment GetNumBoundaries GetNumBoundariesOfType GetExcitations GetExcitationsOfType GetNumExcitations GetNumExcitationsOfType RenameBoundary ReassignBoundary ReprioritizeBoundaries
DeleteBoundaries
Use: Command: Syntax: Return Value: Parameters: Deletes the specified boundaries and excitations. Delete command in the Design List dialog box. (Click Maxwell3D or Maxwell2D>List to open the Design List dialog box.) DeleteBoundaries <NameArray> None <NameArray> Type: Array of strings An array of boundary names. Example: oModule.DeleteBoundaries Array("Net1", "Source1")
DeleteAllBoundaries
Use: Command: Syntax: Return Value: Example: Deletes all boundaries. Maxwell3D or Maxwell2D>Boundaries>Delete All DeleteAllBoundaries None oModule.DeleteAllBoundaries
Boundary and Excitation Module Script Commands 13-3
DeleteAllExcitations
Use: Command: Syntax: Return Value: Example: Deletes all excitations. Maxwell3D or Maxwell2D>Excitations>Delete All DeleteAllExcitations None oModule.DeleteAllExcitations
GetBoundaries
Use: Command: Syntax: Return Value: Parameters: Example: Gets boundary names for a project. None GetBoundaries() Array of boundary names. None bndinfo_array = oModule.GetBoundaries()
GetBoundariesOfType
Use: Command: Syntax: Return Value: Parameters: Gets boundary names of the given type. None GetBoundariesOfType(<BoundaryType>) Array of boundary names of the given type. <BoundaryType> Type:<string> Name of legal boundary type. For example: "Radiation" Example: bndname_array = oModule.GetBoundariesOfType("Perfect E")
GetBoundaryAssignment
Use: Command: Syntax: Return Value: Parameters: Gets a list of face IDs associated with the given boundary or excitation assignment. None GetBoundaryAssignment(<BoundaryName>) Returns integer array of face IDs. <BoundaryName> Type:<string>
13-4 Boundary and Excitation Module Script
GetNumBoundaries
Use: Command: Syntax: Return Value: Parameters: Example: Gets the number of boundaries in a design. None GetNumBoundaries() Integer count None numbound = oModule.GetNumBoundaries()
GetNumBoundariesOfType
Use: Command: Syntax: Return Value: Parameters: Example: Gets the number of boundaries of the given type. None GetNumBoundariesOfType(<BoundaryType>) Integer count <BoundaryType> Type:<string> numbound = oModule.GetNumBoundariesOfType("Perfect E")
GetExcitations
Use: Command: Syntax: Return Value: Parameters: Example: Gets excitation port and terminal names for a model. None GetExcitations() Pairs of strings. The first is the name of the excitation (e.g. "port1:1") and the second is its type ("Wave Port") None excite_name_array = oModule.GetExcitations()
GetExcitationsOfType
Use: Command: Syntax: Return Value: Parameters: Gets excitation names of the given type. None GetExcitationsOfType(<ExcitationType>) Array of excitation names of the given type. <ExcitationType>
Boundary and Excitation Module Script Commands 13-5
Type:<string> Name of legal excitation type. For example: "Plane Incident Wave". Example: excite_name_array = oModule.GetExcitationsOfType("Wave Port")
GetNumExcitations
Use: Command: Syntax: Return Value: Parameters: Example: Gets the number of excitations in a design, including all defined modes and terminals of ports. None GetNumExcitations() Integer count None numexcite = oModule.GetNumExcitations()
GetNumExcitationsOfType
Use: Command: Syntax: Return Value: Parameters: Example: Gets the number of excitations of the given type, including all defined modes and terminals of ports. None GetNumExcitationsOfType(<ExcitationType>) Integer count <ExcitationType> Type:<string> numexcite = oModule.GetNumExcitationsOfType("Voltage")
RenameBoundary
Use: Command: Syntax: Return Value: Parameters: Renames a boundary or excitation. Right-click a boundary/excitation in the project tree, and then click Rename from the shortcut menu. RenameBoundary <OldName>, <NewName> None <OldName> Type: <string> <NewName> Type: <string> Example: oModule.RenameBoundary "Bound1" "Bound2"
ReassignBoundary
Use: Command: Syntax: Specifies a new geometry assignment for a boundary. Select Maxwell3D or Maxwell2D>Excitations>Reassign or select Maxwell3D or Maxwell2D>Boundaries>Reassign ReassignBoundary Array("Name:<BoundName>", "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>) Return Value: Example: None oModule.ReassignBoundary Array("NAME:Net1",_ "Objects:=", Array("Box2", "Box3"),_ "Objects:=", Array("Box3", "Box4"))
ReprioritizeBoundaries
Use: Note Specifies the order that the boundaries are sent to the solver. The first boundary in the list has the highest priority. This command is only valid if all boundaries appear in the list. Maxwell3D or Maxwell2D>Boundaries>Reprioritize ReprioritizeBoundaries <NewOrderArray> None <NewOrderArray> Array("NAME:NewOrder", <BoundName>, <BoundName>, ...) Example: oModule.ReprioritizeBoundaries Array("NAME:NewOrder",_ "Symmetry1", "Insulating1")
AssignZeroTangentialHField EditZeroTangentialHField AssignInsulating EditInsulating AssignSymmetry EditSymmetry AssignMaster EditMaster AssignSlave EditSlave AssignRadiation EditRadiation AssignImpedance EditImpedance AssignTangentialHField EditTangentialHField AssignCylindricalHField EditCylindricalHField
AssignZeroTangentialHField
Use: Command: Syntax: Return Value: Parameters: Creates a zero tangential H-Field boundary. Maxwell>Boundaries>Assign>Zero Tangential H Field AssignZeroTangentialHField <ZeroTangentialHFieldArray> None <ZeroTangentialHFieldArray> Array("NAME:<BoundName>", "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>) Example: oModule.AssignZeroTangentialHField Array("NAME:ZeroTangentialHField1", "Faces:=", Array(7))
EditZeroTangentialHField
Use: Command: Syntax: Return Value: Edits a zero tangential H-Field boundary. Double-click the boundary in the project tree to edit it. EditZeroTangentialHField <BoundName>, <PerfectEArray> None
AssignSymmetry
Use: Command: Syntax: Return Value: Parameters: Creates a symmetry boundary. Maxwell3D or Maxwell2D>Boundaries>Assign>Symmetry AssignSymmetry <SymmetryArray> None <SymmetryArray> Array( "NAME:<BoundName>", "IsOdd:=",<bool>,//true for odd, false for even "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>) Example: oModule.AssignSymmetry Array("NAME:Symmetry1", _ "IsOdd:=", true, "Faces:=", Array(35))
EditSymmetry
Use: Command: Syntax: Return Value: Edits a symmetry boundary. Double-click the boundary in the project tree to edit it. EditSymmetry <BoundName> < SymmetryArray > None
AssignInsulating
Use: Command: Syntax: Return Value: Parameters: Creates an insulating boundary. Maxwell3D>Boundaries>Assign>Insulating AssignInsulating <InsulatingArray> None <InsulatingArray> Array("Name:<BoundName>", "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces> "Permittivity:=", <double value>
Boundary and Excitation Module Script Commands 13-9
"Thickness:=", <value><unit> Example: oModule.AssignInsulating Array("NAME:Insulating2", "Faces:=", Array(9), "Permittivity:=", "3", "Thickness:=", "5mm")
EditInsulating
Use: Command: Return Value: Return Value: Parameters: Edits an insulating boundary. Double-click the boundary in the project tree to edit it. EditInsulating <BoundName> <InsulatingArray> None <BoundName> , string name of boundary <InsulatingArray> Array("Name:<BoundName>", "Permittivity:=", <double value> "Thickness:=", <value><unit> Example: oModule.EditInsulating "Insulating2", Array("NAME:Insulating2", "Permittivity:=", "5", "Thickness:=", "7meter")
AssignMaster
Use: Command: Syntax: Return Value: Parameters: Creates a master boundary. Maxwell3D or Maxwell2D>Boundaries>Assign>Master AssignMaster <MasterArray> None <MasterArray> Array("NAME:<BoundName>", <CoordSysArray>, "ReverseV:=", <bool>, "Faces:=", <AssignmentFaces>) Example: oModule.AssignMaster Array("NAME:Master1", _ Array("NAME:CoordSysVector", "Origin:=", _ Array("1.6mm", "1.2mm", "0mm"), "UPos:=", _ Array("1.6mm", "1.2mm", "1mm")), "ReverseV:=", true, _ "Faces:=", Array(68))
EditMaster
Use: Command: Syntax: Return Value: Edits a master boundary. Double-click the boundary in the project tree to edit it. Edit <BoundName> <MasterArray> None
AssignSlave
Use: Command: Syntax: Return Value: Parameters: Creates a slave boundary. Maxwell3D or Maxwell2D>Boundaries>Assign>Slave AssignSlave <SlaveArray> None <SlaveArray> Array("NAME:<BoundName>", <CoordSysArray>, "ReverseV:=", <bool>, "Master:=", <string>, "RelationIsSame:=", <bool>,//true for Hs = Hm "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>) Example: oModule.AssignSlave Array("NAME:Slave1", _ Array("NAME:CoordSysVector", "Origin:=", _ Array( "1.6mm", "1.2mm", "0mm"), "UPos:=", _ Array("1.6mm", "1.2mm", "1mm")), "ReverseV:=", _ false, "Master:=", "Master1", "RelationIsSame:=", _ false, "Faces:=", Array(67))
EditSlave
Use: Command: Syntax: Return Value: Edits a slave boundary. Double-click the boundary in the project tree to edit it. EditSlave <BoundName> <SlaveArray> None
AssignRadiation
Use: Command: Syntax: Creates a radiation boundary. Maxwell3D>Boundaries>Assign>Radiation AssignRadiation <RadiationArray>
Boundary and Excitation Module Script Commands 13-11
Example:
EditRadiation
Use: Command: Syntax: Return Value: Edits a radiation boundary. Double-click the boundary in the project tree to edit it. EditRadiation <BoundName> <RadiationArray> None
AssignImpedance
Use: Command: Syntax: Return Value: Parameters: Creates an impedance boundary. Maxwell3D or Maxwell2D>Boundaries>Assign>Impedance AssignImpedance <ImpedanceArray> None <ImpedanceArray> Array("NAME:<BoundName>", "Conductivity:=",<value>, "Resistance:=", <value>, "Permeability:=", <value>, "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>) Example: oModule.AssignImpedance Array("NAME:Impedance1", _ "Conductivity:=", "1", "Permeability:=", "2", _ "Faces:=", Array(7, 12))
EditImpedance
Use: Command: Syntax: Return Value: Edits an impedance boundary. Double-click the boundary in the project tree to edit it. EditImpedance <BoundName> <ImpedanceArray> None
AssignTangentialHField
Use: Command: Syntax: Return Value: Parameters: Creates an H-Field boundary on a planar face. Maxwell3D>Boundaries>Assign>Tangential H Field AssignTangentialHField <TangentialHFieldArray> None <TangentialHFieldArray> Array("NAME:<BoundName>", "ComponentXReal:=", <value>, "ComponentXImg:=", <value>, "ComponentYReal:=", <value>, "ComponentYImg:=", <value>, <CoordSysArray> "ReverseV:=", <bool>, "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentObjects>) Example: oModule.AssignTangentialHField Array("NAME:TangentialHField2", "ComponentXReal:=", _ "1", "ComponentXImg:=", "2", "ComponentYReal:=", "3", _ "ComponentYImg:=", "4", Array("NAME:CoordSysVector", _ "Origin:=", Array( "-0.4mm", "-1.4mm", "1mm"), "UPos:=", _ Array("-0.4mm", "-0.8mm", "1mm")), "ReverseV:=", true, _ "Faces:=", Array(7))
EditTangentialHField
Use: Command: Syntax: Return Value: Edits a tangential H-Field boundary. Double-click the boundary in the project tree to edit it. EditTangentialHField <BoundName> <TangentialHFieldArray> None
AssignCylindricalHField
Use: Command: Syntax: Return Value: Creates an H-Field boundary on a cylindrical face. Maxwell>Boundaries>Assign>Tangential H Field AssignCylindricalHField <CylindricalHFieldArray> None
Boundary and Excitation Module Script Commands 13-13
Parameters:
<CylindricalHFieldArray> Array("NAME:<BoundName>", "ComponentPhiReal:=", <value>, "ComponentPhiImg:=", <value>, "ComponentZReal:=", <value>, "ComponentZImg:=", <value>, "ReverseZ:=", <bool>, "Origin:=", <LineEndPoint>) "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentObjects>)
Example:
oModule.AssignCylindricalHField Array("NAME:TangentialHField4", "ComponentPhiReal:=", _ "1", "ComponentPhiImg:=", "2", "ComponentZReal:=", "3", _ "ComponentZImg:=", "4", "ReverseZ:=", false, _ "ReferencePosDefined:=", true, "Origin:=", _ Array("1.36568542494924mm", "0.6mm", "0mm"), _ "Faces:=", Array(75))
EditCylindricalHField
Use: Command: Syntax: Return Value: Edits a cylindrical H-Field boundary. Double-click the boundary in the project tree to edit it. EditCylindricalHField <BoundName> <CylindricalHFieldArray> None
AssignVoltage AssignVoltageGroup EditVoltage AssignVoltageDrop AssignVoltageDropGroup EditVoltageDrop AssignCurrentDensity AssignCurrentDensityGroup EditCurrentDensity AssignCurrentDensityTerminal AssignCurrentDensityTerminalGroup EditCurrentDensityTerminal AssignCurrent AssignCurrentGroup EditCurrent AssignFloating EditFloating AssignCharge EditCharge AssignVolumeChargeDensity EditVolumeChargeDensity AssignCoilTerminal AssignCoilTerminalGroup EditCoilTerminal AssignSink EditSink
AssignVoltage
Use: Command: Syntax: Return Value: Creates a voltage excitation. Maxwell>Excitations>Assign>Voltage AssignVoltage <SourceArray> None
Boundary and Excitation Module Script Commands 13-15
Parameters:
Example:
AssignVoltageGroup
Use: Creates a group of voltage excitations. The size of the bound name array must be identical to the size of assignment. This command is not supported for the Electric solution types. Maxwell>Excitations>Assign>Voltage AssignVoltageGroup <BoundNameArray> <VoltageArray> None oModule.AssignVoltageGroup Array("VoltageSrc2_1", _ "VoltageSrc2_2"), Array("NAME:VoltageSrc2_1", _ "Voltage:=", "0V", "Faces:=", Array(12, 11))
EditVoltage
Use: Command: Syntax: Return Value: Edits a voltage excitation. Double-click the excitation in the project tree to edit it. EditVoltage <BoundName> <VoltageArray> None
AssignVoltageDrop
Use: Command: Syntax: Return Value: Parameters: Creates a voltage drop excitation. Maxwell>Excitations>Assign>Voltage Drop AssignVoltageDrop <VoltageDropArray> None <VoltageDropArray> Array("NAME:<BoundName>", "Voltage Drop:=", <value>, "Point out of terminal:=", <bool>, "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>)
Example:
oModule.AssignVoltageDrop Array("NAME:VoltageDrop1", _ "Voltage Drop:=", "1kV", "Point out of terminal:=", _ true, "Faces:=", Array(7))
AssignVoltageDropGroup
Use: Command: Syntax: Return Value: Creates a group of voltage drop excitations. Maxwell>Excitations>Assign>Voltage Drop AssignVoltageDropGroup <BoundNameArray> <VoltageDropArray> None
EditVoltageDrop
Use: Command: Syntax: Return Value: Edits a voltage drop excitation. Double-click the excitation in the project tree to edit it. EditVoltageDrop <BoundName> <VoltageDropArray> None
AssignCurrentDensity
Use: Command: Syntax: Return Value: Parameters: Creates a current density excitation. Maxwell>Excitations>Assign>Current Density AssignCurrentDensity <CurrentDensityArray> None <CurrentDensityArray> Array("NAME:<BoundName>", "CurrentDensityX:=", <value>, "Phase:=", <value>,//for eddy current solution type "CurrentDensityY:=", <value>, "CurrentDensityZ:=", <bool>, "CoordinateSystem Name:=", <string>, "CoordinateSystem Type:=", <string>, "Objects:=", <AssignmentObjects>) Example: oModule.AssignCurrentDensity Array("NAME:CurrentDensity1", "CurrentDensityX:=", _ "1", "CurrentDensityY:=", "2", "CurrentDensityZ:=", _ "3", "CoordinateSystem Name:=", "Global", _
"CoordinateSystem Type:=", "Cartesian", "Objects:=", _ Array("Box1")) Example: oModule.AssignCurrentDensity Array("NAME:CurrentDensity1", "Phase:=", "12", _ "CurrentDensityX:=", "1", "CurrentDensityY:=", _ "2", "CurrentDensityZ:=", "3", _ "CoordinateSystem Name:=", "Global", "CoordinateSystem Type:=", "Cartesian", "Objects:=", _ Array("Box1"))
AssignCurrentDensityGroup
Use: Command: Syntax: Return Value: Creates a group of current density excitations. Maxwell>Excitations>Assign>Current Density AssignCurrentDensityGroup <BoundNameArray> <CurrentDensityArray> None
EditCurrentDensity
Use: Command: Syntax: Return Value: Edits a current density excitation. Double-click the excitation in the project tree to edit it. EditCurrentDensity <BoundName> <CurrentDensityArray> None
AssignCurrentDensityTerminal
Use: Command: Syntax: Return Value: Parameters: Creates a current density terminal excitation. Maxwell>Excitations>Assign>Current Density Terminal AssignCurrentDensityTerminal <CurrentDensityTerminalArray> None <CurrentDensityTerminalArray> Array("Name:<BoundName>", "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>) Example: oModule.AssignCurrentDensityTerminal Array("NAME:CurrentDensityTeminal1", "Faces:=", Array(7))
AssignCurrentDensityTerminalGroup
Use: Command: Syntax: Return Value: Creates a group of current density terminal excitations. Maxwell>Excitations>Assign>Current Density Terminal AssignCurrentDensityTerminalGroup <BoundNameArray> <CurrentDensityTerminalArray> None
EditCurrentDensityTerminal
Use: Note: Syntax: Return Value: Edits a current density terminal excitation. Double-click the excitation in the project tree to edit it. EditCurrentDensityTerminal <BoundName> <CurrentDensityTerminalArray> None
AssignCurrent
Use: Command: Syntax: Return Value: Parameters: Creates a current excitation. Maxwell>Excitations>Assign>Current AssignCurrent <SourceArray> None <SourceArray> Array("NAME:<SourceName>", "Faces:=", <AssignmentFaces>) Example: oModule.AssignCurrent Array("NAME:Source1",_ "Faces:=", Array(12))
AssignCurrentGroup
Use: Command: Syntax: Return Value: Creates a group of current excitations. Maxwell>Excitations>Assign>Current AssignCurrentGroup <BoundNameArray> <CurrentArray> None
EditCurrent
Use: Command: Syntax: Edits a current excitation. Double-click the excitation in the project tree to edit it. EditCurrent <BoundName> <CurrentArray>
Boundary and Excitation Module Script Commands 13-19
Return Value:
None
AssignFloating
Use: Command: Syntax: Return Value: Parameters: Creates a floating excitation. Maxwell>Boundaries>Assign>Floating AssignFloating <FloatingArray> None <FloatingArray> Array("NAME:<BoundName>", "Value:=", <value>, "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>) Example: oModule.AssignFloating Array("NAME:Floating1", _ "Value:=", "1", "Faces:=", Array(11))
EditFloating
Use: Command: Syntax: Return Value: Edits a floating excitation. Double-click the excitation in the project tree to edit it. EditFloating <BoundName> <FloatingArray> None
AssignCharge
Use: Command: Syntax: Return Value: Parameters: Creates a charge excitation. Maxwell>Excitations>Assign>Charge AssignCharge <ChargeArray> None <ChargeArray> Array("NAME:<BoundName>", "Value:=", <value>, "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>) Example: oModule.AssignCharge Array("NAME:Charge1", "Value:=", _ "1", "Faces:=", Array(11))
EditCharge
Use: Command: Syntax: Return Value: Edits a charge excitation. Double-click the excitation in the project tree to edit it. EditCharge <BoundName> <ChargeArray> None
AssignVolumeChargeDensity
Use: Command: Syntax: Return Value: Parameters: Creates a volume charge density excitation. Maxwell>Excitations>Assign>Volume Charge Density AssignVolumeChargeDensity <VolumeChargeDensityArray> None <VolumeChargeDensityArray> Array("NAME:<BoundName>", "Value:=", <value>, "CoordinateSystem :=", <string>, "Objects:=", <AssignmentObjects>) Example: oModule.AssignVolumeChargeDensity Array("NAME:VolumeChargeDenstiy1", "Value:=", "1", _ "CoordinateSystem:=", "", "Objects:=", Array("Box1")) oModule.AssignVolumeChargeDensity Array("NAME:x", _ "Value:=", "y", "CoordinateSystem:=", "Global", _ "Objects:=", Array("Box2"))
Example:
EditVolumeChargeDensity
Use: Command: Syntax: Return Value: Edits a volume charge density excitation. Double-click the excitation in the project tree to edit it. EditVolumeChargeDensity <BoundName> <VolumeChargeDensityArray> None
AssignCoilTerminal
Use: Command: Syntax: Parameters: Assigns 2D terminals Maxwell>Excitations>Assign>Coil Terminal AssignCoilTerminal <TerminalArray> <TerminalArray> Array("NAME:AssignTerminals",
Boundary and Excitation Module Script Commands 13-21
Array("Name:SourceList", Array("Name:<SourceName>", "Excitation:=", <NetObject>, "Objects:=", <Assignment 2D>)), Array("Name:SinkList", Array("Name:<SinkName>", "Excitation:=", <NetObject>, "Objects:=", <Assignment 2D>)), "Name:DeleteList", <Name Array>) Return Value: Example: None OModule.Assign2DTerminals Array("NAME:AssignTerminals", Array("NAME:SourceList", Array("NAME:Source2", "Net:=",_ "Box2", "Objects:=", Array("Rectangle1"))), _ Array("NAME:SinkList", Array("NAME:Sink1", "Net:=", _ "Box1", "Objects:=", Array("Rectangle2"))), _ "DeleteList:=", "") oModule.AssignPerfectH Array("NAME:PerfH1", "Faces:=", _ Array(12))
AssignCoilTerminalGroup
Use: Command: Syntax: Return Value: Creates a group of coil terminal excitations. Maxwell>Excitations>Assign>Coil Terminal AssignCoilTerminal <BoundNameArray> <CoilTerminalArray> None
EditCoilTerminal
Use: Command: Syntax: Return Value: Edits a coil terminal excitation. Double-click the excitation in the project tree to edit it. EditCoilTerminal <BoundName> <CoilTerminalArray> None
AssignSink
Use: Command: Syntax: Return Value: Parameters: Creates a sink. Maxwell>Excitations>Assign>Sink AssignSink <SinkArray> None <SinkArray> Array("NAME:<SinkName>", "Faces:=", <AssignmentFaces>)
13-22 Boundary and Excitation Module Script
Example:
EditSink
Use: Command: Syntax: Return Value: Edits a sink excitation. Double-click the excitation in the project tree to edit it. EditSink <BoundName> <SinkArray> None
AssignWindingGroup
Use: Command: Syntax: Return Value: Parameters: <WindingGroupArray> Array("NAME:<BoundName>", "Type:=",<WindingType>, "IsSolid:=", <bool>, stranded "Current:=", <value>, "Resistance:=", <value>, "Inductance:=", <value>, "Voltage:=", <value>, ) Example: oModule.AssignWindingGroup Array("NAME:Winding1", _ "Type:=", "Voltage", "IsSolid:=", _false, _ "Current:=", "4A", "Resistance:=", "5Ohm", _ "Inductance:=", "6mH", "Voltage:=", "7V") Example: oModule.AssignWindingGroup Array("NAME:Winding2", _ "Type:=", "Current", "IsSolid:=", false, "Current:=", _ //true for solid, false for Creates a winding group. Maxwell>Excitations>Add Winding AssignWindingGroup <WindingGroupArray > None
"1A", "Resistance:=", "0Ohm", "Inductance:=", "0mH", _ "Voltage:=", "0V") Example: oModule.AssignWindingGroup Array("NAME:Winding3", _ "Type:=", "External", "IsSolid:=", true, "Current:=", _ "1A", "Resistance:=", "0Ohm", "Inductance:=", "0mH", _ "Voltage:=", "0V")
EditWindingGroup
Use: Command: Syntax: Return Value: Edits a winding group. Double-click the winding group item in the project tree to edit it. EditWindingGroup <BoundName> <WindingGroupArray> None
AddTerminalsToWinding
Use: Command: Syntax: Return Value: Parameters: Adds existing terminal(s) to the selected winding. Right-click a winding item in the project tree, and then select Add Terminals. AddTerminalsToWinding <AddTerminalsToWindingArray> None < AddTerminalsToWindingArray > Array(" NAME:AddTerminalsToWinding", <BoundListArray>) <BoundListArray> Array("NAME:BoundaryList",<CoilTerminalArray>) Example: oModule.AddTerminalstoWinding Array("NAME:AddTerminalsToWinding", _ Array("NAME:BoundaryList", Array("NAME:CoilTerminal1", _ "Point out of terminal:=", false, "Conductor number:=", _ "1", "Winding:=", "Winding1", "Faces:=", Array(12)), _ Array("NAME:CoilTerminal2", "Point out of terminal:=", _ false, "Conductor number:=", "1", "Winding:=", _ "Winding1", "Faces:=", Array(7))))
EditExternalCircuit
Use: Edits the external circuit for the winding. The SourceNameArray and SourceTypeArray parameters must be of the same size and be a one-to-one match. Maxwell>Excitations>External Circuit>Edit External Circuit
Boundary and Excitation Module Script Commands 13-25
Command:
EditExternalCircuit <fileName> <SourceNameArray> <SourceTypeArray> None <SourceNameArray> Array(<string>) <SourceTypeArray> Array(<srcTypeEnum>)<srcTypeEnum> 1- Time dependent 2-Position dependent 3- Speed dependent
Example:
SetCoreLoss
Use: Turns on the core loss effect. Please list all the objects that need to turn on the core loss effect. If an object is not in the list, then it is treated as core loss effect "off". This setting only takes effect if the object has the corresponding core loss definition in the material library. Maxwell>Excitation>Set Core Loss SetCoreLoss <ObjectNameArray> None < ObjectNameArray > Array("<objectName>"), <bool>, //true to apply core loss effect on field, false means do not apply core loss effect. Default is false. <objectName> string Example: oModule.SetCoreLoss Array("Box1", "Box2"), true
SetEddyEffect
Use: Command: Syntax: Return Value: Parameters: <EddyEffectSettingArray> Array("NAME:Eddy Effect Setting", <EddyEffectVectorArray>) <EddyEffectVectorArray> Array("NAME:EddyEffectVector", Array<EddyEffectDataArray>)
13-26 Boundary and Excitation Module Script
Sets the eddy effect for an excitation. Maxwell>Excitations>Set Eddy Effects SetEddyEffect <EddyEffectSettingArray> None
<EddyEffectDataArray> Array(("NAME:Data", "Object Name:=", <string>, "Eddy Effect:=", <bool>, "DisplacementCurrent:=", <bool>) Example: oModule.SetEddyEffect Array("NAME:Eddy Effect Setting", _ Array("NAME:EddyEffectVector", Array("NAME:Data", _ "Object Name:=", "Box1", "Eddy Effect:=", true, _ "Displacement Current:=", true), Array("NAME:Data", _ "Object Name:=", "Box1_1", "Eddy Effect:=", true, _ "Displacement Current:=", false))) Example: oModule.SetEddyEffect Array("NAME:Eddy Effect Setting", _ Array("NAME:EddyEffectVector", Array("NAME:Data", _ "Object Name:=", "Box1", "Eddy Effect:=", true), _ Array("NAME:Data", "Object Name:=", "Box1_1", _ "Eddy Effect:=", false)))
SetMinimumTimeStep
Use: Command: Syntax: Return Value: Parameters: Example: Sets the minimum time step for an external circuit excitation. Maxwell>Excitations>External Circuit>Set Minimum Time Step SetMinimumTimeStep <value> None None oModule.SetMinimumTimeStep "1ps"
14
Mesh setup and operations commands should be executed by the MeshSetup module. Set oModule = oDesign.GetModule("MeshSetup") oModule.CommandName <args>
DeleteOp
Use: Command: Syntax: Return Value: Parameters: Deletes the specified mesh operations. Delete command in the List dialog box. Click Maxwell3D or Maxwell2D>List to access the List dialog box. DeleteOp <NameArray> None <NameArray> Type: Array of strings. An array of mesh operation names. Example: oModule.DeleteOp Array("Length1", "SkinDepth1",_ "Length2")
GetOperationNames
Use: Syntax: Return Value: Parameters: Example: Use: Gets the names of mesh operations defined in a design. Syntax: GetOperationNames(<OperationType>) Return Value: Array of mesh operation names. <OperationType> Type: <string> Set opnames = oModule.GetOperationNames(Length Based) For Each name in opnames Msgbox name Next
RenameOp
Use: Command: Syntax: Return Value: Renames a mesh operation. Right-click the mesh operation in the project tree, and then click Rename on the shortcut menu. RenameOp <OldName>, <NewName> None
Mesh Operations Module Script Commands 14-3
Parameters:
<OldName> Type: <string> Old name of the mesh operation. <NewName> Type: <string> New name of the mesh operation.
Example:
AssignLengthOp
Use: Command: Assigns length-based operations to the selection. Maxwell3D or Maxwell2D>Mesh Operations>Assign>On Selection>Length Based or Maxwell3D or Maxwell2D>Mesh Operations>Assign>Inside Selection>Length Based AssignLengthOp <LengthOpParams> None <LengthOpParams> Array("NAME:<OpName>", "RefineInside:=", <bool>, "Objects:=", <AssignmentObjects>, "Faces:=", <AssignmentFaces>, "RestrictElem:=", <bool> "NumMaxElem:=", <integer> "RestrictLength:=", <bool> "MaxLength:=", <value>) RefineInside If true, Objects should be specified. Implies apply restrictions to tetrahedra inside the object. If false, Faces and/or Objects can be specified.
Mesh Operations Module Script Commands 14-5
Implies apply restrictions to triangles on the surface of the face or object. RestrictElem If true, NumMaxElem should be specified. RestrictLength If true, MaxLength should be specified. Example: Assigning length-based operations to the inside tetrahedra of an object: oModule.AssignLengthOp Array("NAME:Length1", _ "RefineInside:=", true, _ "Objects:=", Array("Box1"), _ "RestrictElem:=", true, _ "NumMaxElem:=", 1000, _ "RestrictLength:=", "MaxLength:=", "1mm") true, _
AssignSkinDepthOp
Use: Command: Syntax: Return Value: Parameters: Assigns a skin-depth based operation to the selection. Maxwell3D or Maxwell2D>Mesh Operations>Assign>On Selection>Skin Depth Based AssignSkinDepthOp <SkinDepthOpParams> None <SkinDepthOpParams> Array("NAME:<OpName>", "Faces:=", <AssignmentFaces>, "RestrictElem:=", <bool>, "NumMaxElem:=", <int>, "SkinDepth:=", <value>, "SurfTriMaxLength:=", <value>, "NumLayers:=", <int>) RestrictElem If true, NumMaxElem should be specified. Example: oModule.AssignSkinDepthOp Array("NAME:SkinDepth1", _ "Faces:=", Array(7), _ "RestrictElem:=", true, _ "NumMaxElem:=", 1000, _ "SkinDepth:=", "1mm", _
14-6 Mesh Operations Module Script Commands
AssignTrueSurfOp
Use: Command: Syntax: Return Value: Parameters: Assigns a true surface-based mesh operation to the selection. Maxwell3D or Maxwell2D>Mesh Operations>Assign>Surface Approximation AssignTrueSurfOp <TrueSurfOpParams> None <TrueSurfOpParams> Array("NAME:<OpName>", "Faces:=", <AssignmentFaces>, "SurfDevChoice:=", <RadioOption>, "SurfDev:=", <value>, "NormalDevChoice:=", <RadioOption>, "NormalDev:=", <value>, "AspectRatioChoice:=", <RadioOption>, "AspectRatio:=", <double>) <RadioOption> Type: <int> 0: Ignore 1: Use defaults 2: Specify the value Example: oModule.AssignTrueSurfOp Array("NAME:TrueSurf1", _ "Faces:=", Array(9), _ "SurfDevChoice:=", 2, _ "SurfDev:=", "0.04123105626mm", _ "NormalDevChoice:=", 2, _ "NormalDev:=", "15deg", _ "AspectRatioChoice:=", 1)
AssignModelResolutionOp
Use: Command: Assigns a model resolution name, value and unit for mesh operations. Maxwell3D>Mesh Operations>Assign>Model Resolution
Example:
EditLengthOp
Use: Edits an existing length-based operation. This cannot be used to modify assignments. Instead, the mesh operation should be deleted and a new one created. Double-click the operation in the project tree to modify its settings. EditLengthOp <OpName>, <LengthOpParams> None oModule.EditLengthOp "Length1", Array("NAME:Length1", _ "RefineInside:=", false, _ "RestrictElem:=", false, _ "RestrictLength:=", true, _ "MaxLength:=", "2mm")
EditSkinDepthOp
Use: Modifies an existing skin-depth based mesh operation. Assignments cannot be changed using this command. To change the assignment, you must delete the operation and create it using a new assignment. Double-click the operation in the project tree to modify its settings. EditSkinDepthOp <OpName>, <SkinDepthOpParams> None oModule.EditSkinDepthOp "SkinDepth1", Array("NAME:SkinD",_ "RestrictElem:=", false, _ "SkinDepth:=", "2mm", _ "SurfTriMaxLength:=", "1mm", _ "NumLayers:=", 2)
EditTrueSurfOp
Use: Modifies an existing true surface approximation-based mesh operation. Assignments cannot be changed using this command. To change the assignment, delete this operation and create it using a new assignment. Double-click the operation in the project tree to modify its settings. EditTrueSurfOp <OpName>, <TrueSurfOpParams>
Command: Syntax:
None oModule.EditTrueSurfOp "TrueSurf2", _ Array("NAME:trusurf", _ "SurfDevChoice:=", 2, _ "SurfDev:=","0.03mm", _ "NormalDevChoice:=", 1, _ "AspectRatioChoice:=", 2, _ "AspectRatio:=", 10)
EditModelResolutionOp
Use: Command: Example: Assigns a model resolution name, value and unit for mesh operations. Double-click the operation in the Project tree to modify its settings. oModule.EditModelResolutionOp Array("NAME:ModelResolution1", "Objects:=", Array( _ "Rectangle2"), "DefeatureLength:=", "0.3mm")
15
Maxwell analysis setup commands should be executed by the Analysis module, referred to in Maxwell scripts as the AnalysisSetup module. Set oModule = oDesign.GetModule("AnalysisSetup") oModule.CommandName <args>
PasteSetup
InsertSetup
Use: Command: Syntax: Return Value: Parameters: <SetupType> Type: <string> Possible values for 3D designs are: "Magnetostatic", "EddyCurrent", "Transient", "Electrostatic", "DCConduction", "ElectroDCConduction", and "ElectricTransient". Possible values for 2D designs are: "Magnetostatic", "EddyCurrent", "Transient", "Electrostatic", "ACConduction", "DCConduction". <AttributesArray> Array("NAME:<SetupName>", <NamedParameters>) <NamedParameters> The named parameters vary according to the setup type. Please see the specific examples below for each solution type.
15-2 Analysis Module Script Commands
Adds a new solution setup. Maxwell3D or Maxwell2D>Analysis Setup>Add Solution Setup InsertSetup <SetupType>, <AttributesArray> None
Example: 3D Magnetostatic solve setup: oModule.InsertSetup "Magnetostatic", Array("NAME:Setup1", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false, _ "NonLinearResidual:=", 0.001, _ "MuNonLinearBH:=", true, _ "ComputeHc:=", false, _ "HcNonLinearBH:=", true, _ "UserOverrideMu:=", true, _ "UserExePath:=", "E:\views\projects\ucp.exe", _ "UserExeArg:=", "-3D") Example: 3D EddyCurrent solve setup: oModule.InsertSetup "EddyCurrent", Array("NAME:Setup1", _ "Enabled:=", true, _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseIterativeSolver:=", true, _ "RelativeResidual:=", 0.00013, _ "ComputeForceDensity:=", false, _ "ComputePowerLoss:=", false, _ "ThermalFeedback:=", true, _ "Frequency:=", "60Hz", _ "HasSweepSetup:=", false _ "UseHighOrderShapeFunc:=", false)
Example: 3D Transient solve setup: oModule.InsertSetup "Transient", Array("NAME:Setup1", _ "NonlinearSolverResidual:=", 0.005, _ "StopTime:=", "0.01s", _ "TimeStep:=", "0.002s", _ "OutputError:=", false, _ "UseControlProgram:=", false, _ "ControlProgramName:=", " ", _ "ControlProgramArg:=", " ", _ "CallCtrlProgAfterLastStep:=", false, _ "HasSweepSetup:=", false, _ "OutputVarCalTimeStep:=", "0.002s", _ "OutputVarCalNumOfSolveSteps:=", 1, _ "OutputVarCalTimeMethod:=", 0, _ "NumberOfOutputVars:=", 0, _ "TransientHcNonLinearBH:=", true, _ "TransientComputeHc:=", false, _ "PreAdaptMesh:=", false, _ "TransientComputePowerLoss:=", false, _ "TransientComputeForceDensity:=", false) Example: 3D Electrostatic solve setup: oModule.InsertSetup "Electrostatic", Array("NAME:Setup1", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false) Example: 3D DCConduction solve setup: oModule.InsertSetup "DCConduction", Array("NAME:Setup2", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _
15-4 Analysis Module Script Commands
"MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false) Example: 3D ElectroDCConduction solve setup: oModule.InsertSetup "ElectroDCConduction", Array("NAME:Setup3", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false) Example: 3D ElectricTransient solve setup: oModule.InsertSetup "ElectricTransient", Array("NAME:Setup1", _ "Tolerance:=", 0.005, _ Array("NAME:Data", _ "SaveField:=", true, _ "Stop:=", "100s", _ "InitialStep:=", "0.01s", _ "MaxStep:=", "5s"), _ "Initial Voltage:=", "0V", _ "NumberOfOutputVars:=", 0) Example: 2D Magnetostatic solve setup: oModule.InsertSetup "Magnetostatic", Array("NAME:Setup1", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _
Analysis Module Script Commands 15-5
"PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false, _ "NonLinearResidual:=", 0.0001, _ "MuNonLinearBH:=", true, _ "ComputeHc:=", false, _ "HcNonLinearBH:=", true "UserOverrideMu:=", true, _ "UserExePath:=", "E:\views\projects\ucp.exe", _ "UserExeArg:=", "-3D") Example: 2D EddyCurrent solve setup: oModule.InsertSetup "EddyCurrent", Array("NAME:Setup1", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false, _ "Frequency:=", "60Hz", _ "NonLinearResidual:=", 0.0001, _ "HasSweepSetup:=", false) Example: 2D Transient solve setup: oModule.InsertSetup "Transient", Array("NAME:Setup1", _ "NonlinearSolverResidual:=", 0.0001, _ "StopTime:=", "0.01s", _ "TimeStep:=", "0.002s", _ "OutputError:=", false, _ "UseControlProgram:=", false, _ "ControlProgramName:=", " ", _ "ControlProgramArg:=", " ", _ "CallCtrlProgAfterLastStep:=", false, _
15-6 Analysis Module Script Commands
"HasSweepSetup:=", false, _ "OutputVarCalTimeStep:=", "0.002s", _ "OutputVarCalNumOfSolveSteps:=", 1, _ "OutputVarCalTimeMethod:=", 0, _ "NumberOfOutputVars:=", 0, _ "TransientHcNonLinearBH:=", true, _ "TransientComputeHc:=", false, _ "PreAdaptMesh:=", false, _ "UseAdaptiveTimeStep:=", false, _ "InitialTimeStep:=", "0.002s", _ "MinTimeStep:=", "0.001s", _ "MaxTimeStep:=", "0.003s", _ "TimeStepErrTolerance:=", 0.0001) Example: 2D Electrostatic solve setup: oModule.InsertSetup "Electrostatic", Array("NAME:Setup1", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false) Example: 2D ACConduction solve setup: oModule.InsertSetup "ACConduction", Array("NAME:Setup1", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false, _ "Frequency:=", "60Hz", _ "HasSweepSetup:=", false)
Example:
2D DCConduction solve setup: oModule.InsertSetup "DCConduction", Array("NAME:Setup1", _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false)
EditSetup
Use: Command: Syntax: Return Value: Parameters: <SetupName> Type: <string> Name of the solution setup being edited. <AttributesArray> Array("NAME:<NewSetupName>", <NamedParameters>) NamedParameters depend upon the solution type of the design. See InsertSetup for additional details and examples. Example: 3D EddyCurrent edit setup: oModule.EditSetup "Setup1", _ Array("NAME:Setup1", _ "Enabled:=", true, _ "MaximumPasses:=", 10, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseIterativeSolver:=", true, _ "RelativeResidual:=", 0.00013, _
15-8 Analysis Module Script Commands
Modifies an existing solution setup. Double-click a solution setup in the project tree to modify its settings. EditSetup <SetupName>, <AttributesArray> None
"ComputeForceDensity:=", false, _ "ComputePowerLoss:=", false, _ "ThermalFeedback:=", true, _ "Frequency:=", "60Hz", _ "HasSweepSetup:=", false _ "UseHighOrderShapeFunc:=", true) Example: 3D ElectricTransient edit setup: oModule.EditSetup "Setup1", Array("NAME:Setup1", _ "Tolerance:=", 0.005, _ Array("NAME:Data", _ "SaveField:=", true, _ "Stop:=", "100s", _ "InitialStep:=", "0.01s", _ "MaxStep:=", "0.5s"), _ "Initial Voltage:=", "0V", _ "NumberOfOutputVars:=", 0) Example: 2D DCConduction edit setup: oModule.EditSetup "Setup1", Array("NAME:Setup1", _ "MaximumPasses:=", 20, _ "MinimumPasses:=", 2, _ "MinimumConvergedPasses:=", 1, _ "PercentRefinement:=", 30, _ "SolveFieldOnly:=", false, _ "PercentError:=", 1, _ "SolveMatrixAtLast:=", true, _ "UseOutputVariable:=", false, _ "PreAdaptMesh:=", false)
RenameSetup
Use: Command: Syntax: Return Value: Parameters: Renames an existing solution setup. Right-click a solution setup in the project tree, and then click Rename on the shortcut menu. RenameSetup <OldName>, <NewName> None <OldName> Type: <string> Name of the solution setup being renamed. <NewName>
Analysis Module Script Commands 15-9
Type: <string> New name for the solution setup. Example: oModule.RenameSetup "Setup1", "Setup2"
DeleteSetups
Use: Command: Syntax: Return Value: Parameters: Example: Deletes one or more solution setups, which are specified by an array of solution setup names. Right-click a solution setup in the project tree, and then click Delete on the shortcut menu, or delete selected solution setups in the List dialog box. DeleteSetups <SetupArray> None <SetupArray> Array(<name1>, <name2>, ...) oModule.DeleteSetups Array("Setup1", "Setup2")
ExportCircuit
Use: Command: Syntax: Exports matrix solution to an outside circuit. Right-click a matrix setup under Parameters in the project tree, and select View Solution. From the dialog box, click the Export Circuit button. ExportCircuit <SetupName>, <Variation>, <ExportFileName>, Array("NAME:CircuitData", "Matrix:=", <MatrixName>, "Post Processed:=", <IsPostProcessed>, "Scale:=", <ScalingFactor>, Array("NAME:Pins", "<SourceName>:=", Array("res:=", <Resistance> ))), <ModelName> None <SetupName> Type: string Setup name <Variation> Type: string Variation values <ExportFileName> Type: string Export file name <MatrixName> Type: string
15-10 Analysis Module Script Commands
Matrix setup name <IsPostProcessed> Type: bool Is post processed (true/false) <ScalingFactor> Type: string (value) Scaling factor <SourceName> Type: string (without quotation mark) Source name <Resistance> Type: value Resistance value <ModelName> Type: string Model name or name of the sub circuit(optional). If not specified then "ExportFileName" is used as the model name. Example: oModule. ExportCircuit "Setup1", "", _ "C:/Maxwell/Projects/Export/Matrix1.sml", _ Array("NAME:CircuitData", _ "Matrix:=", "Matrix1", _ "Post Processed:=", false, _ "Scale:=", "1", _ Array("NAME:Pins", _ "Current1:=", Array("res:=", "0mOhm")))
ExportSolnData
Use: Command: Exports solution data to a file. Right-click a parameter setup under Parameters in the project tree, and select View Solution. From the dialog box, select an appropriate solution type, and click the Export Solution button. ExportSolnData <SetupName>, <SolutionName>, <IsPostProcessed>, <Variation>, <ExportFileName>, <SetupName> Type: string
Analysis Module Script Commands 15-11
Setup name. <SolutionName> Type: string Solution setup name. <IsPostProcessed> Type: bool Is post processed (true/false). <Variation> Type: string Variation values. <ExportFileName> Type: string Export file name. Example: oModule.ExportSolnData "Setup1", "Matrix1", false, "", _ "C:/Maxwell/Projects/Export/OutputSolution.txt"
RevertSetupToInitial
Use: Command: Syntax: Return Value: Parameters: Example: Marks the current mesh for a solution setup as invalid, forcing the next simulation to start from the initial mesh. Right-click a setup in the project tree, and then click Revert to Initial Mesh on the shortcut menu. RevertSetupToInitial <SetupName> None <SetupName> The name of the solution setup you want to revert to. oModule.RevertSetupToInitial "Setup1"
RevertAllToInitial
Use: Command: Syntax: Return Value: Example: Marks the current mesh for all solution setups as invalid, forcing the next simulation to start from the initial mesh. Maxwell3D or Maxwell2D>Analysis Setup>Revert to Initial Mesh RevertAllToInitial None oModule.RevertAllToInitial
ResetSetupToTimeZero
Use: Command: Syntax: Return Value: Parameters: Forces the next solve to start from time 0 for a given setup. Applies only to the Transient solution type. Right-click a setup in the project tree, and select Revert to Time Zero. ResetSetupToTimeZero <SetupName> None <SetupName> Type: string Setup name Example: oModule.ResetSetupToTimeZero "Setup1"
ResetAllToTimeZero
Forces the next solve to start from time 0 for all setups. Applies only to the Transient solution type. Command: Syntax: Return Value: Parameters: None Example: oModule.ResetAllToTimeZero Right-click Analysis in the project tree, and select Revert to Time Zero. ResetAllToTimeZero None
GetSetups
Use: Syntax: Return Value: Parameters: Example: Gets the names of analysis setups in a design. GetSetups() Array of analysis setup names. None setupnames = oModule.GetSetups()
GetSetupNames
Use: Command: Syntax: Return Value: Parameters: Example: Get the names of setups. None GetSetupNames() An array of strings. The setup names. None. Set setups = oModule.GetSetupNames() numsetups = setups.Count
Analysis Module Script Commands 15-13
for i=0 to numsetups-1 setup = setups.Item(i) MsgBox "Setup Name = " & setup Next
CopySetup
Use: Syntax: Return Value: Parameters: Copy a solve setup. CopySetup <SetupName> None <SetupName> Type: <String> Name of solve setup to be copied. Example: oModule.CopySetup "Setup6"
PasteSetup
Use: Syntax: Return Value: Example: Paste a solve setup. PasteSetup None oModule.PasteSetup
16
Optimetrics script commands should be executed by the Optimetrics module. Set oModule = oDesign.GetModule("Optimetrics") oModule.CommandName <args>
Type: <string> The name of the embedded parametric setup. <Precede> Type: <bool> If true, the embedded parametric setup will be solved before the analysis begins. If false, the embedded parametric setup will be solved during each analysis iteration. <Constraint> Array("NAME:LCS", "lc:=", Array("<VarName>:=", <Coeff>, "<VarName>:=", <Coeff>, "rel:=", <Cond>, "rhs:=", <Rhs>), ... "lc:=", Array("<VarName>:=", <Coeff>, ..." <VarName>:=", <Coeff>, "rel:=", <Cond>, "rhs:=", <Rhs>)) Parameters: <Coeff> Type: <double> Coefficient for a variable in the linear constraint. <Cond> Type: <string> Inequality condition. <Rhs> Type: <double> Inequality value. <OptiGoalSpec> "Solution:=", <Soln>, "Calculation:=", <Calc>, "Context:=, <Geometry> Array(NAME:Ranges, "Range:", Array("Var:=", <VarName>, "Type:=", <RangeType>, "Start:=",<StartV>, "Stop:=", <StopV>), ... "Range:", Array("Var:=", <VarName>, "Type:=", <RangeType>, "Start:=", <StartV>, "Stop:=",<StopV>)) Parameters:
Optimetrics Module Script Commands 16-3
<Soln> Type: <string> Name of the Maxwell solution. <Calc> Type: <string> An expression composed of a basic solution quantity and an output variable. <ContextName> Type: <string> Name of context needed in the evaluation of <Calc>. <RangeType> Type: <string> if "r", start and stop values specify a range for the variable if "s", start values specify the single value for the variable.
DeleteSetups (Optimetrics) RenameSetup (Optimetrics) SolveSetup (Optimetrics) GetSetupNames (Optimetrics) GetSetupNamesByType (Optimetrics) DistributedAnalyzeSetup
DeleteSetups (Optimetrics)
Use: Command: Syntax: Return Value: Parameters: Deletes the specified Optimetrics setups. Right-click the setup in the project tree, and then click Delete on the shortcut menu. DeleteSetups <NameArray> None <NameArray> Type: Array of strings. An array of setup names. Example: oModule.DeleteSetups Array("OptimizationSetup1")
DistributedAnalyzeSetup
Use: Command: Syntax: Return Value: Parameters: Example: Distributes all variable value instances within a parametric sweep to different machines already specified from within the user interface. Right-click the parametric setup name in the project tree, and select Distribute Analysis. DistributedAnalyzeSetup <ParametricSetupName> None
<ParametricSetupName>
Type: <string> oModule.DistributedAnalyzeSetup "ParametricSetup1"
GetSetupNames (Optimetrics)
Use: Syntax: Return Value: Gets a list of Optimetrics setup names. GetSetupNames() Array of Optimetrics setup names
Optimetrics Module Script Commands 16-5
Parameters: Example:
GetSetupNamesByType (Optimetrics)
Use: Syntax: Return Value: Parameters: Gets a list of Optimetrics setup names by type. GetSetupNamesByType(<Optimetrics type>) Array of Optimetrics setup names of the given type. <Optimetrics type> Type: String Examples: parametric, optimization, statistical, sensitivity Example: For each name in oModule.GetSetupNamesByType("optimization") Msgbox name Next
RenameSetup (Optimetrics)
Use: Command: Syntax: Return Value: Parameters: Renames the specified Optimetrics setup. Right-click the setup in the project tree, and then click Rename on the shortcut menu. RenameSetup <OldName> <NewName> None <OldName> Type: <string> <NewName> Type: <string> Example: oModule.RenameSetup "OptimizationSetup1" "MyOptimization"
SolveSetup (Optimetrics)
Use: Command: Syntax: Return Value: Parameters: Solves the specified Optimetrics setup. Right-click the setup in the project tree, and then click Analyze on the shortcut menu. SolveSetup <SetupName> None oModule.SolveSetup "OptimizationSetup1"
InsertSetup (Parametric)
Use: Command: Inserts a new parametric setup. Right-click the Optimetrics folder in the project tree, and then click Add> Parametric on the shortcut menu.(Maxwell3D or Maxwell2D>Optimetrics Analysis>Add Parametric) InsertSetup "OptiParametric", <ParametricParams> None <Parametric Params> Array("NAME:<SetupName>", "SaveFields:=", <SaveField>, <StartingPoint>, "Sim. Setups:=", <SimSetups>, <SweepDefs>, <SweepOps>, Array("NAME:Goals", Array("NAME:Goal", <OptiGoalSpec>), ... Array("NAME:Goal", <OptiGoalSpec>)) <SetupName> Type: <string> Name of the parametric setup. <SimSetups> Type: Array of strings. An array of Maxwell solution setup names. <SweepDefs> Array("NAME:Sweeps", Array("NAME:SweepDefinition", "Variable:=", <VarName>, "Data:=", <SweepData>, "Synchronize:=", <SyncNum>), ... Array("NAME:SweepDefinition", "Variable:=", <VarName>, "Data:=", <SweepData>, "Synchronize:=", <SyncNum>)) Parameters:
Optimetrics Module Script Commands 16-7
<SweepData> "<SweepType>, <StartV>, <StopV>, <StepV>" Parameters: <SweepType> Type: <string> The type of sweep data. <SyncNum> Type: <int> SweepData with the same value are synchronized. <SweepOps> Array("NAME:Sweep Operations", <OpType>:=, Array(<VarValue>, , <VarValue>), ... <OpType>:=, Array(<VarValue>, , <VarValue>)) Parameters: <OpType> Type: <string> The sweep operation type. Example: oModule.InsertSetup "OptiParametric", _ Array("NAME:ParametricSetup1", "SaveFields:=", true, _ Array("NAME:StartingPoint"), "Sim. Setups:=", _ Array("Setup1"),Array("NAME:Sweeps", _ Array("NAME:SweepDefinition", _ "Variable:=", "$width", _ "Data:=", "LIN 12mm 17mm 2.5mm", _ "OffsetF1:=", false, "Synchronize:=", 0), _ Array("NAME:SweepDefinition", "Variable:=", _ "$length", "Data:=", _ "LIN 8mm 12mm 2mm", "OffsetF1:=", false, _ "Synchronize:=", 0)), _ Array("NAME:Sweep Operations"), Array("NAME:Goals", _ Array("NAME:Goal", "Solution:=", _ "Setup1 : LastAdaptive", _ "Calculation:=", "returnloss", _ "Context:=", "", _ Array("NAME:Ranges", "Range:=", _ Array("Var:=", "Freq", "Type:=", "s", _ "Start:=", "8GHz", "Stop:=", "8GHz"))), _ Array("NAME:Goal", "Solution:=", _ "Setup1 : LastAdaptive","Calculation:=", "reflect", _
16-8 Optimetrics Module Script Commands
"Context:=", "", Array("NAME:Ranges", "Range:=", _ Array("Var:=", "Freq", "Type:=", "s", _ "Start:=", "8GHz", "Stop:=", "8GHz")))))
EditSetup (Parametric)
Use: Command: Syntax: Return Value: Modifies an existing parametric setup. Right-click the setup in the project tree, and then click Properties on the shortcut menu. EditSetup <SetupName>, <ParametricParams> None
InsertSetup (Optimization)
Use: Command: Inserts a new optimization setup. Right-click the Optimetrics folder in the project tree, and then click Add>Optimization on the shortcut menu. (Maxwell3D or Maxwell2D>Optimetrics Analysis>Add Optimization) InsertSetup "OptiOptimization", <OptimizationParams> None <OptimizationParams> Array("NAME:<SetupName>", "SaveFields:=", <SaveField>, <Optimizer>, "MaxIterations:=", <MaxIter>, "PriorPSetup:=", <PriorSetup>, "PreSolvePSetup:=", <Preceed>, <OptimizationVars>, <Constraint>, Array("NAME:Goals", Array("NAME:Goal", <OptiGoalSpec>, <OptimizationGoalSpec>), ... Array("NAME:Goal", <OptiGoalSpec>, <OptimizationGoalSpec>)), "Acceptable_Cost:=", <AcceptableCost>, "Noise:=", <Noise>, "UpdateDesignWhenDone:=", <UpdateDesign> <OptimizationVars> Array("NAME:Variables", "VarName:=", Array("i:=", <IncludeVar>, "Min:=", <MinV>, "Max:=", <MaxV>, "MinStep:=", <MinStepV>, "MaxStep:=", <MaxStepV>), . "VarName:=", Array("i:=", <IncludeVar>, "Min:=", <MinV>, "Max:=", <MaxV>, "MinStep:=", <MinStepV>, "MaxStep:=", <MaxStepV>)) Parameters: <MinStepV> Type : <VarValue>
16-10 Optimetrics Module Script Commands
<StartingPoint>, "Optimizer:=",
The minimum step of the variable. <MaxStepV> Type: <VarValue> The maximum step of the variable. <AcceptableCost> Type: <double> The acceptable cost value for the optimizer to stop. <Noise> Type: <double> The noise of the design. <UpdateDesign> Type: <bool> Specifies whether or not to apply the optimal variation to the design after the optimization is done. <OptimizationGoalSpec> "Condition:=", <OptimizationCond>, Array("NAME:GoalValue", "GoalValeType:=", <GoalValueType>, "Format:=", <GoalValueFormat>, "bG:=", Array("v:=", <GoalValue>)), "Weight:=", <Weight>) Parameters: <OptimizationCond> Type: <string> Either "<=", "==", or ">=" <GoalValueType> Type: <string> Either "Independent" or "Dependent" <GoalValueFormat> Type:<string> Either "Real/Imag" or "Mag/Ang". <GoalValue> Type: <string> Value in string. Value can be a real number, complex number, or expression. Example: oModule.InsertSetup _
Optimetrics Module Script Commands 16-11
"OptiOptimization",Array("NAME:OptimizationSetup1", _ "SaveFields:=", false, _ Array("NAME:StartingPoint", "$length:=", "8mm", _ "$width:=", "14.5mm"), "Optimizer:=", "Quasi Newton", _ "MaxIterations:=", 100, _ "PriorPSetup:=", "ParametricSetup1", _ "PreSolvePSetup:=", true, _ Array("NAME:Variables", "$length:=", _ Array("i:=", true, "Min:=", "6mm", "Max:=", "18mm", _ "MinStep:=", "0.001mm", "MaxStep:=", "1.2mm"), _ "$width:=", Array("i:=", true, _ "Min:=", "6.5mm", "Max:=", "19.5mm", _ "MinStep:=", "0.001mm", "MaxStep:=", "1.3mm")), _ Array("NAME:LCS"), Array("NAME:Goals", _ Array("NAME:Goal", "Solution:=", _ "Setup1 : LastAdaptive", "Calculation:=", "reflect", _ "Context:=", "", Array("NAME:Ranges", "Range:=", _ Array("Var:=", "Freq", "Type:=", "s", _ "Start:=", "8GHz", "Stop:=", "8GHz")), _ "Condition:=", "<=", _ Array("NAME:GoalValue", "GoalValueType:=", _ "Independent", "Format:=", "Real/Imag", "bG:=", _ Array("v:=", "[0.0001]")), "Weight:=", "[1]")), _ "Acceptable_Cost:=", 0.0002, "Noise:=", 0.0001, _ "UpdateDesign:=", true, "UpdateIteration:=", 5, _ "KeepReportAxis:=", true, _ "UpdateDesignWhenDone:=", true)
EditSetup (Optimization)
Use: Command: Syntax: Return Value: Modifies an existing optimization setup. Right-click the setup in the project tree, and then click Properties on the shortcut menu. EditSetup <SetupName>, <OptimizationParams> None
InsertSetup (Sensitivity)
Use: Command: Inserts a new sensitivity setup. Right-click Optimetrics in the project tree, and then click Add>Sensitivity on the shortcut menu.(Maxwell3D or Maxwell2D>Optimetrics Analysis>Add Sensitivity) InsertSetup "OptiSensitivity", <SensitivityParams> None <SensitivityParams> Array("NAME:<SetupName>", "SaveFields:=", <SaveField>, <StartingPoint>, "MaxIterations:=", <MaxIter>, "PriorPSetup:=", <PriorSetup>, "PreSolvePSetup:=", <Preceed>, <Constraint>, <SensitivityVars>,
Array("NAME:Goals", Array("NAME:Goal", <OptiGoalSpec>), ..., Array("NAME:Goal", <OptiGoalSpec>)), "Master Goal:=". <MasterGoalID>, "MasterError:=", <MasterError>) <SensitivityVars> Array("NAME:Variables", "VarName:=", Array("i:=", <IncludeVar>, "Min:=", <MinV>, "Max:=", <MaxV>, "IDisp:=", <InitialDisp>),... "VarName:=", Array("i:=", <IncludeVar>, "Min:=", <MinV>, "Max:=", <MaxV>, "IDisp:=", <InitialDisp>)) Parameters: <InitialDisp> Type : <VarValue> The initial displacement of the variable. <MasterGoalID>
Optimetrics Module Script Commands 16-13
Type: <int> Index of the master goal. Index starts from zero. <MasterError> Type: <double> Error associated with the master goal. Example: oModule.InsertSetup "OptiSensitivity", _ Array("NAME:SensitivitySetup1","SaveFields:=", true, _ Array("NAME:StartingPoint"), "MaxIterations:=", 20, _ "PriorPSetup:=", "","PreSolvePSetup:=", true, _ Array("NAME:Variables"), Array("NAME:LCS"), _ Array("NAME:Goals", Array("NAME:Goal", _ "Solution:=", "Setup1 : LastAdaptive", "Calculation:=", _ "returnloss", "Context:=", "", _ Array("NAME:Ranges","Range:=", _ Array("Var:=", "Freq", "Type:=", "s", _ "Start:=", "8GHz", "Stop:=", "8GHz"))), _ Array("NAME:Goal","Solution:=", "Setup1 : _ LastAdaptive", "Calculation:=", "reflect", _ "Context:=", "", Array("NAME:Ranges", "Range:=", _ Array("Var:=", "Freq", "Type:=", "s", _ "Start:=", "8GHz", "Stop:=", "8GHz")))), _ "Master Goal:=", 1,"MasterError:=", 0.001)
EditSetup (Sensitivity)
Use: Command: Syntax: Return Value: Modifies an existing sensitivity setup. Right-click the setup in the project tree, and then click Properties on the shortcut menu. EditSetup <SetupName>, <SensitivityParams> None
InsertSetup (Statistical)
Use: Command: Syntax: Return Value: Parameters: <StatisticalParams> Array("NAME:<SetupName>", "SaveFields:=", <SaveField>, <StartingPoint>, "MaxIterations:=", <StatisticalVars>, <MaxIter>, "PriorPSetup:=", <PriorSetup>, "PreSolvePSetup:=", <Preceed>, Array("NAME:Goals", Array("NAME:Goal", <OptiGoalSpec>), , Array("NAME:Goal", <OptiGoalSpec>))), <StatisticalVars> Array("NAME:Variables", "VarName:=", Array("i:=", <IncludeVar>, "Dist:=", <DistType>, "Tol:=", <Tolerance>, "StdD:=", <StdD>, "Min:=", <MinCutoff>, "Max:=", <MaxCutoff>, ... "VarName:=", Array("i:=", <IncludeVar>, "Dist:=", <DistType>, "Tol:=", <Tolerance>, "StdD:=", <StdD>, "Min:=", <MinCutoff>, "Max:=", <MaxCutoff>)) Parameters: <DistType> Type : <string> Distrbution can be "Gaussian" or "Uniform". <Tolerance>
Optimetrics Module Script Commands 16-15
Inserts a new statistical setup. Right-click Optimetrics in the project tree, and then click Add>Statistical on the shortcut menu.(Maxwell>Optimetrics Analysis>Add Statistical) InsertSetup "OptiStatistical", <StatisticalParams> None
Type: <VarValue> The tolerance for the variable when distribution is Uniform. <StdD> Type: <VarValue> The standard deviation for the variable when distribution is Gaussian. <MinCutoff> Type: <double> The minimum cut-off for the variable when distribution is Gaussian. <MaxCutoff> Type: <double> The maximum cut-off for the variable when distribution is Gaussian. Example: oModule.InsertSetup "OptiStatistical", _ Array("NAME:StatisticalSetup1", _ "SaveFields:=", true, _ Array("NAME:StartingPoint"),_ "MaxIterations:=", 50,_ "PriorPSetup:=", "", _ Array("NAME:Variables"), _ Array("NAME:Goals", _ Array("NAME:Goal", _ "Solution:=", "Setup1 : LastAdaptive", _ "Calculation:=", "returnloss", _ "Context:=", "", _ Array("NAME:Ranges", _ "Range:=", Array("Var:=", "Freq", _ "Type:=", "s",_ "Start:=", "8GHz", "Stop:=", "8GHz"))),_ Array("NAME:Goal",_ "Solution:=", "Setup1 : LastAdaptive",_ "Calculation:=", "reflect",_ "Context:=", "", _ Array("NAME:Ranges",_
16-16 Optimetrics Module Script Commands
EditSetup (Statistical)
Use: Command: Syntax: Return Value: Modifies an existing statistical setup. Right-click the setup in the project tree, and click Properties on the shortcut menu. EditSetup <SetupName>, <StatisticalParams> None
17
Solutions commands should be executed by the Solutions module. Set oModule = oDesign.GetModule("Solutions") oModule.CommandName <args>
DeleteSolutionVariation
Use: Command: Syntax: Return Value: Parameters: <DataSpecifierArray> Array(<DesignVariationKey>, <SetupName>, <SolnName>) <DesignVariationKey> Type: <string> Design variation string. <SetupName> Type: <string> Name of the solve setup. <SolnName> Type: <string> Name of the solutions within the solve setup. Example: oModule.DeleteSolutionVariation _ Array(Array("width='2in'", "Setup1", "Adaptive_1") _ Array("width='2in'", "Setup1", "Sweep1")) Deletes solution data for specific solutions and design variations. See also DeleteVariation. Maxwell3D or Maxwell2D>Results>Browse Solutions DeleteSolutionVariation Array(<DataSpecifierArray>, ) None
18
Field overlay commands should be executed by the Field Overlays module, which is called FieldsReporter in Maxwell scripts. Set oModule = oDesign.GetModule("FieldsReporter") oModule.CommandName <args>
CreateFieldPlot
Use: Command: Syntax: Return Value: Parameters: Creates a field/mesh plot. Maxwell3D or Maxwell2D>Fields>Fields>E>Mag_E CreateFieldPlot None <PlotParameterArray> Array(NAME:<PlotName>, "SolutionName:=", <string>, "QuantityName:=", <string>, "PlotFolder:=", <string>, "UserSpecifyName:=", <int>, "UserSpecifyFolder:=", <int>, "IntrinsicVar:=", <string>, "PlotGeomInfo:=", <PlotGeomArray>, "FilterBoxes:=", <FilterBoxArray>, <PlotOnPointSettings>, <PlotOnLineSettings>, <PlotOnSurfaceSettings>, <PlotOnVolumeSettings>) SolutionName Name of the solution setup and solution formatted as: "<SolveSetupName> : <WhichSolution>", where <WhichSolution> can be "Adaptive_<n>", "LastAdaptive", or "PortOnly". For example: "Setup1 : Adaptive_2" Maxwell requires a space on both sides of the : character. Otherwise, the plot will not be created.
18-2 Field Overlays Module Script Commands
<PlotParameterArray>
QuantityName Type of plot to create. Possible values are: Mesh plots: Mesh Field Plots: Field type AC R/L Fields DC R/L Fields C Fields PlotFolder Name of the folder to which the plot should be added. Possible values are: "Q", "ABS_Q", "JDC Vol", "Phi", "JDC Surf", and "JAC". UserSpecifyName 0 if default name for plot is used, 1 otherwise. This parameter is not essential. <PlotName> is respected regardless of whether this flag is set. UserSpecifyFolder 0 if the default folder for plot is used, 1 otherwise. This parameter is not essential. The specified PlotFolder is respected regardless of whether this flag is set. IntrinsicVar Formatted string that specifies the frequency and phase at which to create the plot. For example: "Freq='1GHz' Phase='30deg'" <PlotGeomArray> Array(<NumGeomTypes>, <GeomTypeData>, <GeomTypeData>, ...) For example: Array(4, "Volume", "ObjList", 1, "Box1", "Surface", "FacesList", 1, "12", "Line", 1, "Polyline1", "Point", 2, "Point1", "Point2") <NumGeomTypes> Type: <int> Number of different geometry types (volume, surface, line, point) plotted at the same time.
Field Overlays Module Script Commands 18-3
Plot quantity names "SurfaceJac", "Mag_SurfaceJac" "VolumeJdc", "Mag_VolumeJdc", "Phidc" "SmoothQ", "ABS_Q"
<GeomTypeData> <GeomType>, <ListType>, <NumIDs>, <ID>, <ID>, ...) <GeomType> Type: <string> Possible values are "Volume", "Surface", "Line", Point. <ListType> Type: <string> Possible values are "ObjList" or "FacesList". These are used for GeomType values "Line" or "Point". <NumIDs> Type: <int> Number of IDs or object names that will follow. <ID> Type: <int> or <string> ID of a face or name of an object, line, or point on which to plot. <FilterBoxArray> Array of object names used to restrict the plot range. Array(<NumFilters>, <ObjName>, <ObjName>, ...) Example: Array(1, "Box1") Example: Array(0) <PlotOnPointSettings> Array("NAME:PlotOnPointSettings", "PlotMarker:=", <bool>, "PlotArrow:=", <bool>) <PlotOnLineSettings> Array("NAME:PlotOnLineSettings", Array("NAME:LineSettingsID", "Width:=", <int>, "Style:=", <string>), "IsoValType:=", <string>, "ArrowUniform:=", <bool>, "NumofArrow:=", Style Possible values are "Cylinder", "Solid", "Dashdash",
18-4 Field Overlays Module Script Commands
no filtering
<int>)
"Dotdot", "Dotdash". IsoValType Possible values are "Tone", "Fringe", "Gourard"> Array("NAME:PlotOnSurfaceSettings", "Filled:=", <bool>, "IsoValType:=", <string>, "SmoothShade:=", <bool>, "AddGrid:=", <bool>, "MapTransparency:=", <bool>, "Transparency:=", <double>, "ArrowUniform:=", <bool> "ArrowSpacing:=", IsoValType Possible values are: "Tone", "Line", "Fringe", "Gourard". GridColor Array containing the R, G, B components of the color. Components should be in the range 0 to 255. <PlotOnVolumeSettings> Array("NAME:PlotOnVolumeSettings", "PlotIsoSurface:=", <bool>, "CloudDensity:=", <double>, "PointSize:=", <int>, "ArrowUniform:=", <bool>, "ArrowSpacing:=, <double>) Example: oModule.CreateFieldPlot Array("NAME:Mag_E1", _ "SolutionName:=", "Setup1 : LastAdaptive", _ "QuantityName:=", "Mag_E", _ "PlotFolder:=", "E Field1", _ "UserSpecifyName:=", 0, _ "UserSpecifyFolder:=", 0, _ "IntrinsicVar:=", "Freq='1GHz' Phase='0deg'",_ "PlotGeomInfo:=", Array( 1, "Surface",_ "FacesList", 1, "7"),_
Field Overlays Module Script Commands 18-5
<double>
"FilterBoxes:=", Array(0), _ Array("NAME:PlotOnSurfaceSettings", _ "Filled:=", false, _ "IsoValType:=", "Fringe", _ "SmoothShade:=", true, _ "AddGrid:=", false, _ "MapTransparency:=", true, _ "Transparency:=", 0, _ "ArrowUniform:=", true, _ "ArrowSpacing:=", 0.100000001490116, _ "GridColor:=", Array(255, 255, 255)))
DeleteFieldPlot
Use: Command: Syntax: Return Value: Parameters: Example: Deletes one or more plots. Maxwell3D or Maxwell2D>Fields>Delete Plot DeleteFieldPlot <NameArray> None <NameArray> Array of strings specifying the plots to delete. oModule.DeleteFieldPlot Array("Mag_E1", "Vector_E1")
GetFieldPlotNames
Use: Syntax: Return Value: Parameters: Example: Gets the names of field overlay plots defined in a design. GetFieldPlotNames() Array of field plot names. None Set plotnames = oModule.GetFieldPlotNames() For Each name in plotnames Msgbox name Next
ModifyFieldPlot
Use: Command: Syntax: Return Value: Modifies a plot definition. Maxwell3D or Maxwell2D>Fields>Modify Plot ModifyFieldPlot <OriginalName> <PlotParameterArray> None
Example: oModule.ModifyFieldPlot "Vector_E1",_Array("NAME:Vector_E2", _ "SolutionName:=", "Setup1 : LastAdaptive", _ "QuantityName:=", "Vector_E", "PlotFolder:=", _ "E Field1", "UserSpecifyName:=", 0, _ "UserSpecifyFolder:=", 0, "IntrinsicVar:=","Freq='1GHz' _ Phase='30deg'", "PlotGeomInfo:=", _ Array(1, "Surface","FacesList", 1, "7"), _ "FilterBoxes:=", Array(0), _ Array("NAME:PlotOnSurfaceSettings", "Filled:=", false, _ "IsoValType:=", "Fringe", "SmoothShade:=", true, _ "AddGrid:=", false, "MapTransparency:=", true, _ "Transparency:=", 0, "ArrowUniform:=", true, _ "ArrowSpacing:=", 0.100000001490116, "GridColor:=", _ Array(255, 255, 255)))
RenameFieldPlot
Use: Command: Syntax: Return Value: Parameters: Renames a plot. Right-click the plot you want to rename in the project tree, and then click Rename on the shortcut menu. RenameFieldPlot <OldName> <NewName> None <OldName> Type: <string> Original name of the plot. <NewName> Type: <string> New name of the plot. Example: oModule.RenameFieldPlot "Vector_E1", "Vector_E2"
RenamePlotFolder
Use: Command: Syntax: Return Value: Parameters: Renames a plot folder. Right-click a plot folder in the project tree, and then click Rename on the shortcut menu. RenamePlotFolder <OldName> <NewName> None <OldName> Type: <string>
Field Overlays Module Script Commands 18-7
Original name of the folder. <NewName> Type: <string> New name of the folder. Example: oModule.RenamePlotFolder "E Field", "Surface Plots"
SetFieldPlotSettings
Use: Command: Syntax: Return Value: Parameters: <PlotName> Type: <string> Name of the plot to modify. <PlotItemAttributes> Array("NAME:FieldsPlotItemSettings", <PlotOnPointsSettings>, <PlotOnLineSettings>, <PlotOnSurfaceSettings>, <PlotOnVolumeSettings>) See description of CreateFieldPlot command for details. Example: oModule.SetFieldPlotSettings "Mag_E2", _ Array("NAME:FieldsPlotItemSettings", _ Array("NAME:PlotOnLineSettings", _ Array("NAME:LineSettingsID", "Width:=", 4, _ "Style:=", "Cylinder"), "IsoValType:=", "Tone", _ "ArrowUniform:=", true, "NumofArrow:=", 100), _ Array("NAME:PlotOnSurfaceSettings", "Filled:=", false, _ "IsoValType:=", "Tone", "SmoothShade:=", true, _ "AddGrid:=", false, "MapTransparency:=", true, _ "Transparency:=", 0, "ArrowUniform:=", true, _ "ArrowSpacing:=", 0.100000001490116, _ "GridColor:=", Array(255, 255, 255))) Sets plot attributes. Maxwell3D or Maxwell2D>Fields>Modify Plot Attributes, on the Plots tab. SetFieldPlotSettings <PlotName> <PlotItemAttributes> None
SetPlotFolderSettings
Use: Sets the attributes of all plots in the specified folder.
Maxwell3D or Maxwell2D>Fields>Modify Plot Attributes SetPlotFolderSettings <PlotFolderName> <PlotFolderAttributes> None <PlotFolderName> Type: <string> Name of the folder with the attributes to modify. <PlotFolderAttributes> Array("NAME:FieldsPlotSettings", "Real time mode:=", <bool>, <ColorMapSettings>, <Scale3DSettings>, <Marker3DSettings>, <Arrow3DSettings>) <ColorMapSettings> Array("NAME:ColorMapSettings", "ColorMapType:=", <string>, "SpectrumType:=", <string>, "UniformColor:=", Array(<int>, <int>, <int>), "RampColor:=", Array(<int>, <int>, <int>) ColorMapType Possible values are "Uniform", "Ramp", "Spectrum". SpectrumType Possible values are "Rainbow", "Temperature", "Magenta", "Gray". UniformColor, RampColor Array containing the R, G, B components of the color. Components should be in the range 0 to 255. <Scale3DSettings> Array("NAME:Scale3DSettings", "m_nLevels:=", <int>, "m_autoScale:=", <bool>, "minvalue:=", <double>, "maxvalue:=", <double>, "log:=", <bool>,
Field Overlays Module Script Commands 18-9
"IntrinsicMin:=", <double>, "IntrinsicMax:=", <Marker3DSettings> Array("NAME:Marker3DSettings", MarkerType:=", <int>, "MarkerMapSize:=", <bool>, "MarkerMapColor:=", <bool>, "MarkerSize:=", <double>) MarkerType 9: Sphere 10: Box 11: Tetrahedron 12: Octahedron default: Sphere <Arrow3DSettings> Array("NAME:Arrow3DSettings", "ArrowType:=", <int>, "ArrowMapSize:=", <bool>, "ArrowMapColor:=", <bool>, "ShowArrowTail:=", <bool>, "ArrowSize:=", ArrowType 0: Line 1: Cylinder 2: Umbrella default: Line Example: oModule. SetPlotFolderSettings "E Field1", _ Array("NAME:FieldsPlotSettings", _ "Real time mode:=", true, _ Array("NAME:ColorMapSettings", _ "ColorMapType:=", "Spectrum", _ "SpectrumType:=", "Rainbow", _ "UniformColor:=", Array(127, 255, 255), _ "RampColor:=", Array(255,
18-10 Field Overlays Module Script Commands
<double>)
<double>)
127, 127)), _
Array("NAME:Scale3DSettings", _ "m_nLevels:=", 27, _ "m_autoScale:=", true, _ "minvalue:=", 9.34379863739014, _ "maxvalue:=", 13683.755859375, _ "log:=", false, _ "IntrinsicMin:=", 9.34379863739014, _ "IntrinsicMax:=", 13683.755859375), _ Array("NAME:Marker3DSettings", _ MarkerType:=", 0, _ "MarkerMapSize:=", true, _ "MarkerMapColor:=", false, _ "MarkerSize:=", 0.25), _ Array("NAME:Arrow3DSettings", _ "ArrowType:=", 1, _ "ArrowMapSize:=", true, _ "ArrowMapColor:=", true, _ "ShowArrowTail:=", true, _ "ArrowSize:=", 0.25))
19
Fields Calculator commands should be executed by the Field Overlays module, which is called FieldsReporter in Maxwell scripts. Set oModule = oDesign.GetModule("FieldsReporter") oModule.CommandName <args> The command associated with each of the following scripting commands is a button clicked in the Fields Calculator.
AddNamedExpression AddNamedExpr CalcOp CalcRead(deprecated) CalcStack CalculatorRead CalculatorWrite CalcWrite(deprecated) ChangeGeomSettings ClcEval ClcMaterial ClearAllNamedExpr CopyNamedExprToStack DeleteNamedExpr EnterComplex EnterComplexVector EnterLine EnterPoint EnterQty EnterScalar EnterScalarFunc EnterSurf EnterVector EnterVectorFunc EnterVol ExportOnGrid ExportToFile GetTopEntryValue LoadNamedExpressions SaveNamedExpressions
AddNamedExpression
Use: Creates a named expression using the expression at the top of the stack.
Click Add. AddNamedExpression <Name> None <ExpressionName> and <FieldType>. Type: <string> Name for the new named expression. <FieldType> Type: <string>
Example:
AddNamedExpr
Use: Command: Syntax: Return Value: Parameters: Creates a named expression using the expression at the top of the stack. Click Add. AddNamedExpr <Name> None <Name> Type: <string> Name for the new named expression. Example: oModule.AddNamedExpr "Mag_JxE"
CalcOp
Use: Command: Syntax: Return Value: Parameters: Performs a calculator operation. Operation commands like Mag, +, etc. CalcOp <OperationString> None <OperationString> Type: String The text on the corresponding calculator button. Examples: Mag, +
CalcRead(deprecated)
Use: Syntax: Return Value: Reads a file that is written out by the CalcWrite command, and puts the result into a calculator numeric. CalcRead <FileName> <SolutionName> <VariablesArray> None
Fields Calculator Script Commands 19-3
Parameters:
<FileName> Type: <string> <SolutionName> Type: <string> <VariablesArray> Array of variable name and value pairs.
Example:
CalcStack
Use: Command: Syntax: Return Value: Parameters: Performs an operation on the stack. Stack operation buttons such as Push and Pop. CalcStack <OperationString> None <OperationString> Type: <string> The text on the corresponding calculator button. Example: oModule.CalcStack "push"
CalculatorRead
Use: Command: Syntax: Return Value: Parameters: Gets a register file and applies it to the calculator stack. Click Read CalculatorRead <InputFilePath>, <SolutionName>, <FieldType>, <VariablesArray> None <InputFilePath> Path to and including name of input register file. <SolutionName> Type: <string> Example: "Setup1 : LastAdaptive" <FieldType> Type: <string> <VariablesArray> Array of variable names, value pairs.
Example:
CalculatorWrite
Use: Command: Syntax: Return Value: Parameters: Writes contents of top register to file. Click Write CalculatorWrite <OutputFilePath>, <SolutionNameArray>, <VariablesArray> None <OutputFilePath> Path to and including name of output register file. <SolutionNameArray> Array("Solution:=", <string>) <VariablesArray> Array of variable names, value pairs. Example: oModule.CalculatorWrite "C:\Ansoft\smoothedTemp.fld", Array("Solution:=", "Setup1 : LastAdaptive"), Array("$conductivity:=", "50000000")
CalcWrite(deprecated)
Use: Syntax: Return Value: Parameters: Evaluates the top stack element for all tetrahedrons, and writes the data to a file. CalcWrite <FileName> <SolutionName> <VariablesArray> None <FileName> Type: <string> Name of the output file. <SolutionName> Type: <string> <VariablesArray> Array of variable name and value pairs. Example: oModule.CalcWrite _ "c:\example.reg" "Setup1: LastAdaptive", _ Array ("Freq:=", "10GHz", "Phase:=", "0deg")
ChangeGeomSettings
Use: Command: Syntax: Return Value: Parameters: Changes the line discretization setting. Geom Settings ChangeGeomSettings <int> None The line discretization setting.
ClcEval
Use: Command: Syntax: Return Value: Parameters: Evaluates the expression at the top of the stack using the provided solution name and variable values. Click Eval. ClcEval <SolutionName> <VariablesArray> None <SolutionName> Type: <string> <VariablesArray> Array of variable name, and value pairs. Example: oModule.ClcEval "Setup1: LastAdaptive",_ Array ("Freq:=","10GHz", "Phase:=", "0deg")
ClcMaterial
Use: Command: Syntax: Return Value: Parameters: Performs a material operation on the top stack element. Click Matl. ClcMaterial <MaterialString>, <OperationString> None <Material String> Type: <string> The material property to apply. <OperationString> Type: <string> Possible values are "mult" or "div". Example: oModule.ClcMaterial "Permeability (mu)" "mult"
ClearAllNamedExpr
Use: Clears all user-defined named expressions from the list.
CopyNamedExprToStack
Use: Command: Syntax: Return Value: Parameters: Copies the named expression selected to the calculator stack. Select a named expression, and then click Copy to stack. CopyNamedExprToStack <Name> None <Name> Type: <string> The name of the expression to be copied to the top of the stack. Example: oModule.CopyNamedExprToStack "Mag_JxE"
DeleteNamedExpr
Use: Command: Syntax: Return Value: Parameters: Deletes the selected named expression from the list. Select a named expression, and then click Delete. DeleteNamedExpr <Name> None <Name> Type: <string> The name of the named expression to be deleted. Example: oModule.DeleteNamedExpr "Mag_JxE"
EnterComplex
Use: Command: Syntax: Return Value: Parameters: Enters a complex number onto the stack. Click Number, and then click Scalar. EnterComplex "<Real> + <Imaginary> j" None <Real> Type: <double> Real component of the scalar. <Imaginary>
Fields Calculator Script Commands 19-7
Type: <double> Imaginary component of the scalar. Example: oModule.EnterComplex "1 + 2 j"
EnterComplexVector
Use: Command: Syntax: Return Value: Parameters: Enters a complex vector onto the stack. Click Number, and then click Vector. EnterComplexVector Array ("<X Re> + <X Im> j", "<Y Re> + <Y Im> j", "<Z Re> + <Z Im> j") None <X Re>, <Y Re>, <Z Re> Type: <double> Real components of the X, Y, and Z values respectively. <X Im>, <YIm>, <ZIm> Type: <double> Imaginary components of the X, Y, and Z values,respectively. Example: oModule.EnterComplexVector Array("1 + 2 j", _ "1 + 2 j","1 + 2 j")
EnterLine
Use: Command: Syntax: Return Value: Parameters: Enters a line that was defined in the "3D Modeler" editor. Click Geometry, and then select Line. EnterLine <LineName> None <LineName> Type: <string> Name of a line defined in the 3D Modeler editor. Example: oModule.EnterLine "Line1"
EnterPoint
Use: Command: Syntax: Return Value: Parameters: Enters a point defined in the "3D Modeler" editor. Click Geometry, and then select Point. EnterPoint <PointName> None <PointName>
Type: <string> Name of a point defined in the 3D Modeler editor. Example: oModule.EnterPoint "Point1" Enters a field quantity. Click Quantity, and then select a field quantity from the list. EnterQty <FieldQuantityString> None <Field Quantity String> Type: <string> The name of the field quantity to be entered onto the stack. Example: oModule.EnterQty "E"
EnterQty
Use: Command: Syntax: Return Value: Parameters:
EnterScalar
Use: Command: Syntax: Return Value: Parameters: Enters a scalar onto the stack. Click Number, and then click Scalar. EnterScalar <Scalar> None <Scalar> Type: <double> The real number to enter onto the stack.
EnterScalarFunc
Use: Command: Syntax: Return Value: Parameters: Enters a scalar function. Click Function, and then select Scalar. EnterScalarFunc <VarName> None <VarName> Type: <string> Name of a variable to enter as a scalar function onto the stack. Example: oModule.EnterScalarFunc "Phase"
EnterSurf
Use: Command: Syntax: Return Value: Parameters: Enters a surface defined in the "3D Modeler" editor. Click Geometry, and then select Surface. EnterSurf <SurfaceName> None <SurfaceName> Type: <string> Name of a surface defined in the 3D Modeler editor. Example: oModule.EnterSurf "Rectangle1"
EnterVector
Use: Command: Syntax: Return Value: Parameters: Enters a vector onto the stack. Click Number, and then click Vector. EnterVector Array (<X>, <Y>, <Z>) None <X> Type: <double> X component of the vector. <Y> Type: <double> Y component of the vector. <Z> Type: <double> Z component of the vector. Example: oModule.EnterVector Array (1.0, 1.0, 1.0)
EnterVectorFunc
Use: Command: Syntax: Return Value: Parameters: Enters a vector function. Click Function, and then click Vector. EnterVectorFunc Array(<XVarName>, <YVarName>, <ZVarName>) None <XVarName>, <YVarName>, <ZVarName> Type: <string> Name of a variable for the X, Y, and Z coordinates,
19-10 Fields Calculator Script Commands
respectively, to enter as a vector function on the stack. Example: oModule.EnterVectorFunc Array("X", "Y", "Z")
EnterVol
Use: Command: Syntax: Return Value: Parameters: Enters a volume defined in the "3D Modeler" editor. Click Geometry, and then click Volume. EnterVol <VolumeName> None <VolumeName> Type: <string> Name of a volume defined in the "3D Modeler" editor. Example: oModule.EnterVol "Box1"
ExportOnGrid
Use: Note Evaluates the top stack element at a set of points specified by a grid, and exports the data to a file. Design variables must be defined prior to execution of this command. Click Export, and then click On Grid. ExportOnGrid <OutputFile> <MinArray> <MaxArray> <SpacingsArray> None <OutputFile> Type: <string> Name of the output file. <MinArray>, <MaxArray>, <SpacingsArray> Type: Array<double, double, double> Min, Max, and Spacing for the X, Y, and Z components of the grid. For 2D XY Designs, the Z component should be set to "0". For 2D RZ Designs, the Y component should be set to "0". Example: oModule.ExportOnGrid _ "C:\Maxwell12OutputFiles\GridExport.reg",_
Fields Calculator Script Commands 19-11
ExportToFile
Use: Command: Syntax: Return Value: Parameters: Evaluates the top stack element at a set of points specified in an external file, and exports the data to a file. Click Export, and then click To File. ExportToFile <OutputFile> <PtsFile> None <OutputFile> Type: <string> Name of the output file. <PtsFile> Type: <string> Name of the file containing the points at which to evaluate the top stack element. The file should contain tab- or space-separated x,y,z values of data points.
GetTopEntryValue
Use: Command: Syntax: Return Value: Parameters: Evaluates the value at the top entry of the calculator stack. None (only through scripts) GetTopEntryValue (<SolutionName>, <VariablesArray>) <ValueArray> An array of variants, which is either a scalar (one double) or a vector (three doubles) based on the quantity on top of the stack. <SolutionName> Type: <string> Example: "Setup1:LastAdaptive" <VariablesArray> Array of variable name/value pairs. <ValueArray> Array of values. Example: dim topvalue topvalue = _ oModule.GetTopEntryValue("Setup1: LastAdaptive", _
19-12 Fields Calculator Script Commands
Array("Freq:=", "1GHz", "Phase:=", "0deg", _"x_size:=", "2mm")) If cdbl(topvalue(0)) <- 180.0 then ...
LoadNamedExpressions
Use: Command: Syntax: Return Value: Parameters: Loads a named expression definition from a saved file. In the Fields Calculator, click Load From... in the Library area. LoadNamedExpressions <FileName>, <FieldType>, <NamedExpressions> None <FileName> Type:<String> Filename and full path to the file to hold the named expression definition. <FieldType> Type:<String> For products with just one filed type, it is set to "Fields". <NamedExpressions> Type: Array<string, string,...> Array of strings containing the names of expression definitions to load from the file. Parameters: Example: oModule.LoadNamedExpressions "C:\Ansoft\PersonalLib\Maxw.clc", "Fields", Array("SmoothedBField")
SaveNamedExpressions
Use: Command: Syntax: Return Value: Parameters: Saves a named expression definition to a file. In the Fields Calculator, click Save To... in the Library area. SaveNamedExpressions <FileName>, <NamedExpressions>, <BooleanFlag> None <FileName> Type:<String> Filename and full path to the file to hold the named expression definition. <NamedExpressions> Type: Array<string, string,...>
Fields Calculator Script Commands 19-13
Array of strings containing the names of expression definitions to load from the file. <BooleanFlag> Type:<Boolean> True: Overwrite the file. False: Append to the file. <BooleanFlag> Type:<Boolean> True: Overwrite the file. False: Append to the file. Example: oModule.SaveNamedExpressions "C:\Ansoft\PersonalLib\Maxw.clc", Array("SmoothedBField"), true
20
Motion setup commands should be executed by the ModelSetup module. Set oModule = oDesign.GetModule("ModelSetup") oModule.CommandName <args>
DeleteMotionSetup ReassignMoving
DeleteMotionSetup
Use: Command: Syntax: Return Value: Parameters: Example: Deletes the motion setup. Maxwell3D or Maxwell2D>Model>Motion Setup>Unassign Band DeleteMotionSetup None None oModule.DeleteMotionSetup
ReassignMoving
Use: Command: Syntax: Return Value: Example: Specifies a new geometry assignment for moving objects. Maxwell3D or Maxwell2D>Model>Motion Setup>Add Selected Objects or Maxwell3D or Maxwell2D>Model>Motion Setup>Remove Selected Objects ReassignMoving Array("Name:Moving", "Objects:=", <AssignmentObjects>) None oModule.ReassignMoving Array("NAME:Moving", _
AssignBand EditMotionSetup
AssignBand
Use: Command: Assigns the selected object as a band. Maxwell3D or Maxwell2D>Model>Motion Setup>Assign Band
Motion Setup Script Commands 20-3
AssignBand <BandDataArray> None <BandDataArray> Array("NAME:Band", "Move Type:=", <Translate/Rotate>, "Coordinate System::=", <CoordinateSystemName>, "Axis:=", <X/Y/Z>, "Is Positive:=", <bool>, "InitPos:=", <value>, "NegativePos:=", <value>, "PositivePos:=", <value>, "Consider Mechanical Transient:=", <bool>, "velocity:=", <value>, "objects:=", <AssignmentObjects>)
Example:
Assign band as translate, do not consider mechanical transient. oModule.AssignBand _ Array("NAME:Band", "Move Type:=", "Translate", _ "Coordinate System:=", "Global", "Axis:=", "Z", _ "Is Positive:=", true, "InitPos:=", "0mm", _ "NegativePos:=", "0mm", "PositivePos:=", "1mm", _ "Consider Mechanical Transient:=", false, _ "Velocity:=", "0m_per_sec", _ "Objects:=", Array("band"))
Example:
Assign band as translate, consider mechanical transient. oModule.AssignBand _ Array("NAME:Band", _ "Move Type:=", "Translate", _ "Coordinate System:=", "Global", "Axis:=", "Z", _ "Is Positive:=", true, "InitPos:=", "0mm", _ "NegativePos:=", "0mm", "PositivePos:=", "1mm", _ "Consider Mechanical Transient:=", true, _ "Velocity:=", "0m_per_sec", "Mass:=", "1kg", _ "Damping:=", "1", "Load Force:=", "1nNewton" _ "Objects:=", Array("band"))
Example:
Assign band as rotate, do not consider mechanical transient. oModule.AssignBand _ Array("NAME:Band", "Move Type:=", "Rotate", _ "Coordinate System:=", "Global", "Axis:=", "Z", _ "Is Positive:=", true, "InitPos:=", "0deg", _ "HasRotateLimit:=", false, "NonCylindrical:=", _ false, "Consider Mechanical Transient:=", false, _ "Angular Velocity:=", "0deg_per_sec", "Objects:=", _ Array("band"))
Example:
Assign band as rotate, consider mechanical transient. oModule.AssignBand _ Array("NAME:Band", "Move Type:=", "Rotate", _ "Coordinate System:=", "Global", "Axis:=", "Z", _ "Is Positive:=", true, "InitPos:=", "0deg", _ "HasRotateLimit:=", false, "NonCylindrical:=", _ false, "Consider Mechanical Transient:=", true, _ "Angular Velocity:=", "0deg_per_sec", _ "Moment of Inertia:=", "1", "Damping:=", "0", _ "Load Torque:=", Array("band")) "0NewtonMeter", "Objects:=", _
EditMotionSetup
Use: Command: Syntax: Return Value: Edits the motion setup. Double-click the moving item in the project tree to edit it. EditMotionSetup <BandDataArray> None
SetSymmetryMultiplier
SetSymmetryMultiplier
Use: Sets the symmetry multiplier.This symmetry multiplier will be automatically applied to all input quantities including: input voltage, inductance,
Motion Setup Script Commands 20-5
resistance, load torque, mass, damping, external circuit; and all output quantities including: induced voltages, flux linkages in every winding, stranded loss, solid loss, core loss, torque and force. Command: Syntax: Return Value: Parameters: Example: Maxwell3D or Maxwell2D>Model>Set Symmetry Multiplier SetSymmetryMultiplier <int> None <int> oModule.SetSymmetryMultiplier 2
21
Parameter setup commands should be executed by the MaxwellParameterSetup module. Set oModule = oDesign.GetModule("MaxwellParameterSetup") oModule.CommandName <args>
DeleteParameters
Use: Command: Syntax: Return Value: Parameters: <NameArray> Type: Array of strings An array of parameter names. Example: oModule.DeleteParameters Array("Force1", "Torque1") Deletes one or more specified parameters. Delete button in Maxwell List dialog box (Maxwell3D or Maxwell2D>List) DeleteParameters <NameArray> None
DeleteAllParameters
Use: Command: Syntax: Return Value: Example: Deletes all parameters. Maxwell3D or Maxwell2D>Parameters>Delete All DeleteAllParameters None oModule.DeleteAllParameters
RenameParameter
Use: Command: Syntax: Return Value: Parameters: <OldName> Type: <string> <NewName> Type: <string>
Parameter Setup Script Commands 21-3
Renames a parameter. Right-click the parameter item in the project tree, and click Rename. RenameParameter <OldName>, <NewName> None
Example:
ReassignParameter
Use: Command: Syntax: Specifies a new geometry assignment for a parameter. Maxwell3D or Maxwell2D>Parameters>Reassign ReassignParameter Array("Name:<ParameterName>","Objects:=", <AssignmentObjects>) None oModule.ReassignParameter Array("NAME:Force1", _ "Objects:=", Array("Box2"))
AssignForce
Use: Command: Syntax: Return Value: Parameters: <ForceArray> Array("NAME:<ForceName>", "Is Virtual:=", <bool>, "Reference CS:=", Example: oModule.AssignForce _ Array("NAME:Force1", "Is Virtual:=", true, _ "Reference CS:=", "Global", "Objects:=", Array("Box1")) <string> "Objects:=", <AssignmentObjects>) Creates a force. Maxwell3D or Maxwell2D>Parameters>Assign>Force AssignForce <ForceArray> None
EditForce
Use: Command: Syntax: Return Value: Edits a force parameter. Double-click the parameter in the project tree to edit it. EditForce <ParameterName>, <ForceArray> None
AssignTorque
Use: Command: Syntax: Return Value: Parameters: <ForceArray> Array("NAME:<TorqueName>", "Is Virtual:=", <bool>, "Coordinate System:=", "Axis:=", <string>, "Is Positive:=", <bool> "Objects:=", <AssignmentObjects>) Example: oModule.AssignTorque _ Array("NAME:Torque1", "Is Virtual:=", true, _ "Coordinate System:=", "Global", "Axis:=", "Z", _ "Is Positive:=", true, "Objects:=", Array("Box3")) <string> Creates a torque. Maxwell3D or Maxwell2D>Parameters>Assign>Torque AssignTorque <TorqueArray> None
EditTorque
Use: Command: Syntax: Return Value: Edits a torque parameter. Double-click the parameter in the project tree to edit it. EditTorque <ParameterName>, <TorqueArray> None
AssignMatrix
Use: Command: Syntax: Return Value: Parameters: <MatrixArray> Array("NAME:<MatrixName>", Array("NAME:MatrixEntry", Array("NAME:MatrixEntry",
21-6 Parameter Setup Script Commands
"Source:=", <string>, "NumberOfTurns:=", <int>), ) Array("NAME:MatrixGroup", Array("NAME:MatrixGroup", "GroupName:=", <string>, "NumberOfBranches:=", <int>, "Sources:=", <nameArray>), )) Example: oModule.AssignMatrix _ Array("NAME:Matrix1", _ Array("NAME:MatrixEntry", _ Array("NAME:MatrixEntry", _ "Source:=","Current1", _ "NumberOfTurns:=", "1"), Array("NAME:MatrixEntry", _ "Source:=", "Current3", _ "NumberOfTurns:=", "1")), _ Array("NAME:MatrixGroup", _ Array("NAME:MatrixGroup", _ "GroupName:=", "Group1", _ "NumberOfBranches:=", "1", _ "Sources:=", "Current1,Current3")))
EditMatrix
Use: Command: Syntax: Return Value: Edits a matrix parameter. Double-click the parameter in the project tree to edit it. EditMatrix <ParameterName>, <MatrixArray> None
22
User Defined Solution commands should be executed by the "UserDefinedSolutionModule" module. Set oDesign = oProject.SetActiveDesign("TestDesign1") Set oModule = oDesign.GetModule("UserDefinedSolutionModule") CreateUserDefinedSolution DeleteUserDefinedSolutions EditUserDefinedSolution
CreateUserDefinedSolution
Use: Command: Syntax: Creates a new user defined solution. Create User Defined Solution popup menu is available in the Result folder context menu when applicable. CreateUserDefinedSolution <SolutionName>, <PluginFileLocation>, <PluginFileRelativePathName>, <PropertyValuesArray>, <ProbeSelectionArray>, <DynamicProbesArray> The name of the user defined solution that was created. Note: if the requested user defined solution name is not available because it is already in use, the user defined solution will be created with a different name which will be returned. <SolutionName> Type: String Requested name of new user defined solution. <PluginFileLocation> Type: String Indicates the library where the UDS plugin file is located. This parameter must be one of the following values: "SysLib", "UserLib", "PersonalLib". <PluginFileRelativePathName> Type: String The path of the UDS plugin file relative to the "UserDefinedOutputs"subdirectory of the library specified by <PluginFileLocation>. <PropertyValuesArray> Type: Array of strings Strings specify name-value pairs corresponding to the UDS properties specified in the plugin file. For example: Array("multiply_factor:=", "2.0", "component_name:=", "resistor1") <ProbeSelectionArray> Type: Array of <ProbeSelection>'s (see below) The probe specification array specifies how UDS probes are defined and mapped to traces in the design. <ProbeSelection> Type: Array of strings representing how a single probe is defined by a
22-2 User Defined Solutions Commands
Return Value:
Parameters:
trace. The array contains the below items: <ReportType> Type: String See the CreateReport command for more information. <ProbeName> Type: String Name of the probe being specified. Note: this must match a probe name specified in the UDS plugin file. <SolutionName> Type: String See the CreateReport command for more information. <SimulatedValueContexArray> Type: Array of strings See the CreateReport command for more information. <PointSetDefinitionArray> Type: Array of values with optional overriding values and optional variable values. See the CreateReport command for more information. <TraceExpressionArray> Type: Array of strings and values. This is similar to the TracesExpressionsArray used in the CreateReport command, but there will only be a single component expression named "Probe Component." See the CreateReport command for more information. <ExtendedTraceInformationArray> Type: Array of strings and values See the CreateReport command for more information. <DynamicProbesArray> Type: Array of <ProbeSelection>'s, representing the probes that are used by dynamic-probes. Example: oModule.CreateUserDefinedSolution "User Defined Solution 1", _ "SysLib", "Example", Array("multiplication_factor:=", "1.2"), Array(Array("Modal Solution Data", "Probe 1", "Setup1 : LastAdaptive", Array(),
User Defined Solutions Commands 22-3
Array("Freq:=", Array( "All")), Array("Probe Component:=", Array("dB(S(1,1))")), Array()), Array( "Modal Solution Data", "Probe 2", "Setup1 : LastAdaptive", Array(), Array("Freq:=", Array( "All")), Array("Probe Component:=", Array("mag(S(1,1))")), Array())), Array(Array( "Modal Solution Data", "Dynamic Probe 1", "Setup1 : LastAdaptive", Array(), Array("Freq:=", Array( "All")), Array("Probe Component:=", Array("Freq")), Array()))
DeleteUserDefinedSolutions
Use: Command: Syntax: Return Value: Parameters: <UserDefinedSolutionNames> Type: Array of strings Name of User Defined Solutions to be deleted. Example: Example: oModule.DeleteUserDefinedSolutions Array("Solution1", "Solution2") Deletes one or more user defined solutions 'Delete' button from the "User Defined Solutions" dialog. DeleteUserDefinedSolutions <UserDefinedSolutionNames> None
EditUserDefinedSolution
Use: Command: Syntax: Updates an existing user defined solution Command: 'Edit' button in the User Defined Solutions dialog Syntax: EditUserDefinedSolution <ExistingSolutionName>, <NewSolutionName>, <PluginFileLocation>, <PluginFileRelativePathName>, <PropertyValuesArray>, <ProbeSelectionArray>, <DynamicProbesArray> Return Value: the name of the user defined solution after being updated. Note: if the requested user defined solution name is not available because it is already in use, the user defined solution will be created with a different name which will be returned. <ExistingSolutionName> Type: String Name of the existing user defined solution <NewSolutionName>
22-4 User Defined Solutions Commands
Return Value:
Parameters:
Type: String Requested name for the updated user defined solution. <PluginFileLocation> See CreateUserDefinedSolution for more information. <PluginFileRelativePathName> See CreateUserDefinedSolution for more information. <PropertyValuesArray> See CreateUserDefinedSolution for more information. <ProbeSelectionArray> See CreateUserDefinedSolution for more information. <DynamicProbesArray> See CreateUserDefinedSolution for more information. Example: oModule.EditUserDefinedSolution "User Defined Solution 1", _ "User Defined Solution 2", "SysLib", "Example", Array("multiplication_factor:=", "1.2"), Array(Array("Modal Solution Data", "Probe 1", "Setup1 : LastAdaptive", Array(), Array("Freq:=", Array("All")), Array("Probe Component:=", Array("dB(S(1,1))")), Array()), Array( "Modal Solution Data", "Probe 2", "Setup1 : LastAdaptive", Array(), Array("Freq:=", Array( "All")), Array("Probe Component:=", Array("mag(S(1,1))")), Array())), Array(Array("Modal Solution Data", "Dynamic Probe 1", "Setup1 : LastAdaptive", Array(), Array("Freq:=", Array("All")), Array("Probe Component:=", Array("Freq")), Array()))
23
Example Scripts
= CreateObject("AnsoftMaxwell.MaxwellScriptInter_
Case "mm" Case "um" Case "in" Case "mil" Case Else MsgBox("Invalid Units - defaults to m") Units = "" End Select Obtain the other user-defined parameters. Turns = InputBox("Select the number of turns (must be _ integer):","Variable Helix", 2,50,50) PointsPerTurn = InputBox("Select the points per turn:", _ "Variable Helix",16,50,50) R(0) = InputBox("Select the initial Radius: ", _ "Variable Helix",10,50,50) R(1) = InputBox("Select the final Radius: ", _ "Variable Helix",10,50,50) P(0) = InputBox("Select the initial Pitch: ", _ "Variable Helix", 4,50,50) P(1) = InputBox("Select the final Pitch: ", _ "Variable Helix", 4,50,50) NumPoints = Turns*PointsPerTurn Initialize the points and segments arrays. Redim points(NumPoints+1) Redim segments(NumPoints) points(0) = "NAME:PolylinePoints" segments(0) = "NAME:PolylineSegments" Build the Point and Segment Arrays needed in the Maxwell polyline call. For n = 1 To (NumPoints+1)
Example Scripts 23-3
Angle = (n-1)*2*Pi/PointsPerTurn Radius = R(0) + ((n-1)/NumPoints)*(R(1)-R(0)) Pitch = P(0) + ((n-1)/NumPoints)*(P(1)-P(0)) Rise = (n-1)*Pitch/PointsPerTurn XValue = cstr(Radius*cos(Angle)) & Units YValue = cstr(Radius*sin(Angle)) & Units ZValue = cstr(Rise) & Units points(n) = Array("NAME:PLPoint", "X:=", XValue, "Y:=", _ YValue, "Z:=", ZValue) Create the line segments between each pair of points. If n<=NumPoints Then segments(n) = Array("NAME:PLSegment", "SegmentType:=", _ "Line", "StartIndex:=", (n-1), "NoOfPoints:=", 2) End If Next Create the polyline. oEditor.CreatePolyline _ Array("NAME:PolylineParameters", "IsPolylineCovered:=", true, _ "IsPolylineClosed:=", false, points, segments), _ Array("NAME:Attributes", "Name:=", "Line_Helix","Flags:=", _ "", "Color:=", "(132 132 193)", "Transparency:=",0.4, _ "PartCoordinateSystem:=", "Global", "MaterialName:=", _ "vacuum", "SolveInside:=", true) Create the helix cross-section. oEditor.CreateCircle _ Array("NAME:CircleParameters", "IsCovered:=", true, "XCenter:=",_ cstr(R(0))&Units, "YCenter:=", 0, "ZCenter:=", 0, "Radius:=", _ "1"&Units, "WhichAxis:=", "Y"), _
23-4 Example Scripts
Array("NAME:Attributes", "Name:=", "Circle_Helix", "Flags:=", _ "", "Color:=", "(132 132 193)", "Transparency:=", 0.4, _ "PartCoordinateSystem:=", "Global", "MaterialName:=", "vacuum", _ "SolveInside:=", true) Sweep the cross-section along the path. oEditor.SweepAlongPath _ Array("NAME:Selections", "Selections:=", _ "Circle_Helix,Line_Helix"), _ Array("NAME:PathSweepParameters", "DraftAngle:=", "0deg", _ "DraftType:=", "Round", "TwistAngle:=", "0deg")
= CreateObject("AnsoftMaxwell.MaxwellScriptInter_
Set oFS = CreateObject("Scripting.FileSystemObject") Set ofile = oFS.CreateTextFile (path) line = "Radius" & chr(9) & "Self L" & chr(9) & "Self R" ofile.WriteLine line Input the needed radius and solution data and clean it up. msgbox("For the following input make sure it matches "& _ "the radii defined in your parametric sweep") range = inputbox("Input the range of radii in cm" & _ "and number of points",_ "Radius","0.325,0.225,5",50,50) Define the 2 output variables. oDesign.AddOutputVariable "self_L",_ "ACL(trace:trace_src,trace:trace_src)" oDesign.AddOutputVariable "self_R",_ "ACR(trace:trace_src,trace:trace_src)" arr = split (range, ",") arr(0) = Trim(arr(0)) arr(1) = Trim(arr(1)) arr(2) = Trim(arr(2)) if cint(arr(2)) <> 1 then del_rad = (arr(1)-arr(0))/(arr(2)-1) else del_rad = 0 end if temp = InputBox("Input the Setup number to use:"_ & chr(13) & "(e.g. input 1 for Setup1))", _ "Solution Data","1,1",50,50) arr2 = split(temp,",") stn = arr2(0) stn = Trim(stn)
Example Scripts 23-7
Loop through the radius points. for i=1 to arr(2) step 1 rad = arr(0) + (cint(i)-1)*del_rad x=rad crad="Radius='" & rad & "cm" Get the values of the output variables for the desired radius. val = oDesign.GetOutputVariableValue("self_L","Setup" & _ stn, crad, "") y = val val = oDesign.GetOutputVariableValue("self_R","Setup" & _ stn, crad, "") z = val Create the line of text to send to the file, and write it to the file. line = x & chr(9) & y & chr(9) & z ofile.WriteLine line Next Delete the 2 output variables before finishing. oDesign.DeleteOutputVariable "self_L" oDesign.DeleteOutputVariable "self_R" Close the file. ofile.close End if
Optimetrics module command 5, 6 Symbols .vbs file format 5 Numerics 3D Modeler Editor commands DeletePolylinePoint 16 InsertPolylineSegment 14 3D Modeler editor commands AssignMaterial 25 Chamfer 25 Connect 25 Copy 19 CoverLines 26 CoverSurfaces 26 CreateBondwire 3 CreateBox 4 CreateCircle 5 CreateCone 6 CreateCutplane 6 CreateCylinder 7 CreateEllipse 7 CreateEntityList 26 CreateFaceCS 27, 28 CreateHelix 8 CreateObjectFromdges 30 CreateObjectFromFaces 31 CreatePoint 8 CreatePolyline 9 CreateRectangle 10 CreateRegularPolygon 12 CreateRegularPolyhedron 11 CreateRelativeCS 32 CreateSphere 12 CreateSpiral 13 CreateTorus 13 CreateUserDefinedPart 9 Delete 47
DeleteLastOperation 32 DetachFaces 33 DuplicateAlongLine 19 DuplicateAroundAxi 20 DuplicateMirror 20 EditEntityList 33 EditFaceCS 34 EditObjectCS 34 EditPolyline 14 EditRelativeCS 36 Export 37 Fillet 37 GenerateHistory 38 GetEdgeByPosition 47 GetFaceByPosition 48 GetModelBoundingBox 47, 52 GetNumObjects 50 GetSelections 50 Import 38 ImportDXF 38 Intersect 41 Mirror 21 Move 21 MoveFaces 42 OffsetFaces 21 PageSetup 51 Paste 22 RenamePart 51 Rotate 22 Scale 22 Section 43 SeparateBody 43 SetModelUnits 43 SetWCS 44 Split 44 Subtract 45 SweepAlongPath 16 SweepAlongVector 17
A
AddCartesianXMarker 2 AddDataset 2 AddDeltaMarker 3 AddMarker 4 AddMaterial 2 AddNamedExpr 3 AddNamedExpression 2 AddNote 4 AddTerminalsToWinding 25 AddTraces 5
Analysis module commands CopySetup 14 DeleteSetups 10 EditSetup 8 ExportCircuit 10 ExportSolnData 11 GetSetupNames 13 GetSetups 13 InsertSetup 2 PasteSetup 14 RenameSetup 9 ResetAllToTimeZero 13 ResetSetupToTimeZero 13 RevertAllToInitial 12 RevertSetupToInitial 12 SolveSetup 14 Analyze 10 AnalyzeAll 10 AnalyzeAllNominal 10 AnalyzeDistributed 10 Ansoft Application Object commands 1 Ansoft Application object commands GetAppDesktop 2 SetDesiredRamMBLimit 2
Application object commands GetHPCLicenseType 3 GetUseHPCForMP 3 SetHPCLicenseType 5 ApplyMeshOps 9 arithmetic operators 8 array variables 6 AssignBand 3 AssignCharge 20 AssignCoilTerminal 21 AssignCoilTerminalGroup 22 AssignCurrent 19 AssignCurrentDensity 17 AssignCurrentDensityGroup 18 AssignCurrentDensityTerminal 18
AssignCurrentDensityTerminalGroup 18, 19 AssignCurrentGroup 19 AssignCylindricalHField 13 AssignFloating 20 AssignForce 5 AssignImpedance 12 AssignInsulating 9 AssignLengthOp 5 AssignMaster 10 AssignMaterial 25 AssignMatrix 6 AssignModelResolutionOp 7 AssignRadiation 11 AssignSink 22 AssignSkinDepthOp 6 AssignSlave 11 AssignSymmetry 9 AssignTangentialHField 13 AssignTorque 6 AssignTrueSurfOp 7 AssignVoltage 15 AssignVoltageDrop 16 AssignVoltageDropGroup 17
B Boundary/Excitation module commands AddTerminalsToWinding 25 AssignCharge 20 AssignCoilTerminal 21 AssignCoilTerminalGroup 22 AssignCurrent 19 AssignCurrentDensity 17 AssignCurrentDensityGroup 18 AssignCurrentDensityTerminal 18 AssignCurrentDensityTerminalGroup 18, 19 AssignCurrentGroup 19 AssignCylindricalHField 13 AssignFloating 20 AssignImpedance 12 AssignInsulating 9 AssignMaster 10 AssignRadiation 11 AssignSink 22 AssignSlave 11 AssignSymmetry 9 AssignTangentialHField 13 AssignVoltage 15 AssignVoltageDrop 16 AssignVoltageDropGroup 17 AssignVoltageGroup 16 AssignVolumeChargeDensity 21 AssignWindingGroup 24 AssignZeroTangentialHField 8 DeleteAllExcitations 3, 4 DeleteBoundaries 3 EditCharge 21 EditCoilTerminal 22 EditCurrent 19
EditCurrentDensity 18 EditCurrentDensityTerminal 19 EditCylindricalHField 14 EditExternalCircuit 25 EditFloating 20 EditImpedance 12 EditInsulating 10 EditMaster 11 EditRadiation 12 EditSink 23 EditSlave 11 EditSymmetry 9 EditTangentialHField 13 EditVoltage 16 EditVoltageDrop 17 EditVolumeChargeDensity 21 EditWindingGroup 25 EditZeroTangentialHField 9 GetBoundaries 4 GetBoundariesOfType 4 GetBoundaryassignment 4 GetExcitations 5 GetExcitationsOfType 5 GetNumBoundaries 5 GetNumBoundariesOfType 5 GetNumExcitations 6 GetNumExcitationsOfType 6 ReassignBoundary 7 RenameBoundary 6 RepriortizeBoundaries 7 SetCoreLoss 26 SetEddyEffect 26 SetMinimumTimeStep 27
C
CalcOp 3 CalcRead 3 CalcStack 4 CalculatorRead 4
CalculatorWrite 5 CalcWrite 5 Chamfer 25 ChangeGeomSettings 6 ChangeProperty 4 ClcEval 6 ClcMaterial 6 ClearAllMarkers 6 ClearAllNamedExpr 6 Close 4 CloseAllWindows 2 CloseProject 3 CloseProjectNoForce 3
comment lines 3 comparison operators 9 conditional statements If...Then... Else 10 Select Case 10 types of 10 Connect 25 conventions command syntax 7 data types 7 script command 8 converting data types 12 Copy 19 CopyDesign 5 CopyNamedExprToStack 7 CopyReportData 7 CopyReportDefinition 7 copyright notice ii
CopySetup
Analysis module command
14
CreateBondwire 3 CreateBox 4 CreateCircle 5 CreateCone 6 CreateCutplane 6 CreateCylinder 7 CreateEllipse 7 CreateEntityList 26 CreateFaceCS 27, 28 CreateFieldPlot 2 CreateHelix 8 CreateObjectFromEdges 30 CreateObjectFromFaces 31 CreateOutputVariable 2 CreatePoint 8 CreatePolyline 9 CreateRectangle 10 CreateRegularPolygon 12 CreateRegularPolyhedron 11 CreateRelativeCS 32 CreateReport 8 CreateReportFromTemplate 10 CreateSphere 12 CreateSpiral 13 CreateTorus 13 CreateUserDefinedPart 9 CreateUserDefinedSolution 2 CutDesign 6
DeleteDataset 3 DeleteDesign 6 DeleteFieldPlot 6 DeleteLastOperation 32 DeleteMotionSetup 3 DeleteNamedExpr 7 DeleteOp 3 DeleteOutputVariable 4 DeleteParameters 3 DeletePolylinePoint 16 DeleteReport 15 DeleteSetups
Analysis module command
10
DeleteAllReports 15 DeleteOutputVariable 4 DeleteReport 15 DeleteTraces 11 DeleteVariation 6 DoesOutputVariableExist 4 EditNotes 9 EditOutputVariable 3 ExportConvergence 11 ExportProfile 13 ExportToFile 11 GetAllReportNames 13 GetDesiredRamMBLimit 6 GetDisplayType 13 GetLibraryDirectory 4 GetMatchedObjectName 50 GetMaximumRamMBLimit 7 GetModule 4 GetName 3 GetNominalVariation 14 GetNumberOfProcessors 7 GetObjectIDByName 49 GetObjectName 49, 50 GetOutputVariables 4 GetOutputVariableValue 4 GetProjectDirectory 4 GetTempDirectory 5 GetUser Position 49 GetVariationVariableValue 12 ImportIntoReport 13 Is2D 14 Is3D 14 PasteReports 14 PasteTraces 14 Redo 8 RenameDesignInstance 8 RenameReport 15 RenameTrace 15
SetActiveEditor 7 SetConductivityThreshold 11 SetDesignSettings 4 SetLibraryDirectory 9 SetMaximumRamMBLimit 5 SetNumberOfProcessors 6 SetProjectDirectoryVBCommand> 9 SetSolutionType 7 SetTempDirectory 9 SetUseHPCForMP 4 ShowWindow 44 Solve 8 UpdateTraces 16 UpdateTracesContextAndSweeps 17
Desktop object commands CloseAllWindows 2 CloseProject 3 CloseProjectNoForce 3 Count 11 EnableAutoSave 3 ExportOptionsFiles 3 GetActiveProject 4 GetDesigns 12
GetDistributedAnalysisMachines 12 GetName 12 GetProjectList 4 GetProjects 12 NewProject 5 OpenMultipleProjects 5 OpenProject 6 PauseScript 6 Print 6 QuitApplication 6 RestoreWindow 7 RunProgram 7 RunScript 7 SetActiveProject 8 SetActiveProjectByPath 8
E
EditCharge 21 EditCoilTerminal 22 EditCurrent 19 EditCurrentDensity 18 EditCurrentDensityTerminal 19 EditCylindricalHField 14 EditDataset 2 EditEntityList 33 EditExternalCircuit 25 EditFaceCS 34 EditFloating 20 EditForce 5 EditImpedance 12 EditInsulating 10 EditLengthOp 8 EditMaster 11 EditMaterial 5 EditMatrix 7 EditModelResolutionOp 9 EditMotionSetup 5 EditNotes 9 EditObjectCS 34 EditOutputVariable 3 EditPolyline 14 EditRadiation 12 EditRelativeCS 36 EditSetup
Analysis module command
EditSink 23 EditSkinOp 8 EditSlave 11 EditSymmetry 9 EditTangentialHField 13 EditTorque 6 EditTrueSurfOp 8 EditUserDefinedSolution 4 EditVoltage 16 EditVoltageDrop 17 EditVolumeChargeDensity 21 EditWindingGroup 25 EditZeroTangentialHField 9 EnableAutoSave 3 EnterComplex 7 EnterComplexVector 8 EnterLine 8 EnterPoint 8 EnterQty 9 EnterScalar 9 EnterScalarFunc 9 EnterSurf 10 EnterVector 10 EnterVectorFunc 10 EnterVol 11 Export 37 ExportCircuit
Analysis module command
10
11
ExportToFile 11, 12
F
FFTOnReport 12
Field Overlay module commands GetFieldPlotNames 6 Field Overlays module commands AddNamedExpr 3 AddNamedExpression 2 CalcOp 3 CalcRead 3 CalcStack 4 CalcWriter 5 ChangeGeomSettings 6 ClcEval 6 ClcMaterial 6 ClearAllNamedExpr 6 CopyNamedExprToStack 7 CreateFieldPlot 2 DeleteFieldPlot 6 DeleteNamedExpr 7 EnterComplex 7 EnterComplexVector 8 EnterLine 8 EnterPoint 8 EnterQty 9 EnterScalar 9 EnterScalarFunc 9 EnterSurf 10 EnterVector 10 EnterVectorFunc 10 EnteVol 11 ExportOnGrid 11 ExportToFile 12 GetTopEntryValue 12 LoadNamedExpressions 13 ModifyFieldPlot 6 RenameFieldPlot 7
Fields Calculator commands AddNamedExpr 2, 3, 6 CalcOp 3 CalcRead 3 CalcStack 4 CalcWrite 5 ChangeGeomSettings 6 ClcEval 6 ClcMaterial 6 CopyNamedExprToStack 7 DeleteNamedExpr 7 EnterComplex 7 EnterComplexVector 8 EnterLine 8 EnterPoint 8 EnterQty 9 EnterScalar 9 EnterScalarFunc 9 EnterSurf 10 EnterVector 10 EnterVectorFunc 10 EnterVol 11 ExportOnGrid 11 ExportToFile 12 GetTopEntryValue 12 LoadNamedExpressions 13 SaveNamedExpressions 13 Fillet 37 For...Next loop 11 G GenerateHistory 38 GetActiveDesign 3 GetActiveProject 4 GetAllReportNames 13
GetAppDesktop 2 GetBoundaries 4 GetBoundariesOfType 4 GetBoundaryAssignment 4 GetDesign 3 GetDesigns 12 GetDesiredRamMBLimit 6 GetDisplayType 13 GetDistributedAnalysisMachines 12 GetEdgeByPosition 47 GetExcitations 5 GetExcitationsOfType 5 GetFaceByPosition 48 GetFieldPlotNames
Field Overlay module command
GetHPCLicenseType 3 GetLibraryDirectory 4 GetMatchedObjectName 50 GetMaximumRamMBLimit 7 GetModelBoundingBox 47, 52 GetModule 4 GetName 12, 2, 3 GetNominalVariation 14 GetNumberOfProcessors 7 GetNumBoundaries 5 GetNumBoundariesOfType 5 GetNumExcitations 6 GetNumExcitationsOfType 6 GetNumObjects 50 GetObjectIDByName 49 GetObjectName 49, 50 GetOperationNames
Mesh Operations module command
13 13
GetSetups
Analysis module command
GetVersion 5 gotolink CalculatorRead 2 gotolink CalculatorWrite 2 H help Ansoft technical support iii hierarchy of variables in Maxwell 2 I If...Then... Else statement 10 Import 38 ImportDXF 38 ImportIntoReport 13 InputBox function 13 InsertDesign 4 InsertPolylineSegment 14
InsertSetup
Analysis module command optimization command 10 parametric command 7 sensitivity command 13 statistical command 15
Intersect 41
Is2D 14 Is3D 14
Mesh Operations module commands AssignLengthOp 5 AssignModelResolutionOp 7 AssignSkinDepthOp 6 AssignTrueSurfOp 7 DeleteOp 3 EditLengthOp 8 EditModelResolutionOp 9 EditSkinOp 8 EditTrueSurfOp 8 GetOperationNames 3 RenameOp 3 Microsoft VBScript users guide 13 Visual Basic 1 Mirror 21 ModifyFieldPlot 6 Module Setup commands SetSymmetryMultiplier 5 modules in Maxwell scripting 4
Motion Setup commands AssignBand 3 DeleteMotionSetup 3 EditMotionSetup 5 ReassignMoving 3 Move 21 MoveFaces 42 MsgBox function 13 N newlink CalculatorRead 4 newlink CalculatorWrite 5 NewProject 5 O oAnsoftApp object 3 oDesign object 3 oDesktop object 3 oEditor object 4 OffsetFaces 21 oModule object 4 OpenMultipleProjects 5 OpenProject 6 operators arithmetic 8 categories in VBScript 8 comparison 9 logical 9 precedence of 8 oProject object 3 GetSetupNames 5 GetSetupNamesByType 6 Optimetrics module commands DeleteSetups 5 DistributeAnalyzeSetup 5 GetSetupNames 5 GetSetupNamesByType 6 RenameSetup 5, 6 SolveSetup 6 optimization commands
EditSetup 12 InsertSetup 10
P
PageSetup 51
Parameter Setup commands AssignForce 5 AssignMatrix 6 AssignTorque 6 DeleteAllParameters 3 DeleteParameters 3 EditForce 5 EditMatrix 7 EditTorque 6 ReassignParameter 4 RenameParameter 3 parametric commands EditSetup 9 InsertSetup 7 Paste 6, 22 PasteReports 14
PasteSetup
Analysis module command
14
PasteTraces 14 PauseScript 6
pausing a script 7
Print 6
CopyDesign 5 CutDesign 6 DeleteDataset 3 DeleteDesign 6 DoesMaterialExist 4 EditDataset 2 EditMaterial 5 ExportMaterial 6 GetActiveDesign 3 GetDesign 3 GetName 2 GetPath 2 GetProperties 22 GetPropertyValue 21 GetTopDesignList 3 GetVariables 23 GetVariableValue 22 InsertDesign 4 Paste 6 Redo 7 RemoveMaterial 6 Save 4 SaveAs 4 SetActiveDesign 3 SetPropertyValue 21 SetVariableValue 23 SimulateAll 7 Undo 6
Q
QuitApplication 6
R
ReassignBoundary 7 ReassignMoving 3 ReassignParameter 4
recording a script 5
Redo
design-level command 8 project-level command 7
5, 6
RenameTrace 15
Reporter editor commands AddCartesianXMarker 2 AddDeltaMarker 3 AddMarker 4 AddNote 4 AddTraces 5 ClearAllMarkers 6 CopyReportData 7 CopyReportDefinition 7 CopyTraceData 7 CopyTraceDefinition 8 CreateReport 8
CreateReportFromTemplate 10 DeleteAllReports 15 DeleteReport 15
DeleteTraces 11 ExportToFile 11 FFTOnReport 12 GetAllReportNames 13 GetDisplayType 13 ImportIntoReport 13 PasteReports 14 PasteTraces 14 RenameReport 15 RenameTrace 15 UpdateTraces 16 UpdateTracesContextAndSweeps 17 RepriortizeBoundaries 7 ResetAllToTimeZero 13 ResetSetupToTimeZero 13 RestoreWindow 7
resuming a script 7 RevertAllToInitial 12 RevertSetupToInitial 12 Rotate 22 running a script 6 RunProgram 7 RunScript 7 S sample scripts data export 6 simple Maxwell 3 variable helix 2 Save 4 SaveAs 4
SaveNamedExpressions 13 Scale 22
running from command prompt 1 stop recording 5 stopping execution of 7 Section 43 Select Case statement 10 sensitivity commands EditSetup 14 InsertSetup 13 SeparateBody 43 SetActiveDesign 3 SetActiveEditor 7 SetActiveProject 8 SetActiveProjectByPath 8 SetConductivityThreshold 11 SetCoreLoss 26 SetDesignSettings 4 SetDesiredRamMBLimit 2 SetEddyEffect 26 SetFieldPlotSettings 8 SetHPCLicenseType 5 SetLibraryDirectory 9 SetMaximumRAMMBLimit 5 SetMinimumTimeStep 27 SetModelUnits 43 SetNumberOfProcessors 6 SetPlotFolderSettings 8 SetProjectDirectory 9 SetPropertyValue 21 SetSolutionType 7 SetSymmetryMultiplier 5 SetTempDirectory 9 SetUseHPCForMP 4 SetVariableValue 23 SetWCS 44 ShowlWindow 44 SimulateAll 7 Sleep 9 Solve 8
SolveSetup
Analysis module command 14 Optimetrics module command 6
Split 44
statistical commands EditSetup 17 InsertSetup 15 stopping a script 7 stopping script recording 5 Sub procedures 3 Subtract 45 SweepAlongPath 16 SweepAlongVector 17 SweepAroundAxis 17 T trademark notice ii U UncoverFaces 45 underscore ( _ ) character 4
Undo
design-level command 8 project-level command 6
UserDefinedSolutions module commands CreateUserDefinedSolution 2 DeleteUserDefinedSolution 4 EditUserDefinedSolution 4 V variables array 6 assigning information 5 declaring 5 hierarchy in Maxwell 2 used as objects 3 used in Maxwell scripts 2 VBScript
.vbs file format 5 Microsoft users guide 13 operators 8 overview 1 references 13 Sub procedures 3