HFSS Scripting
HFSS Scripting
Scripting Guide
ANSYS, Inc.
Southpointe
November 2013
ANSYS Electromagnetics Suite 15.0
ANSYS, Inc. is
certified to ISO
9001:2008.
Disclaimer Notice
THIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETS
AND ARE CONFIDENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, OR
LICENSORS. The software products and documentation are furnished by ANSYS, Inc., its
subsidiaries, or affiliates under a software license agreement that contains provisions concerning
non-disclosure, copying, length and nature of use, compliance with exporting laws, warranties,
disclaimers, limitations of liability, and remedies, and other provisions. The software products and
documentation may be used, disclosed, transferred, or copied only in accordance with the terms
and conditions of that software license agreement.
ANSYS, Inc. is certified to ISO 9001:2008.
Third-Party Software
See the legal information in the product help files for the complete Legal Notice for ANSYS
proprietary software and third-party software. If you are unable to access the Legal Notice,
please contact ANSYS, Inc.
Published in the U.S.A.
Table of Contents
1. Introduction to VBScript
A Sample HFSS Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
VBScript Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Declaring Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
Array Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4
1-5
1-5
1-5
1-6
1-7
1-7
1-8
1-9
Recording a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Stopping Script Recording . . . . . . . . . . . . . . . . . . . . . . . . .
Running a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Pausing and Resuming a Script . . . . . . . . . . . . . . . . . . . .
Stopping a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modifying a Script for Easier Playback . . . . . . . . . . . . . . .
HFSS Scripting Conventions . . . . . . . . . . . . . . . . . . . . . . .
2-6
2-6
2-6
2-7
2-7
2-7
2-8
Syntax Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Script Command Conventions . . . . . . . . . . . . . . . . . . . . .
Named Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting Numerical Values . . . . . . . . . . . . . . . . . . . . . . . . .
2-8
2-8
2-9
2-10
CloseProjectNoForce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
EnableAutoSave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4
GetActiveProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
GetAutoSaveEnabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
GetDesigns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5
GetDistributedAnalysisMachines . . . . . . . . . . . . . . . . . . . 4-6
GetName [Desktop] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
GetLibraryDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
GetProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6
GetProjectDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
GetProjectList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
GetTempDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
GetVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7
NewProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
OpenMultipleProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
OpenProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8
PauseScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
QuitApplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
RestoreWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9
RunProgram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
RunScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
SetActiveProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
SetActiveProjectByPath . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11
SetLibraryDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
SetProjectDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
SetTempDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
Sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
DeleteDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
GetActiveDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
GetDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
GetName [Project] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
GetPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3
GetTopDesignList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
InsertDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Paste [Design] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4
Redo [Project Level] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
SaveAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
SetActiveDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
SimulateAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Undo [Project] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
RunToolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14
Undo [Design] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16
GenerateHistory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-43
HealObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-43
Import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-45
ImportDXF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-46
ImportGDSII . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-47
Intersect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-49
MoveCStoEnd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-49
MoveFaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-50
ProjectSheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-51
PurgeHistory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-52
Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-52
SeparateBody . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-52
SetModelUnits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-53
SetWCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-53
ShowWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-54
Split . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-54
Subtract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-54
SweepFacesAlongNormal . . . . . . . . . . . . . . . . . . . . . . . 11-55
ThickenSheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-56
UncoverFaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-56
Unite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-57
GetObjectsInGroup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-63
GetObjectIdByName . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-63
GetObjectName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-63
GetObjectNameByFaceID . . . . . . . . . . . . . . . . . . . . . . . 11-64
GetMatchedObjectName . . . . . . . . . . . . . . . . . . . . . . . . 11-64
GetModelUnits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-64
GetNumObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-65
GetSelections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-65
GetUserPosition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-65
GetVertexIDsFromEdge . . . . . . . . . . . . . . . . . . . . . . . . . 11-66
GetVertexIDsFromFace . . . . . . . . . . . . . . . . . . . . . . . . . 11-66
GetVertexIDsFromObject . . . . . . . . . . . . . . . . . . . . . . . . 11-67
PageSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-67
RenamePart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-67
CreateReportFromTemplate . . . . . . . . . . . . . . . . . . . . . 13-12
DeleteAllReports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-12
DeleteReports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-12
DeleteTraces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-13
ExportPlotImageToFile [Reporter] . . . . . . . . . . . . . . . . . 13-13
ExportToFile [Reporter] . . . . . . . . . . . . . . . . . . . . . . . . . 13-15
FFTOnReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-15
GetAllReportNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-16
GetDisplayType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-17
ImportIntoReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-18
PasteReports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-18
PasteTraces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-19
RenameReport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-19
RenameTrace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-19
UpdateAllReports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-20
UpdateReports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-20
UpdateTraces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-21
UpdateTracesContextandSweeps . . . . . . . . . . . . . . . . . 13-23
GetExcitationsOfType . . . . . . . . . . . . . . . . . . . . . . . . . . 14-7
GetNumBoundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-7
GetNumBoundariesOfType . . . . . . . . . . . . . . . . . . . . . . 14-7
GetNumExcitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-7
GetNumExcitationsOfType . . . . . . . . . . . . . . . . . . . . . . . 14-8
GetPortExcitationCounts . . . . . . . . . . . . . . . . . . . . . . . . 14-8
ReassignBoundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-8
RenameBoundary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-9
ReprioritizeBoundaries . . . . . . . . . . . . . . . . . . . . . . . . . . 14-9
SetDefaultBaseName . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-9
EditDiffPairs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-35
EditFiniteCond . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-36
EditImpedance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-37
EditIncidentWave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-38
EditLayeredImpedance . . . . . . . . . . . . . . . . . . . . . . . . . 14-39
EditMaster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-39
EditPerfectE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-39
EditPerfectH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-39
EditLumpedPort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-40
EditLumpedRLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-41
EditMagneticBias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-41
EditRadiation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-41
EditSlave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-42
EditSymmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-42
EditTerminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-43
EditVoltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-43
EditWavePort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-43
SetTerminalReferenceImpedances . . . . . . . . . . . . . . . . 14-44
UnassignIERegions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-44
Contents-12
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
RenameDrivenSweep . . . . . . . . . . . . . . . . . . . . . . . . . . 16-18
RenameSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-18
RenameSweep [HFSS-IE] . . . . . . . . . . . . . . . . . . . . . . . 16-19
RevertAllToInitial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-19
RevertSetupToInitial . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-19
SetPlotFolderSettings . . . . . . . . . . . . . . . . . . . . . . . . . . 19-10
Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2
DeleteFarFieldSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2
DeleteNearFieldSetup . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2
GetSetupNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21-2
RenameSetup [Radiation] . . . . . . . . . . . . . . . . . . . . . . . 21-3
Contents-17
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Contents-18
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Introduction to VBScript
HFSS 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.
When you execute a script, the commands in the script are performed.
You can write a script using any text editor or you can record a script from
within the HFSS interface. After recording the script from within HFSS, you
can then modify it if necessary using a text editor.
Although HFSS 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 HFSS 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.
In a Sub or Function procedure call, you can group the input parameters inside
parentheses or without parentheses. Here the four strings are the input parameters of
the Sub procedure InsertDesign of the object oProject.
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
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:=",
VBScript Variables
A VBScript variable is a placeholder representing information that may change during the time
your script is running. Use a variable name in a script to view or modify its value.
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"
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().
VBScript Operators
VBScript provides operators, which are grouped into these categories: arithmetic operators,
comparison operators, and logical operators.
Please see the online VBScript Users Guide for more details.
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 evaulated
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
Description
Exponentiation
Unary negation
Multiplication
Division
Integer division
Mod
Modulus arithmetic
Addition
Subtraction
&
String concatenation
Comparison Operators
Following is a list of VBScripts comparison operators.
Symbol
=
Description
Equality
<>
Inequality
<
Less than
>
Greater than
Introduction to VBScript 1-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<=
>=
Is
Object equivalence
Logical Operators
Following is a list of VBScripts logical operators:
Symbol
Description
Not
Logical negation
And
Logical conjunction
Or
Logical disjunction
Xor
Logical exclusion
Eqv
Logical equivalence
Imp
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
Syntax: CStr(variablename).
Converts variablename to a string. For example, it can be used to
convert the number 2.5 to the string "2.5".
CBool
Syntax: CBool(variablename).
Converts variablename to a boolean. If variablename is 0 or "0",
CBool returns False. Otherwise it returns True.
CDbl
Syntax: CDbl(variablename).
Converts variablename to a double precision number. For example,
it can be used to convert the string "2.5" to the number 2.5.
CInt
Syntax: CInt(variablename).
Converts variablename to an integer.
The InputBox function displays a dialog box with an input field. The value that is typed into
the input field is returned. For example:
Dim users_string
users_string = InputBox ("text prompt", "title of the pop-up dialog _
box", "default text for the input box")
The last two arguments to the function are optional.
The MsgBox function shows a message and returns a number based on the button the user
presses. For example:
MsgBox ("message text")
This chapter provides an overview of HFSS scripting using VBScript. Information is included on the following topics:
oAnsoftApp
The oAnsoftApp object provides a handle for VBScript to access the AnsoftHfss product.
One example of accessing this object is:
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
oDesktop
The oDesktop object is used to perform desktop-level operations, including project management.
One example of accessing this object is:
Set oDesktop = oAnsoftApp.GetAppDesktop()
See Chapter 3, 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. One example of accessing this object is:
Set oProject = oDesktop.GetActiveProject()
See the following chapters for details about the script commands recognized by the oProject
object:
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.
One example of accessing this object is:
Set oDesign = oProject.GetActiveDesign()
See the following chapters for details about the script commands recognized by the oDesign
object:
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.
One example of accessing this object is:
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
The AnsoftHfss product scripting supports the following editors:
Editor
Name in Script
3D Modeler Editor
"3D Modeler"
Reporter Editor
See Chapter 10, 3D Modeler Editor Script Commands, for details about the script commands recognized by the oEditor object and Chapter 11, 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.
One example of accessing this object is:
Set oModule = oDesign.GetModule("BoundarySetup")
Name in Script
"BoundarySetup"
"MeshSetup"
"AnalysisSetup"
"Optimetrics"
"Solutions"
"FieldsReporter"
"RadField"
Chapter
Recording a Script
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.
Running a Script
1 Click Tool>Run Script.
The Open dialog box appears.
2 Use the file browser to locate the folder in which you saved the script, and then double-click
3
To run a script from a command line (as described in the HFSS Online Help in the Running HFSS
from a Command Line section), use:
-runscriptandexit or -runscript arguments to the HFSS command line syntax.
You can give -scriptargs parameter to the script and specify the arguments described in the
HFSS online help.
If you run the script from DOS prompt as a .vbs file (that is, you don't launch HFSS, but just
launch vbs directly, or use wscript.exe or cscript.exe), the arguments will be in the
2-6 HFSS and VBScript
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Stopping a Script
A quoted string.
<bool>
<double>
<int>
An integer. Example: 1
<value>
Command:
Lists the interface command that corresponds to the script command. Menu
commands are separated by carats. For example,
HFSS>Excitations>Assign>Wave Port.
Syntax:
Return Value:
Parameters:
Example:
C:\Ansoft\HFSS13\hfss.exe -RunScriptAndExit _
C:\scripts\test.vbs -scriptsargs "arg1 arg2 arg3"
When running from Tools>Run script, there is an edit field at the bottom of the file selection dialog that you can use to enter script arguments.
The user can access the script arguments using the AnsoftScriptHost.arguments collection from
vbscript. This is a standard COM collection.
There is an issue if the user runs the script from DOS prompt as a .vbs file (that is, you dont
open hfss, but 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,
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 HFSS script commands use named arguments. The names can appear in three ways:
1. Named data, name precedes data.
HFSS and VBScript 2-9
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<ScriptName>
If the full path to the script is not specified, HFSS searches for the specified script in the following locations, in this order:
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 6, 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
GetDesiredRamMBLimit
GetHPCLicenseType
GetMaximumRamMBLimit
GetMPISpawnCmd
GetMPIVendor
GetNumberOfProcessors
GetUseHPCForMP
SetDesiredRamMBLimit
SetHPCLicenseType
SetMaximumRamMBLimit
SetNumberOfProcessors
SetUseHPCForMP
SetMPISpawnCmd
SetMPIVendor
GetAppDesktop
Use:
Syntax:
GetAppDesktop()
Return Value:
Object.
Parameters:
None
Example:
Set oDesktop = oAnsoftApp.GetAppDesktop()
GetDesiredRamMBLimit
Use:
Gets the Desired RAM Limit (MB) value in HFSS. Not used in HFSS-IE.
Syntax:
GetDesiredRamMBLimit()
Return Value:
Parameters:
<ProductName>
Type: String, HFSS (default)
Example:
desired_ram = oAnsoftApp.GetDesiredRamMBLimit()
GetHPCLicenseType
Use:
Syntax:
Return Value:
Parameters:
<ProductName>
Ansoft Product such as HFSS.
<type>
pool or pack
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
3-2 Ansoft Application Object Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
GetMaximumRamMBLimit
Use:
Gets the Maximum RAM Limit (MB) value in HFSS. Not used in HFSS-IE.
Syntax:
GetMaximumRamMBLimit()
Return Value:
Parameters:
<ProductName>
Type: String, HFSS (default), HFSSIE
Example:
max_ram = oAnsoftApp.GetMaximumRamMBLimit()
GetMPISpawnCmd
Use:
For Linux authentication, gets the remote spawn command, either SSH
(default) or RSH.
Command:
Syntax:
GetMPISpawnCmd <product>
Return Value:
SSH or RSH
Parameters:
<ProductName>
Type: String, HFSS (default), HFSS-IE
Example:
GetMPIVendor
Use:
For HFSS or HFSS-IE analysis using distributed memory, get the MPI vendor.
Command:
Syntax:
GetMPIVendor <product>
Return Value:
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Parameters:
<ProductName>
Type: String, HFSS (default), HFSSIE
Example:
"GetMPIVendor HFSS
GetNumberOfProcessors
Use:
Syntax:
GetNumberOfProcessors()
Return Value:
Parameters:
<ProductName>
Type: String, HFSS (default)
Example:
numprocessors = oAnsoftApp.GetNumberOfProcessors()
GetUseHPCForMP
Use:
Gets the Tools>Options>HFSS Options Solver tab selection for Use HPC
licenses for multiprocessing and distributed frequency points, rather
than the MP License.
Syntax:
Return Value:
None
Parameters:
<productName>
Type: String, HFSS (default), or HFSSIE
<Bool>
0 is False, 1 is True.
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
3-4 Ansoft Application Object Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
SetDesiredRamMBLimit
Use:
Sets the Desired RAM Limit (MB) value in HFSS. Not used in HFSS-IE.
Syntax:
SetDesiredRamMBLimit(<DesiredRAMLimit> <ProductName>)
Return Value:
None
Parameters:
<DesiredRAMLimit>
Type: <int>
<ProductName>
Type: String, HFSS (default)
Example:
oAnsoftApp.SetDesiredRamMBLimit(2000)
SetHPCLicenseType
Use:
Syntax:
Parameters:
<type>
Type: String, pool (default) or pack
<ProductName>
Type: String, HFSS (default) or HFSSIE
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project6")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Ansoft Application Object Script Commands 3-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
oAnsoftApp.GetUseHPCForMP
oAnsoftApp.GetHPCLicenseType
oAnsoftApp.SetHPCLicenseType("Pool")
oAnsoftApp.SetUseHPCForMP(1)
SetMaximumRamMBLimit
Use:
Sets the Maximum RAM Limit (MB) value in HFSS. Not used in HFSS-IE.
Syntax:
SetMaximumRamMBLimit(<MaximumRAMLimit> <ProductName>)
Return Value:
None
Parameters:
<MaximumRAMLimit>
Type: <int>
<ProductName>
Type: String, HFSS (default)
Example:
oAnsoftApp.SetMaximumRamMBLimit(2000)
SetMPISpawnCmd
Use:
For Linux authentication, sets the remote spawn command as SSH (default)
or RSH.
Command:
Syntax:
SetMPISpawnCmd <cmd>,<product>
Return Value:
None
Parameters:
<cmd>
Type: String, SSH (default), RSH.
<ProductName>
Type: String, HFSS (default), HFSS-IE
Example:
SetMPIVendor
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<string>
Type: String, Intel (default), or Platform Computing.
<ProductName>
Type: String, HFSS (default), or HFSSIE
Example:
SetNumberOfProcessors
Use:
Syntax:
SetNumberOfProcessors(<NumProcessors> <ProductName>)
Return Value:
None
Parameters:
<NumProcessors>
Type: <int>
<ProductName>
Type: String, HFSS (default)
Example:
oAnsoftApp.SetNumberOfProcessors(2)
SetUseHPCForMP
Use:
Syntax:
Parameters:
<flag>
Type: String,
<ProductName>
Type: String, HFSS (default) or HFSSIE
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Ansoft Application Object Script Commands 3-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
NewProject
OpenMultipleProjects
OpenProject
PauseScript
Print
QuitApplication
RestoreWindow
RunProgram
RunScript
SetActiveProject
SetActiveProjectByPath
SetLibraryDirectory
SetProjectDirectory
SetTempDirectory
Sleep
CloseAllWindows
Use:
Command:
Syntax:
CloseAllWindows()
Return Value:
None
Parameters:
None
Example:
Desktop.CloseAllWindows()
CloseProject
Use:
Closes a specified project. Changes to the project will not be saved. Save
the project using the Project command Save or SaveAs before closing to
save changes.
Command:
File>Close
Syntax:
CloseProject <ProjectName>
Return Value:
None
Parameters:
<ProjectName>
Type: <string>
Example:
oDesktop.CloseProject "Project1"
CloseProjectNoForce
Use:
Command:
File>Close
Syntax:
CloseProjectNoForce <ProjectName>
Return Value:
None
Parameters:
<ProjectName>
Type: <string>
Example:
oDesktop.CloseProjectNoForce "Project1"
Count
Use:
Syntax:
Count
Return Value:
Parameters:
None
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
' lookup by name
EnableAutoSave
Use:
Syntax:
EnableAutoSave(bool)
Return Value:
None
Parameters:
None
Example:
oDesktop.EnableAutoSave(true)
GetActiveProject
Use:
Command:
None
Syntax:
GetActiveProject
Return Value:
Parameters:
None
Example:
Set oProject = oDesktop.GetActiveProject ()
GetAutoSaveEnabled
Use:
Command:
None
Syntax:
GetAutoSaveEnabled
Return Value:
Boolean
Parameters:
None
Example:
oDesktop.GetAutoSaveEnabled()
GetDesigns
Use:
Syntax:
GetDesigns()
Return Value:
Parameters:
None
Example:
set projects = oDesktop.GetProjects()
set designs = projects(0).GetDesigns()
GetDistributedAnalysisMachines
Use:
Gets a list of machines used for distributed analysis. You can iterate
through the list using standard VBScript methods.
Syntax:
GetDistributedAnalysisMachines()
Return Value:
Parameters:
None
Example:
For each machine in oDesktop.GetDistributedAnalysisMachines()
msgbox machine
next
GetName [Desktop]
Use:
Syntax:
GetName()
Return Value:
Parameters:
None
Example:
set projects = oDesktop.GetProjects()
project_name = projects(0).GetName()
GetLibraryDirectory
Use:
Syntax:
GetLibraryDirectory
Return Value:
Parameters:
None
Example:
libdir = oDesktop.GetLibraryDirectory
GetProjects
Use:
For querying projects. Once you have the projects you can iterate through
them using standard VBScript methods. See the example query.
Syntax:
GetProjects()
Return Value:
Parameters:
None
Example:
set projects = oDesktop.GetProjects()
GetProjectDirectory
Use:
Syntax:
GetProjectDirectory
Return Value:
Parameters:
None
Example:
projdir = oDesktop.GetProjectDirectory
GetProjectList
Use:
Command:
None
Syntax:
GetProjectList()
Return Value:
Parameters:
None
Example:
list_of_projects = oDesktop.GetProjectList()
GetTempDirectory
Use:
Syntax:
GetTempDirectory
Return Value:
Parameters:
None
Example:
tempdir = oDesktop.GetTempDirectory
GetVersion
Use:
Syntax:
GetVersion()
Return Value:
string
Desktop Object Script Commands 4-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Parameters:
None
Example:
msgbox(oDesktop.GetVersion()), displays "10.0"
NewProject
Use:
Creates a new project. The new project becomes the active project.
Command:
File>New
Syntax:
NewProject
Return Value:
Parameters:
None
Example:
Set oProject = oDesktop.NewProject
OpenMultipleProjects
Use:
Command:
File>Multiple Open
Syntax:
Return Value:
None
Parameters:
<Directory>
Type: <string>
<FileType>
Type: <string>
Example:
oDesktop.OpenMultipleProjects "D:/Projects", "*.hfss"
OpenProject
Use:
Command:
File>Open
Syntax:
OpenProject <FileName>
Return Value:
Parameters:
Example:
4-8 Desktop Object Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
oDesktop.OpenProject "D:/Projects/Project1.hfss"
PauseScript
Use:
Pauses the scripts execution and displays a message in a pop-up dialog box
to the user. The script execution will not resume until the user clicks
Tools>Resume Script.
Command:
Tools>Pause Script
Syntax:
PauseScript <Message>
Return Value:
None
Parameters:
<Message>
Type: <string>
Example:
oDesktop.PauseScript "Text to display in pop-up dialog box"
Print
Use:
Command:
File>Print
Syntax:
Return Value:
None
Parameters:
None
Example:
oDesktop.Print
QuitApplication
Use:
Command:
File>Exit
Syntax:
QuitApplication
Return Value:
None
Parameters:
None
Example:
oDesktop.QuitApplication
RestoreWindow
Use:
Command:
None
Desktop Object Script Commands 4-9
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Syntax:
RestoreWindow
Return Value:
None
Parameters:
None
Example:
oDesktop.RestoreWindow
RunProgram
Use:
Command:
None
Syntax:
Return Value:
None
Parameters:
<ProgName>
Type: <string>
Name of the program to run.
<ProgPath>
Type: <string>
Location of the program. Pass in an empty string to use the system path.
<WorkPath>
Type: <string>
Working directory in which program will start.
<ArgArray>
Type: Array of strings
Arguments to pass to the program. If 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.
Command:
Tools>Run Script
Syntax:
RunScript <ScriptPath>
Return Value:
None
Parameters:
<ScriptPath>
Type: <string>
Name or full path of the script to execute. If the full path to the script is not specified,
HFSS searches for the specified script in the following locations, in this order:
Example:
oDesktop.RunScript("C:/Project/test1.vbs")
SetActiveProject
Use:
Command:
None
Syntax:
SetActiveProject <ProjectName>
Return Value:
Parameters:
<ProjectName>
Type: <string>
Example:
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). This
command permits unambiguous specification of the active project.
Syntax:
SetActiveProjectByPath()
Desktop Object Script Commands 4-11
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Return Value:
Parameters:
<fullPathProjectName>
Example:
Set oProject = oDesktop.SetActiveProjectByPath("C:\working\tee.hfss")
SetLibraryDirectory
Use:
Sets the library directory path. The specified directory must already exist
and contain a syslib folder.
Syntax:
SetLibraryDirectory <DirectoryPath>
Return Value:
None
Parameters:
<DirectoryPath>
Type: <string>
Example:
oDesktop.SetLibraryDirectory "c:\libraries"
SetProjectDirectory
Use:
Sets the project directory path. The directory will be automatically created
if it does not already exist.
Syntax:
SetProjectDirectory <DirectoryPath>
Return Value:
None
Parameters:
<DirectoryPath>
Type: <string>
Example:
oDesktop.SetProjectDirectory "c:\projects"
SetTempDirectory
Use:
Sets the temp directory path. The directory will be automatically created if
it does not already exist.
Syntax:
SetTempDirectory <DirectoryPath>
Return Value:
None
Parameters:
<DirectoryPath>
Type: <string>
Example:
oDesktop.SetTempDirectory "c:\temp"
Sleep
Use:
Command:
none
Syntax:
Sleep <TimeInMilliseconds>
Return Value:
None
Parameters:
<TimeInMilliseconds>
Type: <int>
Example:
oDesktop.Sleep 1000
Project commands should be executed by the oProject object. One example of accessing this object is:
Set oProject = oDesktop.GetActiveProject()
Close
CopyDesign
CutDesign
DeleteDesign
GetActiveDesign
GetDesign
GetName [Project]
GetPath
GetTopDesignList
InsertDesign
Paste
Redo
Save
SaveAs
SetActiveDesign
SimulateAll
Undo
Close
Use:
Command:
None
Syntax:
Close
Return Value:
None
Parameters:
None
Example:
oProject.Close
CopyDesign
Use:
Copies a design.
Command:
Edit>Copy
Syntax:
CopyDesign <DesignName>
Return Value:
None
Example:
oProject.CopyDesign "HFSSDesign1"
CutDesign
Use:
Cuts a design from the active project. The design is stored in memory and
can be pasted in any HFSS project.
Command:
Edit>Cut
Syntax:
CutDesign <DesignName>
Return Value:
None
Example:
oProject.CutDesign "HFSSDesign1"
Warning
DeleteDesign
Use:
Command:
Edit>Delete
Syntax:
DeleteDesign <DesignName>
Return Value:
None
Example:
5-2 Project Object Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
oProject.DeleteDesign "HFSSDesign2"
GetActiveDesign
Use:
Command:
None
Syntax:
GetActiveDesign
Return Value:
Parameters:
None
Example:
Set oDesign = oProject.GetActiveDesign ()
GetDesign
Use:
Command:
None
Syntax:
GetDesign <DesignName>
Return Value:
Parameters:
<DesignName>
Type: <string>
Name of the design to return.
Example:
Set oDesign = oProject.GetDesign ("HFSSDesign1")
GetName [Project]
Use:
Command:
None
Syntax:
GetName
Return Value:
Parameters:
None
Example:
name = oProject.GetName ()
GetPath
Use:
Command:
None
Project Object Script Commands 5-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Syntax:
GetPath
Return Value:
The path to the project, which does not include the project name.
Parameters:
None
Example:
path = oProject.GetPath ()
GetTopDesignList
Use:
Command:
None
Syntax:
GetTopDesignList
Return Value:
Parameters:
None
Example:
name_list = oProject.GetTopDesignList ()
InsertDesign
Use:
Inserts a new design in the project. In HFSS scripts, the last argument will
always be empty.
Command:
Syntax:
Return Value:
Object
Parameters:
<DesignName>
Type: <string>
Name of the new design.
<SolutionType>
Type: <string>
Solution type of the new design. Can be "DrivenModal",
"DrivenTerminal", or "Eigenmode".
Example:
Set oDesign = oProject.InsertDesign("HFSS", "HFSSDesign3",_
"DrivenModal", "")
Paste [Design]
Use:
Command:
Edit>Paste
Syntax:
Paste
Return Value:
None
Parameters:
None
Example:
oProject.Paste
Command:
Edit>Redo
Syntax:
Redo
Return Value:
None
Parameters:
None
Example:
oProject.Redo
Save
Use:
Command:
File>Save
Syntax:
Save
Return Value:
None
Parameters:
None
Example:
oProject.Save
SaveAs
Use:
Command:
File>Save As
Syntax:
Return Value:
None
Parameters:
<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.hfss", true
SetActiveDesign
Use:
Command:
None
Syntax:
SetActiveDesign <DesignName>
Return Value:
Parameters:
<DesignName>
Type: <string>
Name of the design to set as the active design.
Example:
Set oDesign = oProject.SetActiveDesign ("HFSSDesign2")
SimulateAll
Use:
Command:
None
Syntax:
None
Return Value:
Parameters:
None
Example:
oProject.SimulateAll
Undo [Project]
Use:
Command:
Edit>Undo
Syntax:
Undo
Return Value:
None
Parameters:
None
Example:
5-6 Project Object Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
oProject.Undo
AddMaterial
Use:
Command:
Syntax:
AddMaterial Array("NAME:<MaterialName>",
<MatProperty>, <MatProperty>, ...)
Return Value:
None
Parameters:
"uTesla"
Example:
Set oDefinitionManager = oProject.GetDefinitionManager()
oDefinitionManager.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")
DoesMaterialExist
Use:
Command:
None
Syntax:
DoesMaterialExist(<MaterialName>)
Return Value:
Boolean
Parameters:
<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(oDefinitionManager.DoesMaterialExist("vacuum")) then
MsgBox("It Exists")
else
MsgBox("It Doesn't Exist...Creating")
oDefinitionManager.AddMaterial Array("NAME:Material5", _
"CoordinateSystemType:=", "Cartesian", _
Array("NAME:AttachedData"), _
Array("NAME:magnetic_coercivity",
"property_type:=", "VectorProperty", _
"Magnitude:=", "-1A_per_meter", _
Material Script Commands 6-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"DirComp1:=", "1", _
"DirComp2:=", _
"2", "DirComp3:=", "3"))
end if
EditMaterial
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<OriginalName>
Type: <string>
Name of the material before editing.
<NewName>
Type: <string>
New name for the material.
ExportMaterial
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<ExportData>
Array("NAME:<LibraryName>",
<MaterialName>, <MaterialName>, ...)
Example:
oProject.ExportMaterial Array("NAME:mo0907b",_
"Material1", "Material2", "Material3"),_
"UserLib"
RemoveMaterial
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<MaterialName>
<LibraryName>, <LibraryLocation>
Type: <string>
Name of the material to be removed.
<IsProjectMaterial>
Type: <bool>
If true, HFSS assumes the material is a project material. In this case, the last two
parameters will be 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", "UserLib"
oProject.RemoveMaterial "Material1", true, "Local", "Project"
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.
<PropName>
Name of a single property .
<PropServer> and <PropTab> Names
Project
Project Variables:
<PropServer>
"ProjectVariables"
Property Script Commands 7-1
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<PropTab>
"ProjectVariableTab"
AnsoftHfss Design
Local Variables:
<PropServer>
"LocalVariables"
<PropTab>
"LocalVariableTab"
AnsoftHfss Modules
<PropServer>
Format is: <ModuleName>:<ItemName>, where <ItemName> is the
boundary name, solution setup name, etc., depending on which module
is being edited.
Example: <PropServer> for the boundary "PerfE1" is
"BoundarySetup:PerfE1"
<PropTab>
Boundary module: "HfssTab"
Mesh Operations module: "MeshSetupTab"
Analysis module: "HfssTab"
Optimetrics module: "OptimetricsTab"
Solutions module: Does not support properties.
Field Overlays module: "FieldsPostProcessorTab"
Radiation module: "RadFieldSetupTab"
AnsoftHfss 3D Model Editor
Object in the module:
<PropServer>
Name of the object. For example: "Box1".
<PropTab>
7-2 Property Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"Geometry3DAttributeTab"
Operation on an object:
<PropServer>
Format is <ObjName>:<OperationName>:<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"))))
ChangeProperty
GetProperties
GetPropertyValue
GetArrayVariables
GetVariables
SetPropertyValue
SetVariableValue
Additional Property Scripting Example
Example Use of Record Script and Edit Properties
ChangeProperty
Use:
Command:
None
Syntax:
Return Value:
None
Parameters:
<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>,
"Description:=", <string>,
"NewRowPosition:=", <int>,
"ReadOnly:=", <bool>,
"Hidden:=", <bool>,
<PropTypeSpecificArgs>)
<PropType>
Type: string
Identifies the type of property when a new property is added. In HFSS, 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 HFSS,
the name can only be changed for separators and variables.
Description
Specify a description of the property. In HFSS, the description can only be changed
for separators and variables.
NewRowPosition
Used to reorder rows in the Property dialog box. In HFSS, this only applies to the
Property Script Commands 7-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Project>Project Variables panel and the Hfss>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 HFSS, this flag
can only be set for variables and separators.
Hidden
Used to hide a property so it can not be viewed outside of the Property dialog box.
In HFSS, 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>,
7-6 Property Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"Min:=", <value>,
"Max:=", <value>)
<Tuning flagsArray>
Array("NAME:Tuning",
"Included:=", <bool>,
"Step:=", <value>,
"Min:=", <value>,
"Max:=", <value>)
<SensitivityFlagsArray>
Array("NAME:Sensitivity",
"Included:=", <bool>,
"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.
Property Script Commands 7-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Max
High cut-off for the distribution.
Tol
Tolerance for uniform distributions. Format is "<int>%".
Example: "20%".
Example:
Example:
Example:
Example:
Changing the Company Name, Design Name, the background color, and the
Axis scaling in a Report.
GetProperties
Use:
Command:
None
Syntax:
Return Value:
Variant array of strings the names of the properties belonging to the prop
server.
Example:
Dim all_props
all_props = oDesign.GetProperties("HfssTab",_
"BoundarySetup:WavePort1")
GetPropertyValue
Use:
Gets the value of a single property. This can be executed by the oProject,
oDesign, or oEditor variables.
Use the script recording feature and edit a property, and then view the resulting script to
see the format for that property.
Command:
None
Syntax:
Return Value:
Example:
value_string = _
oEditor.GetPropertyValue("Geometry3DCmdTab",_
"Box1:CreateBox:1", "XSize")
GetArrayVariables
Use:
Syntax:
GetArrayVariables()
Return Value:
Example:
Dim var_array
project_var_array = oProject.GetArrayVariables()
local_var_array = oDesign.GetArrayVariables()
GetVariables
Use:
Syntax:
GetVariables()
Return Value:
Example:
Dim var_array
project_var_array = oProject.GetVariables()
local_var_array = oDesign.GetVariables()
GetVariableValue
Use:
Gets the value of a single variable. To get the value of Project variables,
execute this command using oProject. To get the value of local variables,
use oDesign.
Command:
None
Syntax:
GetVariableValue( <VarName> )
Return Value:
Parameters:
<VarName>
Type: string
Name of the variable to access.
Example:
project_var_value_string = oProject.GetVariableValue("var_name")
Example:
local_var_value_string = oDesign.GetVariableValue("var_name")
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.
Use the script recording feature and edit a property, and then view the resulting script
entry or use GetPropertyValue for the desired property to see the expected format.
Command:
None
Syntax:
Return Value:
None
Parameters:
<PropValue>
Type: String
Contains the value to set the property. The formatting is different depending on what
type of property is being edited.
Example:
oEditor.SetPropertyValue _
"Geometry3DCmdTab","Box1:CreateBox:1",_
"XSize", "3mm"
SetVariableValue
Use:
Sets the value of a variable. To set the value of a Project variable, execute
this command using oProject. To set the value of a local variable, use
oDesign.
Syntax:
Return Value:
None
Parameters:
<VarValue>
Type: <value>
New value for the variable.
Example:
oProject.SetVariableValue "$Var1", "3mm"
Example:
var_value = "2Ohm"
oDesign.SetVariableValue "Var2", var_value
oEditor.SetPropertyValue("Geometry3DCmdTab",_
"Box1:CreateBox:1", prop)
MsgBox("Now the value of '" + prop + "' is " + val)
End If
Next
AddDataset
Use:
Adds a dataset.
Command:
Project>Datasets>Add
Syntax:
AddDataset <DatasetDataArray>
Return Value:
None
Parameters:
<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)))
DeleteDataset
Use:
Command:
Project>Datasets>Remove
Syntax:
DeleteDataset <DatasetName>
Return Value:
None
EditDataset
Use:
Modifies a dataset. When a dataset is modified, its name as well as its data
can be changed.
Command:
Project>Datasets>Edit
Syntax:
Return Value:
None
Parameters:
<OriginalName>
Type: <string>
Name of the dataset before editing.
Example:
oProject.EditDataset "ds1" Array("NAME:ds2",_
Array("NAME:Coordinates",_
Array("NAME:Coordinate", "X:=", 1, "Y:=", 2),_
Array("NAME:Coordinate", "X:=", 3, "Y:=", 4)))
ImportDataset
Use:
Command:
Project>Dataset...>Import
Syntax:
ImportDataset <path>
Return Value:
None
Parameters:
<Path>
Type: <string>
Path of the dataset.
Example:
Set oProject = oDesktop.SetActiveProject("OptimTee")
oProject.ImportDataset "F:/work/BSR_1_dk.tab"
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ExportMeshStats
ExportProfile
GetEdit SourcesCount
GetModule
GetName
GetNominalVariation
GetSolutionType
GetSolveInsideThreshold
GetSourceContexts
GetVariationVariableValue
Redo
RenameDesignInstance
SARSetup
SetActiveEditor
SetDesignSettings
SetSolutionType
SetSolveInsideThreshold
SetSourceContexts
Solve
RunToolkit
Undo
ApplyMeshOps
Use:
If there are any mesh operations that were defined and not yet performed
in the current variation for the specified solution setups, they will be
applied to the current mesh. If necessary, an initial mesh will be computed
first. No further analysis will be performed.
Command:
Syntax:
ApplyMeshOps <SetupNameArray>
Return Value:
<SetupNameArray>
Type: <int>
-1: completed with error
0: completed successfully
Example:
status = oDesign.ApplyMeshOps Array("Setup1","Setup2")
Analyze
Use:
Command:
Right-click a solution setup in the project tree, and then click Analyze on
the shortcut menu.
Syntax:
Analyze(<SetupName>)
Parameters:
<setupName>
Return Value:
None
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 12.0.0
' 2:54 PM Dec 15, 2008
' ---------------------------------------------Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Tee")
Design Object Script Commands 9-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
AnalyzeDistributed
Use:
Command:
None
Syntax:
AnalyzeDistributed <SetupName>
Return Value:
<AnalysisStatus>
Type: <int>
-1: completed with error
0: completed successfully
Parameters:
<SetupName>
Example:
AssignDCThickness
Use:
Command:
HFSS>Assign DC Thickness
Syntax:
Return Value:
None
Parameters:
<ObjectName>
Type: <string>
Array of object names. Any objects not specified in the arguments are unchanged
after the command is processed.
<ThicknessValue>
Type: <real> or <string>, either Infinite or Effective.
Array of DC thickness values (including units) corresponding to each object name.
You can also specify an infinite thickness or have it calculated automatically.
<string>
Type: <string>
"EnableAuto" is equivalent to checking the checkbox in the second tab of the DC
thickness dialog. "DisableAuto" is equivalent to clearing that checkbox. Omitting the
string means leaves the checkbox unchanged.
Example:
9-4 Design Object Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ConstructVariationString
Use:
Lists and orders the variables and values associated with a design variation.
Command:
None
Syntax:
ConstructVariationString(<ArrayOfVariableNames>,
<ArrayOfVariableValuesIncludingUnits>)
Return Value:
Parameters:
<ArrayOfVariableNames>
Type: string
<ArrayOfVariableValuesIncludingUnits>
Type: string
Example:
varstring = oDesign.ConstructVariationString(Array("x_size", "y_size"), Array("2mm", "1mm"))
Design Object Script Commands 9-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
DeleteLinkedDataVariation
Use:
Deletes linked solution data, except field data, for the specified variations.
Syntax:
DeleteLinkedDataVariation
Array(<DesignVariationKey>, <DesignVariationKey>, )
Return Value:
None
Parameters:
<DesignVariationKey>
Type: <string>
Design variation string.
Example:
oDesign.DeleteLinkedDataVariation Array("gap_front=" &
Chr(39) & "0.2mm" & Chr(39) & " gap_up_down=" & Chr(39) &
"0.2mm" & Chr(39) & "")
ExportConvergence
Use:
Exports convergence data (max mag delta S, E, freq) to file for the given
variation.
Command:
None
Syntax:
Return Value:
None
Parameters:
<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:\convergence.conv"
overwriteIfExists <Boolean>
If "overwriteIfExists" is TRUE, then the playback of the script overwrites an existing
file. If FALSE, it does not. The default is "TRUE".
Type: <string>
Example: overwriteIfExists=TRUE
Example:
oDesign.ExportConvergence "Setup1", "x_size = 2mm",
"c:\convergence.conv"
ExportMeshStats
Use:
Command:
None.
Parameters:
<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:\convergence.conv"
overwriteIfExists <Boolean>
If "overwriteIfExists" is TRUE, then the playback of the script overwrites an existing
file. If FALSE, it does not. The default is "TRUE".
Type: <string>
Example: overwriteIfExists=TRUE
Example:
oDesign.ExportMeshStats "Setup1", "offset=" & Chr(39) &
"0.09in" & Chr(39) & "","C:\mydir\meshstats.ms" "tat"
ExportProfile
Use:
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Example: "Setup1"
<VariationString>
Design Object Script Commands 9-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
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>
If "overwriteIfExists" is TRUE, then the playback of the script overwrites an existing
file. If FALSE, it does not. The default is "TRUE".
Type: <string>
Example: overwriteIfExists=TRUE
Example:
oDesign.ExportProfile "Setup1", "", "c:\profile.prof"
GetEdit SourcesCount
Use:
Returns the number of sources that are listed in the Edit Sources panel.
Command:
None
Syntax:
GetEditSources
Return Value:
<int>
Parameters:
None
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 15.0.0
' 7:37:36 AM
GetModule
Use:
Command:
none
Syntax:
GetModule <ModuleName>
Return Value:
Module object.
Example:
Set oModule = oDesign.GetModule "BoundarySetup"
GetName
Use:
Command:
none
Syntax:
GetName
Return Value:
Example:
name_string = oDesign.GetName
GetNominalVariation
Use:
Command:
None
Syntax:
GetNominalVariation()
Return Value:
Parameters:
None
Example:
var = oDesign.GetNominalVariation()
GetSolutionType
Use:
Returns the solution type for the design. This command command does not
apply to HFSS-IE.
Command:
none
Syntax:
GetSolutionType
Return Value:
<SolutionType>
Type: <string>
Possible values are: "DrivenModal", "DrivenTerminal", "Eigenmode",
Transient or Transient Network.
Example:
oDesign.GetSolutionType
GetSolveInsideThreshold
Use:
Returns the solve inside threshold. This command command does not apply
to HFSS-IE.
Command:
none
Syntax:
GetSolveInsideThreshold
Return Value:
Example:
oDesign.GetSolveInsideThreshold
GetSourceContexts
Use:
Command:
None
Syntax:
GetSource Contexts
Return Value:
Parameters:
None
Example:
SetoModule = oDesign.GetModule(Solutions)
oModule.GetSourceContexts
GetVariationVariableValue
Use:
Command:
None
Syntax:
GetVariationVariableValue(<VariationString>,
<VariableName>)
Return Value:
Parameters:
<VariationString>
Type: string
<VariableName>
Type: string
Example:
Example: varval = _
oDesign.GetVariationVariableValue("x_size = 2mm y_size = 1mm",_
"y_size")
Redo [Design]
Use:
Command:
Edit>Redo
Syntax:
Redo
Return Value:
None
Example:
oDesign.Redo
RenameDesignInstance
Use:
Command:
Right click a design instance in the project tree, and then click Rename on
the shortcut menu.
Syntax:
Return Value:
None
Example:
oDesign.RenameDesignInstance "HFSSDesign1", "HFSSDesign2"
SARSetup
Use:
Command:
HFSS>Fields>SAR Setting
Syntax:
Return Value:
None
Parameters:
<TissueMass>
Type: <double>
Double between 1 and 10 in grams.
<MaterialDensity>
Type: <double>
Positive double in gram/cm3.
Example:
oDesign.SARSetup 1, 1
SetActiveEditor
Use:
Command:
None
Syntax:
SetActiveEditor(<EditorName>)
Return Value:
Editor object
Example:
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
SetDesignSettings
Use:
Command:
HFSS>Design Settings
Syntax:
SetDesignSettings <MaterialsOverrideArray>
Return Value:
None
Parameters:
<MaterialsOverrideArray>
Array("NAME:Design Settings Data",
"Allow Material Override:=", <Boolean>,
"Calculate Lossy Dielectrics:=", <Boolean>)
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
9-12 Design Object Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
SetSolutionType
Use:
Sets the solution type for the design. This command command does not
apply to HFSS-IE.
Command:
HFSS>Solution Type
Syntax:
SetSolutionType <SolutionType>
Return Value:
None
Parameters:
<SolutionType>
Type: <string>
Possible values are: "DrivenModal", "DrivenTerminal", Transient, Transient Network, or "Eigenmode"
Example:
oDesign.SetSolutionType "DrivenTerminal"
SetSolveInsideThreshold
Use:
Set the solve inside threshold to the supplied double. This command
command does not apply to HFSS-IE.
Command:
None
Syntax:
SetSolveInsideThreshold(<threshold>)
Return Value:
None
Parameters:
<threshold>
Type: <double>
Siemens/m
Example:
oDesign.SetSolveInsideThreshold(100000)
SetSourceContexts
Use:
For Near or Far Field projects for Driven Modal or Driven Terminal Network
Analysis Solutions, specify the port name and all modes/terminals of that
port to be enabled as Source Context.
Command:
Fields>Edit Sources
Syntax:
SetSourceContexts Array(<sourceID>,...)
Return Value:
None.
Parameters:
<sourceID>
Type: <string>
Example:
SetoModule = oDesign.GetModule(Solutions)
oModule.SetSourceContexts Array(Box1_T1, Box1_T2,
Box1_T3, Current1, IncPWave1)
Solve
Use:
Command:
HFSS>Analyze
Syntax:
Solve <SetupNameArray>
Return Value:
Type: <int>
-1: simulation error
0: normal completion
Parameters:
Example:
return_status = oDesign.Solve Array("Setup1", "Setup2")
RunToolkit
Use:
Run a Python toolkit script, applying it to the Active Project. The script
itself may have prerequisites, such as sweeps defined, or specific model
characteristics, such as port definitions.
Command:
HFSS>Toolkit><IronPythonScript>
Syntax:
Return Value:
Parameters:
<LibName>
Type: <string>
Name of the library in which the script is located.
<IronPythonScriptName>
Type: <string>
Name of the IronPython script.
Array(<array>)
Type: <Array>
Additional parameters or files required by the script.
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 16.0.0
' 10:12:18 AM
Undo [Design]
Use:
Command:
Edit>Undo
Syntax:
Undo
Return Value:
None
Example:
oDesign.Undo
10
Assign Array
Use:
Command:
HFSS>Model>Create Array
Syntax:
AssignArray <arrayParameters>
Return Value:
None
Parameters:
Aray(NAME:<string>",
"Type:=", "Regular",
"Name:=", "<string>",
"UseAirObjects:=", <boolean>,
"RowMasterBnd:=", "Master<n>",
"ColumnMasterBnd:=", "Master<n>",
"RowDimension:=", <value>,
"ColumnDimension:=", <value>,
"PostProcessRow:=", <value>,
"PostProcessCol:=", <value>,
"Active:=", "All" | [<arraycoords>] |"None" )
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 1:42:56 PM
"Type:=", "Regular",
"Name:=", "A",
"UseAirObjects:=", true,
"RowMasterBnd:=", "Master1",
"ColumnMasterBnd:=", "Master2",
"RowDimension:=", 2,
"ColumnDimension:=", 2,
"PostProcessRow:=", 1,
"PostProcessCol:=", 1,
"Active:=", "All")
DeleteArray
Use:
Command:
Delete
Syntax:
DeleteArray
Return Value:
None
Parameters:
None
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 10:22:10 AM
EditArray
Use:
Command:
Properties
Syntax:
EditArray <arrayParameters>
Return Value:
None
Parameters:
Aray(NAME:<string>",
"Type:=", "Regular",
"Name:=", "<string>",
"UseAirObjects:=", <boolean>,
"RowMasterBnd:=", "Master<n>",
"ColumnMasterBnd:=", "Master<n>",
"RowDimension:=", <value>,
"ColumnDimension:=", <value>,
"PostProcessRow:=", <value>,
"PostProcessCol:=", <value>,
"Active:=", "All" | [<arraycoords>] |"None" )
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 1:42:56 PM
"Type:=", "Regular",
"Name:=", "A",
"UseAirObjects:=", true,
"RowMasterBnd:=", "Master1",
"ColumnMasterBnd:=", "Master2",
"RowDimension:=", 2,
"ColumnDimension:=", 3,
"PostProcessRow:=", 1,
"PostProcessCol:=", 3,
"Active:=", "[0,0], [0,1], [0,2]")
11
NonModel
Wireframe
Example: "Flags:=", "NonModel#Wireframe"
Color
Format is a string containing an R,G,B triple formatted as "(R G B)".
Example: "Color:=",
"(255
255
255)"
Transparency
Specify a number between 0 and 1.
PartCoordinateSystem
Orientation of the primitive. The name of one of the defined coordinate systems
should be specified.
<SelectionsArray>
Array("NAME:Selections",
"Selections:=", <string>)
Selections
Comma-separated list of parts on which to perform the operation.
Example: "Selections:=", "Rect1, Rect2"
Draw Menu Commands
Edit Menu Commands
Modeler Menu Commands
Other oEditor Commands
CreateRectangle
CreateRegion
CreateRegularPolyhedron
CreateRegularPolygon
CreateSphere
CreateSpiral
CreateTorus
EditPolyline
SweepAlongPath
SweepAlongVector
SweepAroundAxis
CreateBondwire
Use:
Command:
Draw>Bondwire
Syntax:
Return Value:
Parameters:
<ParametersArray>
Array("NAME:BondwireParameters",
"WireType:=", <string>,
"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
3D Modeler Editor Script Commands 11-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
CreateBox
Use:
Command:
Draw>Box
Syntax:
Return Value:
Parameters:
<BoxParametersArray>
Array("NAME:BoxParameters",
"XPosition:=", <value>,
"YPosition:=", <value>,
"ZPosition:=", <value>,
"XSize:=",<value>,
"YSize:=",<value>,
"ZSize:=",<value>)
Example:
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateBox Array("NAME:BoxParameters", _
"CoordinateSystemID:=", -1, "XPosition:=",
CreateCircle
Use:
Command:
Draw>Circle
Syntax:
Return Value:
Parameters:
<CircleParametersArray>
Array("NAME:CircleParameters",
"XCenter:=", <value>,
"YCenter:=", <value>,
"ZCenter:=", <value>,
"Radius:=", <value>,
"WhichAxis:=", <string>
"NumSegments:=", "<integer>")
WhichAxis
Axis of 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:
Draw>Cone
Syntax:
Return Value:
Parameters:
<ConeParametersArray>
Array("NAME:ConeParameters",
"XCenter:=", <value>,
"YCenter:=", <value>,
"ZCenter:=", <value>,
"WhichAxis:=", <string>,
"Height:=", <value>,
3D Modeler Editor Script Commands 11-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"BottomRadius:=", <value>,
"TopRadius:=", <value>)
WhichAxis
Axis of the cone. Possible values are: "X", "Y", "Z"
Example: "WhichAxis:=", "Z"
CreateCutplane
Use:
Command:
Draw>Plane
Syntax:
CreateCutplane <CutplaneParametersArray>,
<AttributesArray>
Return Value:
Parameters:
<CutplaneParametersArray>
Array("NAME:PlaneParameters",
"PlaneBaseX:=", <value>,
"PlaneBaseY:=", <value>,
"PlaneBaseZ:=", <value>,
"PlaneNormalX:=", <value>,
"PlaneNormalY:=", <value>),
"PlaneNormalZ:=", <value>)
CreateCylinder
Use:
Command:
Draw>Cylinder
Syntax:
CreateCylinder <CylinderParametersArray>,
Return Value:
Parameters:
<CylinderParametersArray>
<AttributesArray>
Array("NAME:CylinderParameters",
"XCenter:=", <value>,
"YCenter:=", <value>,
"ZCenter:=", <value>,
"Radius:=", <value>,
11-6 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"Height:=", <value>,
"WhichAxis:=", <string>
"NumSides:=", "<integer>")
WhichAxis
Axis of the cylinder. Possible values are: "X", "Y", "Z"
Example: "WhichAxis:=", "Z"
CreateEllipse
Use:
Command:
Draw>Ellipse
Syntax:
Return Value:
Parameters:
<EllipseParametersArray>
Array("NAME:EllipseParameters",
"XCenter:=", <value>,
"YCenter:=", <value>,
"ZCenter:=", <value>,
"MajRadius:=", <value>,
"Ratio:=", <value>,
"WhichAxis:=", <string>
"NumSegments:=", "<integer>")
WhichAxis
Axis of normal vector to the ellipse. Possible values are: "X", "Y", "Z"
Example: "WhichAxis:=", "Z" means the ellipse will be drawn in the XY
plane.
CreateEquationCurve
Use:
Command:
Syntax:
Return Value:
None
Parameters:
Array("NAME:EquationBasedCurveParameters",
3D Modeler Editor Script Commands 11-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"XtFunction:=", "<value>",
"YtFunction:=", "<value>",
"ZtFunction:=", "<value>",
"tStart:=", "<value>",
"tEnd:=", "<value>",
"NumOfPointsOnCurve:=", "<value>",
"Version:=", <ID>),
Array("NAME:Attributes",
"Name:=", "<textn>",
"Flags:=", "",
"Color:=", "(<int> <int> <int>)",
"Transparency:=", <value>,
"PartCoordinateSystem:=", "<id>",
"UDMId:=", "",
"MaterialValue:=", "" & Chr(34)
& "vacuum"
& Chr(34) & "",
"SolveInside:=", <boolean>)
Example:
CreateEquationSurface
Use:
Command:
Syntax:
Return Value:
Parameters:
Array("NAME:EquationBasedSurfaceParameters",
"XuvFunction:=", "1",
"YuvFunction:=", "1",
"ZuvFunction:=", "1",
"uStart:=", "2",
"uEnd:=", "2",
"vStart:=", "2",
"vEnd:=", "2",
11-8 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"Version:=", 1),
Array("NAME:Attributes", "Name:=", "EquationSurface1",
"Flags:=", "",
"Color:=", "(132 132 193)",
"Transparency:=", 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=", "",
"MaterialValue:=", ""
& Chr(34)
& "vacuum"
& Chr(34)
& "", "SolveInside:=", true)
Example:
CreateHelix
Use:
Command:
Draw>Helix
Syntax:
Return Value:
Parameters:
<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>,
3D Modeler Editor Script Commands 11-9
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"Thread:=", <value>,
"NumThread:=", <value>,
"RightHand:=", <bool>)
CreatePoint
Use:
Command:
Draw>Point
Syntax:
Return Value:
Parameters:
<PointParametersArray>
Array("NAME:PointParameters",
"PointX:=", <value>,
"PointY:=", <value>,
"PointZ:=", <value>)
CreatePolyline
Use:
Command:
Draw>Polyline
Syntax:
CreatePolyline <PolylineParametersArray>,
<AttributesArray>
Return Value:
Parameters:
<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"
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 9:49:26 AM
oEditor.CreatePolyline Array("NAME:PolylineParameters",
"IsPolylineCovered:=", true,
"IsPolylineClosed:=", false,
Array("NAME:PolylinePoints",
Array("NAME:PLPoint", "X:=", "1.4mm",
"Y:=", "-2mm",
"Z:=", "0mm"),
Array("NAME:PLPoint", "X:=", "0mm", "Y:=", "-2mm", "Z:=", "0mm"),
Array("NAME:PLPoint", "X:=", "-0.8mm", "Y:=", "-1.6mm",
"Z:=", "0mm"),
Array("NAME:PLPoint", "X:=", "-1.4mm", "Y:=", "-0.6mm",
"Z:=", "0mm")),
Array("NAME:PolylineSegments", Array("NAME:PLSegment",
"SegmentType:=", "Line",
"StartIndex:=", 0, "NoOfPoints:=", 2),
Array("NAME:PLSegment", "SegmentType:=", "Line",
"StartIndex:=", 1, "NoOfPoints:=", 2),
Array("NAME:PLSegment", "SegmentType:=", "Line", "StartIndex:=", 2,
"NoOfPoints:=", 2)),
Array("NAME:PolylineXSection", "XSectionType:=", "None",
"XSectionOrient:=", "Auto", "XSectionWidth:=", "0mm",
"XSectionTopWidth:=", "0mm", "XSectionHeight:=", "0mm",
"XSectionNumSegments:=", "0", "XSectionBendType:=", "Corner")),
Array("NAME:Attributes", "Name:=", "Polyline2", "Flags:=", "",
"Color:=", "(132 132 193)",
"Transparency:=", 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=", "", "MaterialValue:=", ""
& Chr(34) & "vacuum" & Chr(34) & "", "SolveInside:=", true)
CreateRectangle
Use:
Command:
Draw>Rectangle
Syntax:
CreateRectangle <RectangleParametersArray>,
<AttributesArray>
Return Value:
Parameters:
<RectangleParametersArray>
Array("NAME:RectangleParameters",
"XStart:=", <value>,
"YStart:=", <value>,
"ZStart:=", <value>,
"Width:=", <value>,
"Height:=", <value>,
"WhichAxis:=", <string>)
WhichAxis
Axis of normal vector to the rectangle. Possible values are: "X", "Y", "Z"
Example: "WhichAxis:=", "Z" means the rectangle will be drawn in
the XY plane.
CreateRegion
Use:
Command:
Draw>Create Region
Syntax:
Return Value:
Parameters:
<RegionParameters>
Array("NAME:RegionParameters", _
"+XPaddingType:=", <Offset_Type>,
"+XPadding:=", "<X_value>", _
"-XPaddingType:=", <Offset_Type>,
"-XPadding:=", "<-X_value>", _
"+YPaddingType:=", <Offset_Type>,
"+YPadding:=", "<Y_value>",
"-YPaddingType:=", <Offset_Type>,
"-YPadding:=", "<-Y_value>", _
"+ZPaddingType:=", <Offset_Type>,
"+ZPadding:=", "<Z_value>", _
"-ZPaddingType:=", <Offset_Type>,
"-ZPadding:=", "<-Z_value>")
<Offset_Type>
Type: String
3D Modeler Editor Script Commands 11-13
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
CreateRegularPolyhedron
Use:
Command:
Draw>Regular Polyhedron
Syntax:
CreateRegularPolyhedron <PolyhedronParametersArray>,
Return Value:
Parameters:
<PolyhedronParametersArray>
<AttributesArray>
Array("NAME:PolyhedronParameters",
"XCenter:=", <value>,
"YCenter:=", <value>,
"ZCenter:=", <value>,
"XStart:=",
<value>,
"YStart:=",
<value>,
"ZStart:=",
<value>,
"Height:=",
<value>,
"NumSides:=", <value>,
"WhichAxis:=", <string>)
NumSides:
Specify a number greater than 2.
WhichAxis
Axis of the polyhedron. Possible values are: "X", "Y", "Z"
Example: "WhichAxis:=", "Z"
CreateRegularPolygon
Use:
Command:
Draw>RegularPolygon
Syntax:
CreateRegularPolygon <PolygonParametersArray>,
<AttributesArray>
Return Value:
Parameters:
<PolygonParametersArray>
Array("NAME:RegularPolygonParameters",
"XCenter:=",<value>,
3D Modeler Editor Script Commands 11-15
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"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 are: "X", "Y", "Z"
Example: "WhichAxis:=", "Z" means the polygon will be drawn in the XY
plane.
CreateSphere
Use:
Command:
Draw>Sphere
Syntax:
Return Value:
Parameters:
<SphereParametersArray>
Array("NAME:SphereParameters",
"XCenter:=", <value>,
"YCenter:=", <value>,
"ZCenter:=", <value>,
"Radius:=", <value>)
CreateSpiral
Use:
Command:
Draw>Spiral
Syntax:
Return Value:
Parameters:
<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:
Draw>Torus
Syntax:
Return Value:
Parameters:
<TorusParametersArray>
Array("NAME:TorusParameters",
"XCenter:=", <value>,
"YCenter:=", <value>,
"ZCenter:=", <value>,
"MajorRadius:=", <value>,
"MinorRadius:=", <value>,
"WhichAxis:=", <string>)
WhichAxis
Axis of the torus. Possible values are: "X", "Y", "Z"
Example: "WhichAxis:=", "Z"
3D Modeler Editor Script Commands 11-17
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
EditPolyline
Use:
Modifies a polyline primitive. Specify the name of the polyline to modify and
the new set of data for the polyline.
Command:
Syntax:
EditPolyline <SelectionsArray>,
<PolylineParametersArray>,
Return Value:
None
Parameters:
<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:
InsertPolylineSegment <InsertPolylineSegmentArray>
Return Value:
None
Parameters:
<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"
SweepAlongPath
Use:
Command:
Draw>Sweep>Along Path
Syntax:
SweepAlongPath <SelectionsArray>,
<PathSweepParametersArray>
3D Modeler Editor Script Commands 11-19
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Return Value:
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:
Draw>Sweep>Along Vector
Syntax:
SweepAlongVector <SelectionsArray>,
Return Value:
None
Parameters:
<VecSweepParametersArray>
<VecSweepParametersArray>
Array("NAME:VectorSweepParameters",
"DraftAngle:=", <value>,
"DraftType:=", <string>,
"SweepVectorX:=", <value>, _
"SweepVectorY:=", <value>,
"SweepVectorZ:=", <value)
DraftType
Possible values are "Extended", "Round", "Natural"
SweepAroundAxis
Use:
Command:
Draw>Sweep>Around Axis
Syntax:
SweepAroundAxis <SelectionsArray>,
<AxisSweepParametersArray>
Return Value:
None
Parameters:
<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
Use:
Command:
Edit>Copy
3D Modeler Editor Script Commands 11-21
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Syntax:
Copy <SelectionsArray>
Return Value:
None
DeletePolylinePoint
Use:
Command:
Syntax:
DeletePolylinePoint <DeletePointArray>
Return Value:
None
Parameters:
<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"
DuplicateAlongLine
Use:
Command:
Edit>Duplicate>Along Line
Syntax:
DuplicateAlongLine <SelectionsArray>,
<DupLineParametersArray> <DupBoundariesArray>
Return Value:
None
Parameters:
<DupLineParametersArray>
Array("NAME:DuplicateToAlongLineParameters",
"XComponent:=", <value>,
"YComponent:=", <value>,
"ZComponent:=", <value>,
"NumClones:=", <value>)
NumClones
Specify a number greater than 1.
<DupBoundariesArray>
Array("NAME:Options", "DuplicateBoundaries:=", <bool>)
Example:
oEditor.DuplicateAlongLine Array("NAME:Selections", _
"Selections:=", "Box1", _
"NewPartsModelFlag:=", "Model"), _
Array("NAME:DuplicateToAlongLineParameters", _
"CreateNewObjects:=", true, "XComponent:=", "0mm", _
"YComponent:=", "1.2mm", _
"ZComponent:=", "0mm", _
"NumClones:=", "2"), _
Array("NAME:Options", "DuplicateBoundaries:=", false)
DuplicateAroundAxis
Use:
Command:
Edit>Duplicate>Around Axis
Syntax:
DuplicateAroundAxis <SelectionsArray>,
Return Value:
None
Parameters:
<DupAxisParametersArray>
<DupAxisParametersArray> <DupBoundariesArray>
Array("NAME:DuplicateAroundAxisParameters",
"WhichAxis:=", <string>,
"AngleStr:=", <value>,
"NumClones:=",<value>)
WhichAxis
Axis to duplicate around. Possible values are: "X", "Y", "Z"
Example: "WhichAxis:=", "Z"
NumClones:
Specify a number greater than 1.
<DupBoundariesArray>
Array("NAME:Options", "DuplicateBoundaries:=", <bool>)
Example:
oEditor.DuplicateAroundAxis Array("NAME:Selections", _
"Selections:=", "Box1", _
"NewPartsModelFlag:=", "Model"), _
Array("NAME:DuplicateAroundAxisParameters", _
"CreateNewObjects:=", false, _
"WhichAxis:=", "Z", _
"AngleStr:=", "90deg", _
"NumClones:=", "2"), _
Array("NAME:Options", "DuplicateBoundaries:=", false)
DuplicateMirror
Use:
Command:
Edit>Duplicate>Mirror
Syntax:
DuplicateMirror <SelectionsArray>,
<DupMirrorParametersArray>
Return Value:
None
Parameters:
<DupMirrorParametersArray>
Array("NAME:DuplicateToMirrorParameters",
"DuplicateMirrorBaseX:=", <value>,
"DuplicateMirrorBaseY:=", <value>,
"DuplicateMirrorBaseZ:=", <value>,
"DuplicateMirrorNormalX:=", <value>,
"DuplicateMirrorNormalY:=", <value>,
"DuplicateMirrorNormalZ:=", <value>)
<DupBoundariesArray>
Array("NAME:Options", "DuplicateBoundaries:=", <bool>)
Example:
oEditor.DuplicateMirror Array("NAME:Selections", _
"Selections:=", "Box1", _
"NewPartsModelFlag:=", "Model"), _
Array("NAME:DuplicateToMirrorParameters", _
"DuplicateMirrorBaseX:=", "0mm", _
11-24 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"DuplicateMirrorBaseY:=", "0mm", _
"DuplicateMirrorBaseZ:=", "0mm", _
"DuplicateMirrorNormalX:=", "0mm", _
"DuplicateMirrorNormalY:=", "-1mm", _
"DuplicateMirrorNormalZ:=", "0mm"), _
Array("NAME:Options", "DuplicateBoundaries:=", false)
Mirror
Use:
Command:
Edit>Arrange>Mirror
Syntax:
Return Value:
None
Parameters:
<MirrorParametersArray>
Array("NAME:MirrorParameters",
"MirrorBaseX:=", <value>,
"MirrorBaseY:=", <value>,
"MirrorBaseZ:=", <value>,
"MirrorNormalX:=", <value>,
"MirrorNormalY:=", <value>,
"MirrorNormalZ:=", <value>)
Example:
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.Mirror Array("NAME:Selections", "Selections:=", "Box1", _
"NewPartsModelFlag:=", "Model"), _
Array("NAME:MirrorParameters", _
"MirrorBaseX:=", "-0.8mm", _
"MirrorBaseY:=", "-1mm", _
"MirrorBaseZ:=", "0mm", _
"MirrorNormalX:=", "0.948683298050514mm", _
"MirrorNormalY:=", "-0.316227766016838mm", _
"MirrorNormalZ:=", "0mm")
Move
Use:
Command:
Edit>Arrange>Move
3D Modeler Editor Script Commands 11-25
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Syntax:
Return Value:
None
Parameters:
<MoveParametersArray>
Array("NAME:TranslateParameters",
"TranslateVectorX:=", <value>,
"TranslateVectorY:=", <value>,
"TranslateVectorZ:=", <value>)
OffsetFaces
Use:
Command:
Edit>Arrange>Offset
Syntax:
Return Value:
None
Parameters:
<OffsetParametersArray>
Array("NAME:OffsetParameters",
"OffsetDistance:=", <value>)
Pastes copied objects and returns an array of pasted objects from the 3D
model editor.
Command:
Edit>Paste
Syntax:
Paste
Return Value:
One dimensional array of pasted object names. The order is not guarenteed
to be alphabetical.
Parameters:
None.
Example:
arrayEntities = oEditor.Paste
Rotate
Use:
Command:
Edit>Arrange>Rotate
Syntax:
Return Value:
None
Parameters:
<RotateParametersArray>
Array("NAME:RotateParameters",
"RotateAxis:=", <string>
"RotateAngle:=", <value>)
RotateAxis
Possible values are: "X", "Y", "Z"
Scale
Use:
Command:
Edit>Scale
Syntax:
Return Value:
None
Parameters:
<ScaleParametersArray>
Array("NAME:ScaleParameters",
"ScaleX:=", <value>,
"ScaleY:=", <value>,
"ScaleZ:=", <value>)
EditObjectCS
EditRelativeCS
Export
Fillet
Generate History
Import
ImportDXF
ImportGDSII
Intersect
MoveCStoEnd
MoveFaces
ProjectSheet
PurgeHistory
Section
SeparateBody
SetModelUnits
SetWCS
ShowWindow
Split
Subtract
SweepFacesAlongNormal
ThickenSheet
UncoverFaces
Unite
AssignMaterial
Use:
Command:
Modeler>Assign Material
Syntax:
Return Value:
None
Example:
oEditor.AssignMaterial _
Array("NAME:Selections", "Selections:=", "Polygon1"),
Array("NAME:Attributes", _
"MaterialName:=", "tungsten",_
11-28 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"SolveInside:=", false)
Chamfer
Use:
Creates a chamfer.
Command:
Modeler>Chamfer
Syntax:
Return Value:
None
Parameters:
<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:
Command:
Modeler>Surface>Connect
Syntax:
Connect <SelectionsArray>
Return Value:
None
CoverLines
Use:
Command:
Modeler>Surface>Cover Lines
Syntax:
CoverLines <SelectionsArray>
Return Value:
None
3D Modeler Editor Script Commands 11-29
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
CoverSurfaces
Use:
Command:
Modeler>Surface>Cover Faces
Syntax:
CoverSurfaces <SelectionsArray>
Return Value:
None
CreateEntityList
Use:
Creates a list of entities. The list can contain objects or faces, but not
both. Only the Name attribute from <AttributesArray> is supported.
Command:
Modeler>List>Create>Object List
Modeler>List>Create>Face List
Syntax:
CreateEntityList <EntityListParametersArray>,
<AttributesArray>
Return Value:
None
Parameters:
<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. To get the IDs, use
GetObjectIDByName
CreateFaceCS
Use:
Command:
Modeler>Coordinate System>Create>Face CS
Syntax:
Return Value:
None
Parameters:
<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).
If IsAttachedToEntity is true, provide the UParam and VParam
parameters. Otherwise, provide the XPosition, YPosition, and
ZPosition parameters.
EntityID
3D Modeler Editor Script Commands 11-31
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
CreateObjectCS
Use:
Command:
Syntax:
CreateObjectCS <ParameterArrays>
Return Value:
None
Parameters:
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>),
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("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("coax_bend")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
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:
Syntax:
CreateObjectFromEdges <SelectionsArray>,
Return Value:
None
Parameters:
<SelectionsArray>
<ObjFromEdgeParametersArray>
Array("NAME:Selections",
11-34 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"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:
CreateObjectFromFaces <SelectionsArray>,
<ObjFromFaceParametersArray>
Return Value:
None
Parameters:
<ObjFromFaceParametersArray>
Array("NAME:Parameters",
<FacesOfOneObjToDetach>, <FacesOfOneObjToDetach>,
...)
<FacesOfOneObjToDetach>
Array("Name:BodyFromFaceToParameters",
"FacesToDetach:=", <array>)
FacesToDetach
Array of integers the IDs of the faces to use to create objects.
3D Modeler Editor Script Commands 11-35
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Example:
oEditor.CreateObjectFromFaces _
Array("NAME:Selections", "Selections:=", "Box1"),_
Array("NAME:Parameters", _
Array("NAME:BodyFromFaceToParameters", _
"FacesToDetach:=", Array(185)))
CreateRelativeCS
Use:
Command:
Syntax:
CreateRelativeCS <RelativeCSParametersArray>,
Return Value:
None
Parameters:
<RelativeCSParametersArray>
<AttributesArray>
Array("NAME:RelativeCSParameters",
"OriginX:=", <value>,
"OriginY:=", <value>,
"OriginZ:=", <value>,
"XAxisXvec:=", <value>,
"XAxisYvec:=", <value>,
"XAxisZvec:=", <value>,
"YAxisXvec:=", <value>,
"YAxisYvec:=", <value>,
"YAxisZvec:=", <value>)
DeleteLastOperation
Use:
Command:
Syntax:
DeleteLastOperation <SelectionsArray>
Return Value:
None
DetachFaces
Use:
Command:
Modeler>Surface>Detach Faces
Syntax:
DetachFaces <SelectionsArray>,
<DetachFacesParametersArray>
Return Value:
None
Parameters:
<DetachFacesParametersArray>
Array("NAME:Parameters",
<FacesOfOneObjToDetach>,
<FacesOfOneObjToDetach>, ...)
<FacesOfOneObjToDetach>
Array("Name:DetachFacesToParameters",
"FacesToDetach:=", <array>)
FacesToDetach
An array of integers the face 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:
Modeler>List>Reassign
Syntax:
EditEntityList <SelectionsArray>,
<EntityListParametersArray>
Return Value:
None
EditFaceCS
Use:
Command:
Modeler->Coordinate System->Edit
Syntax:
Return Value:
None
EditObjectCS
Use:
Command:
Modeler>Coordinate System>Edit
Syntax:
EditObjectCS <Array>
Return Value:
None
Parameters:
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>),
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("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project53")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
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,
3D Modeler Editor Script Commands 11-39
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
EditRelativeCS
Use:
Command:
Modeler>Coordinate System>Edit
Syntax:
EditRelativeCS <RelativeCSParametersArray>,
<AttributesArray>
Return Value:
None
Parameters:
<ParametersArray>
Array("NAME:RelativeCSParameters",
"OriginX:=", <value>,
"OriginY:=", <value>,
"OriginZ:=", <value>,
"XAxisXvec:=", <value>,
"XAxisYvec:=", <value>,
"XAxisZvec:=", <value>,
"YAxisXvec:=", <value>,
"YAxisYvec:=", <value>,
"YAxisZvec:=", <value>)
Export
Use:
Command:
Modeler>Export
Syntax:
Export <ExportParametersArray>
Return Value:
None
Parameters:
<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 HFSS software.
Minor Version
Can be 1 or any ACIS minor version supported by HFSS software.
ExportModelImageToFile
Use:
Command:
Modeler>Export...
Syntax:
ExportModelImageToFile "<path>/
<imageName>.<formatsuffix>" 0,0, Array(<SaveImageParams>)
Return Value:
None
Parameters:
<path>
<imagename>
<formatsuffix>, You can export the following graphics formats:
Extension
Contents
.bmp
Bitmap files.
.gif
.jpeg
.tiff
.wrl
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Array("NAME:SaveImageParams",
"ShowAxis:=","<string>",
"ShowGrid:=", "<string>",
"ShowRuler:=", "<string>")
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 15.0.0
' 2:28:32 PM
"C:/MyPath/Downloads/dra_example.jpg", 0, 0,
Array("NAME:SaveImageParams", "ShowAxis:=", _
"Default", "ShowGrid:=", "Default", "ShowRuler:=", "Default")
Fillet
Use:
Creates a fillet.
Command:
Modeler>Fillet
Syntax:
Fillet(<ObjectName> <FilletParameters>)
Return Value:
None
Parameters:
<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), "Radius:=", _
"1mm", "Setback:=", "0mm"))
GenerateHistory
Use:
Command:
Modeler>Generate History
Syntax:
GenerateHistory <SelectionsArray>
Return Value:
None
HealObject
Use:
Command:
Modeler>Model Healing>Heal
Syntax:
HealObject <parameters>
Return Value:
None
Parameters:
Array("NAME:Selections",
"Selections:=", "<objectID>",
"NewPartsModelFlag:=", "Model"),
Array("NAME:ObjectHealingParameters",
"Version:=", 1,
"AutoHeal:=", <boolean>,
"TolerantStitch:=", <boolean>,
"SimplifyGeom:=", <boolean>,
"TightenGaps:=", <boolean>,
"StopAfterFirstStitchError:=", <boolean>,
"MaxStitchTol:=", <smallvalue>,
"ExplodeAndStitch:=", <boolean>,
3D Modeler Editor Script Commands 11-43
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"GeomSimplificationTol:=", <value>,
"MaximumGeneratedRadiusForSimplification:=", <value>,
"SimplifyType:=", 2,
"TightenGapsWidth:=", <value>,
"RemoveSliverFaces:=", <boolean>,
"RemoveSmallEdges:=", <boolean>,
"RemoveSmallFaces:=", <boolean>,
"SliverFaceTol:=", <value>,
"SmallEdgeTol:=", <value>,
"SmallFaceAreaTol:=", <value>,
"BoundingBoxScaleFactor:=", <value>,
"RemoveHoles:=", <boolean>,
"RemoveChamfers:=", <boolean>,
"RemoveBlends:=", <boolean>,
"HoleRadiusTol:=", <value>,
"ChamferWidthTol:=", <value>,
"BlendRadiusTol:=", <value>,
"AllowableSurfaceAreaChange:=", <value>,
"AllowableVolumeChange:=", <value>)
Example:
oEditor.HealObject Array("NAME:Selections",
"Selections:=", "Box1",
"NewPartsModelFlag:=", "Model"),
Array("NAME:ObjectHealingParameters",
"Version:=", 1,
"AutoHeal:=", false,
"TolerantStitch:=", true,
"SimplifyGeom:=", true,
"TightenGaps:=", true,
"StopAfterFirstStitchError:=", false,
"MaxStitchTol:=", 0.001,
"ExplodeAndStitch:=", true,
"GeomSimplificationTol:=", -1,
"MaximumGeneratedRadiusForSimplification:=", -1,
11-44 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"SimplifyType:=", 2,
"TightenGapsWidth:=", 1E-006,
"RemoveSliverFaces:=", true,
"RemoveSmallEdges:=", true,
"RemoveSmallFaces:=", true,
"SliverFaceTol:=", 0,
"SmallEdgeTol:=", 0.1,
"SmallFaceAreaTol:=", 0.1,
"BoundingBoxScaleFactor:=", 1250,
"RemoveHoles:=", true,
"RemoveChamfers:=", true,
"RemoveBlends:=", true,
"HoleRadiusTol:=", 0.1,
"ChamferWidthTol:=", 0.1,
"BlendRadiusTol:=", 0.1,
"AllowableSurfaceAreaChange:=", 5,
"AllowableVolumeChange:=", 5)
Import
Use:
Command:
Modeler>Import
Syntax:
Import <ImportParametersArray>
Return Value:
None
Parameters:
<ImportParametersArray>
Array("NAME:NativeBodyParameters",
"CoordinateSystemID:=", <ID>,
"HealOption:=", <integer>,
"CheckModel:=", <boolean>,
"Options:=", "",
"FileType:=", "UnRecognized",
"MaxStitchTol:=", <value>,
"SourceFile:=", "string")
ImportDXF
Use:
Imports an AutoCAD model file and a tech file. The tech file is an ASCII file
that lists the units, the layer name followed by tab delimited color,
elevations and thickness.
Command:
Modeler>Import
Syntax:
ImportDXF <ImportParametersArray>
Return Value:
None
Parameters:
<ImportParametersArray>
Array("NAME:options",
"FileName:=", <path>,
"Scale:=", <real>,
"UnionOverlapping:=", <boolean>,
"AutoDetectClosed:=", <boolean>,
"SelfStitch:=", <boolean>,
"DefeatureGeometry:=", <boolean>,
"DefeatureDistance:=", <real>,
"RoundCoordinates:=", <boolean>,
"RoundNumDigits:=", <integer>,
"WritePolyWithWidthAsFilledPoly:=", <boolean>,
"ImportMethod:=", <integer>,
"2DSheetBodies:=", <boolean>,
Array("NAME:LayerInfo",
Array("NAME:<layerName>",
"source:=", "<integer>",
"display_source:=", "<integer>",
"import:=", <boolean>,
"dest:=", "<integer>",
"dest_selected:=", <boolean>,
"layer_type:=", "<string>",
"paint:=", <boolean>),
Array("NAME:TechFileLayers", "layer:=",
Array("name:=", "ground",
"color:=", "purple",
"elev:=", 0,
"thick:=", 0.0001),
)))
oEditor.Import Array("NAME:NativeBodyParameters",
"CoordinateSystemID:=", -1,
"HealOption:=", <integer>,
"CheckModel:=", <boolean>,
"Options:=", "",
"FileType:=", "UnRecognized",
"MaxStitchTol:=", <real>,
"SourceFile:=", "<path>" & ".sm3")
Example:
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.ImportDXF Array("NAME:options", "FileName:=",
"C:/mymodel.dxf", ...
Array("NAME:TechFileLayers", ...
"layer:=", Array("name:=", "BOTTOMLAYER",
"color:=", "purple",
"elev:=", 0,
"thick:=", 200),
)))
oEditor.Import Array("NAME:NativeBodyParameters",
"CoordinateSystemID:=", -1,
"HealOption:=", 0,
"CheckModel:=", true,
"Options:=", "",
"FileType:=", "UnRecognized",
"MaxStitchTol:=", 0.001,
"SourceFile:=", "C:design." & ".sm3")
ImportGDSII
Use:
Command:
Modeler>Import
Syntax:
ImportGDSII <ImportParametersArray>
Return Value:
None
Parameters:
3D Modeler Editor Script Commands 11-47
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"FileName:=", "<string>",
"NodeConversionType:=", "<string>",
"MaxLayerNumber:=", <integer>,
"ApproxPolyToCircle:=", <boolean>,
"FlattenHierarchy:=", <boolean>,
"ImportMethod:=", <integer>,
Array("NAME:LayerMap",
Array("NAME:LayerMapInfo",
"LayerNum:=", <integer>,
"Import:=", <booleaninteger>,
"IsVIA:=", <booleaninteger>,
"IsLayerNew:=", <booleanInteger>,
"DestLayer:=", "<string>",
"layer_type:=", "<string>",
"IsPresentInLayout:=", <boolean>),
"OrderMap:=", Array("entry:=",
Array("order:=", <integer>,
"layer:=", "<string>"),
"entry:=", Array("order:=",
<integer>, "layer:=", "Signal25"),
"entry:=", Array("order:=", <integer+1>,
"layer:=", "Signal30"),
...),
Array("NAME:Structs",
Array("NAME:GDSIIStruct", "ImportStruct:=", <boolean>,
"CreateNewCell:=", <boolean>,
"StructName:=", "string>",
Array("NAME:Elements")),
Array("NAME:GDSIIStruct", "ImportStruct:=",<boolean>,
"CreateNewCell:=", <boolean>,
"StructName:=", "<string>",
Array("NAME:Elements"))))
oEditor.Import Array("NAME:NativeBodyParameters",
11-48 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"CoordinateSystemID:=", <ID>,
"HealOption:=", <integer>,
"CheckModel:=", <boolean>,
"Options:=", "",
"FileType:=", "UnRecognized",
"MaxStitchTol:=", <value>,
"SourceFile:=", "string")
Example:
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.ImportGDSII Array("NAME:options", ...
Intersect
Use:
Command:
Modeler>Boolean>Instersect
Syntax:
Return Value:
None
Parameters:
<IntersectParametersArray>
Array("NAME:IntersectParameters",
"KeepOriginals:=",
<bool>)
MoveCStoEnd
Use:
Command:
Syntax:
MoveCSToEnd Array("NAME:Selections",
"Selections:=", "<ObjectCSName>")
Return Value:
None
Parameters:
<ObjectCSName>
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
3D Modeler Editor Script Commands 11-49
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("coax_bend")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.MoveCSToEnd Array("NAME:Selections",
"Selections:=", "ObjectCS1")
MoveFaces
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<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
11-50 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ProjectSheet
Use:
Project planar sheet object, typically for modeling thin conformal deposits.
Typically followed by Thicken Sheet.
Command:
Modeler>Surface>Project Sheet
Syntax:
ProjectSheet
(Array("NAME:Selections",Selections:="...,...,""),
Array("NAME:ProjectSheetParameters")
Return Value:
None
Parameters:
None
Example:
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.ProjectSheet Array("NAME:Selections", "Selections:=",
"Box1,Box2,Polyline1"),
array("NAME:ProjectSheetParameters")
PurgeHistory
Use:
Purges the construction history of the selected object. For complex objects
this simplifies the object and can improve modeler speed.
Command:
Modeler>Purge History
Syntax:
PurgeHistory <PurgeHistoryArray>
Return Value:
None
Parameters:
<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:
oEditor.PurgeHistory Array("NAME:Selections", _
"Selections:=", "Polygon1", "NewPartsModelFlag:=", "Model")
Section
Use:
Command:
Modeler>Surface>Section
Syntax:
Return Value:
None
Parameters:
<SectionParametersArray>
Array("NAME:SectionToParameters",
"SectionPlane:=", <string>)
Section Plane
Possible values are "XY", "YZ", "ZX"
SeparateBody
Use:
Command:
Modeler>Boolean>Separate Bodies
Syntax:
SeparateBody <SelectionsArray>
Return Value:
None
Parameters:
<SelectionsArray>
Selections:=",<objectNames>"
"NewPartsModelFlag:=", "Model"
Example:
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.SeparateBody Array("NAME:Selections",
"Selections:=", "Rectangle1,Circle1",
"NewPartsModelFlag:=", "Model")
SetModelUnits
Use:
Command:
Modeler>Units
Syntax:
SetModelUnits <ModelUnitsParametersArray>
Return Value:
None
Parameters:
<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:
SetWCS <WCSParametersArray>
Return Value:
None
Parameters:
<WCSParametersArray>
Array("NAME:SetWCS Parameter",
"Working Coordinate System:=", <string>)
Working Coordinate System
Name of the coordinate system to set as the WCS.
3D Modeler Editor Script Commands 11-53
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ShowWindow
Use:
Syntax:
ShowWindow
Return Value:
None
Parameters:
None
Example:
Set oDesign = oProject.GetActiveDesign
Set oModeler = oDesign.SetActiveEditor("3D Modeler")
oEditor.ShowWindow
Split
Use:
Command:
Modeler->Boolean->Split
Syntax:
Return Value:
None
Parameters:
<SplitParametersArray>
Array("NAME:SplitToParameters",
"SplitPlane:=", <string>,
"WhichSide:=", <string>)
SplitPlane
Possible values are "XY", "YZ", "ZX"
WhichSide
Side to keep. Possible values are "Both", "PositiveOnly", "NegativeOnly"
Subtract
Use:
Command:
Modeler->Boolean->Subtract
Syntax:
Subtract <SubtractSelectionsArray>,
Return Value:
None
Parameters:
<SubtractSelectionsArray>
<SubtractParametersArray>
Array("NAME:Selections",
11-54 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<bool>)
Example:
oEditor.Subtract _
Array("NAME:Selections", _
"Blank Parts:=", "Polygon1",_
"Tool Parts:=",
"Box1"),_
Array("NAME:SubtractParameters", _
"KeepOriginals:=", false)
SweepFacesAlongNormal
Use:
Command:
Syntax:
Return Value:
None
Parameters:
Array("NAME:Selections",
"Selections:=", "<faceID>",
"NewPartsModelFlag:=", "Model"),
Array("NAME:Parameters",
Array("NAME:SweepFaceAlongNormalToParameters",
"FacesToDetach:=", Array( <faceID>),
"LengthOfSweep:=", "<value><units>")
)
3D Modeler Editor Script Commands 11-55
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Example:
oEditor.SweepFacesAlongNormal
Array("NAME:Selections",
"Selections:=", "Rectangle1",
"NewPartsModelFlag:=", "Model"),
Array("NAME:Parameters",
Array("NAME:SweepFaceAlongNormalToParameters",
"FacesToDetach:=",
Array( 57),
"LengthOfSweep:=", "0.5mm")
)
ThickenSheet
Use:
Command:
Modeler>Surface>Thicken Sheet
Syntax:
Return Value:
None
Parameters:
Array("NAME:Selections",
"Selections:=", "<objectID>",
"NewPartsModelFlag:=", "Model"),
Array("NAME:SheetThickenParameters",
"Thickness:=", "<value><units>",
"BothSides:=", <boolean>)
Example:
oEditor.ThickenSheet Array("NAME:Selections",
"Selections:=", "Rectangle1",
"NewPartsModelFlag:=", "Model"),
Array("NAME:SheetThickenParameters",
"Thickness:=", "1.01mm",
"BothSides:=", false)
UncoverFaces
Use:
Command:
Modeler>Surface>Uncover Faces
Syntax:
Return Value:
None
Parameters:
<UncoverParametersArray>
Array("NAME:Parameters",
<FacesOfOneObjToUncover>,
<FacesOfOneObjToUncover>,...)
<FacesOfOneObjToUncover>
Array("Name:UncoverFacesParameters",
"FacesToUncover:=", <array>)
FacesToUncover
An array of integers the face 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:
Modeler>Boolean>Unite
Syntax:
Return Value:
None
Parameters:
<UniteParametersArray>
Array("NAME:UniteParameters",
"KeepOriginals:=", <bool>)
GetEdgeByPosition
GetEdgeIDsFromObject
GetEdgeIDsFromFace
GetFaceArea
GetFaceByPosition
GetFaceCenter
GetFaceIDs
GetModelBoundingBox
GetObjectsInGroup
GetObjectIDByName
GetObjectName
GetObjectNameByFaceID
GetMatchedObjectName
GetModelUnits
GetNumObjects
GetSelections
GetVertexIDsFromEdge
GetVertexIDsFromFace
GetVertexIDsFromObject
GetUserPosition
PageSetup
RenamePart
ChangeProperty
Use:
Command:
Syntax:
ChangeProperty <array>
Return Value:
None
Parameters:
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 9:49:26 AM
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project58")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geometry3DCmdTab",
Array("NAME:PropServers", "Polyline2:CreatePolyline:1"),
Array("NAME:ChangedProps",
Array("NAME:Type", "Value:=", "Isosceles Trapezoid"),
Array("NAME:Width/Diameter", "Value:=", "0.1mm"),
Array("NAME:Top Width", "Value:=", "0.05mm"),
Array("NAME:Height", "Value:=", "0.02mm"))))
oEditor.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geometry3DCmdTab", Array("NAME:PropServers", "Polyline2:CreatePolyline:1"),
Array("NAME:ChangedProps",
Array("NAME:Bend Type", "Value:=", "Corner"))))
Delete
Use:
Command:
None
Syntax:
Delete <SelectionsArray>
Return Value:
None
GetBodyNamesByPosition
Use:
Command:
None.
Syntax:
GetBodyNamesByPosition(<positionParameters>).
Return Value:
Parameters:
<PositionParameters>
Array("NAME:Parameters", _
3D Modeler Editor Script Commands 11-59
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"Xposition:=", <value>,
"YPosition:=", <value>,
"ZPosition:=", <value>)
Example:
bodyNames = oEditor.GetBodyNamesByPosition(Array("NAME:Parameters", _
"XPosition:=", "a", _
"YPosition:=", "0mm", _
"ZPosition:=", "0mm"))
GetEdgeByPosition
Use:
Syntax:
GetEdgeByPosition(<PositionParameters>)
Return Value:
Parameters:
<PositionParameters>
Array("NAME:EdgeParameters", _
"BodyName:=", <string>,
"Xposition:=", <value>,
"YPosition:=", <value>,
"ZPosition:=", <value>)
Example:
edgeid = oEditor.GetEdgeByPosition(Array("NAME:EdgeParameters", _
"BodyName:=", "Box1", "XPosition:=", "3.4mm", _
"YPosition:=", "2.8mm", "ZPosition:=", "0.4mm"))
GetEdgeIDsFromFace
Use:
Command:
None
Syntax:
Return Value:
Parameters:
<FaceID>
ID of the face
Example:
Dim oEdgeIDs
oEdgeIDs = Array()
oEdgeIDs = oEditor.GetEdgeIDsFromFace(10)
11-60 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
GetEdgeIDsFromObject
Use:
Command:
None
Syntax:
Return Value:
Parameters:
<ObjectName>
Name of the object
Example:
Example:
Dim oEdgeIDs
oEdgeIDs = Array()
oEdgeIDs = oEditor.GetEdgeIDsFromObject(Box1)
GetFaceArea
Use:
Command:
None.
Syntax:
Return Value:
Parameters:
<FaceID>
Face ID
Example:
Dim oArea
oArea = oEditor.GetFaceArea(10)
GetFaceCenter
Use:
Command:
none
Syntax:
GetFaceCenter <FaceID>
Return Value:
Parameters:
<FaceID>
Example:
Dim oFaceCenter
oFaceCenter = oEditor.GetFaceCenter(oFaceID)
GetFaceByPosition
Use:
Syntax:
GetFaceByPosition(<FaceByPositionParametersArray>)
Return Value:
Parameters:
(<FaceByPositionParametersArray>)
Array("NAME:FaceParameters",
"BodyName:=", <string>,
"XPosition:=", <value>,
"YPosition:=", <value>,
"ZPosition:=", <value>)
BodyName
Name of the body on which the point lies.
Example:
Dim faceid
faceid = oEditor.GetFaceByPosition(Array("NAME:Parameters", _
"BodyName:=" "Box1", "XPosition:=", "3.4mm", "YPosition:=, _
"2.8mm", "ZPosition:=", "0.4mm"))
GetFaceIDs
Use:
Command:
None.
Syntax:
Return Value:
Parameters:
<ObjectName>
Name of the object
Example:
Dim oFaceIDs
oFaceIDs = Array()
oFaceIDs = oEditor.GetFaceIDs(Box1)
GetModelBoundingBox
Use:
Syntax:
GetModelBoundingBox()
Return Value:
Returns the Xmin, Ymin, Zmin, Xmax, Ymax, Zmax values that define the
bounding box.
Parameters:
None
Example:
Dim oBoundingBox
oBoundingBox = oEditor.GetModelBoundingBox()
GetObjectsInGroup
Use:
Syntax:
GetObjectsInGroup(<GroupName>)
Return Value:
Parameters:
<groupName>
Type: <string>
One of <materialName>, <assignmentName>, "Non Model", "Solids", "Unclassified", "Sheets", "Lines"
Example:
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
Dim oObject
Dim oObjects
Set oObjects = oEditor.GetObjectsInGroup( "Sheets" )
For Each oObject in oObjects
MsgBox oObject
Next
GetObjectIdByName
Use:
Syntax:
GetObjectIDByName("<objectName>")
Return Value:
<Object ID>
Parameters:
<objectName>
Type: <string>
Example:
oObjectID = oEditor.GetObjectIDByName("Box2")
GetObjectName
Use:
Syntax:
GetObjectName(<Index>)
3D Modeler Editor Script Commands 11-63
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Return Value:
Parameters:
<Index>
Type: <string>
The 0 base index of the creation order
Example:
objectname = oEditor.GetObjectName(3)
GetObjectNameByFaceID
Use:
Syntax:
GetObjectName(<FaceID>)
Return Value:
Parameters:
<FaceID>
Type: <string>
Example:
objectname = oEditor.GetObjectNameByFaceID(Face10)
GetMatchedObjectName
Use:
Syntax:
GetMatchedObjectName(<ObjectNameWildcardText>)
Return Value:
Parameters:
<ObjectNameWildcardText>
Type: <string>
Text to be used for object name matching.
Example:
objectnames = oEditor.GetMatchedObjectName("Box*")
GetModelUnits
Use:
Command:
None.
Syntax:
GetModelUnits
Return Value:
Parameters:
None.
Example:
Dim oUnit
11-64 3D Modeler Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
oUnit = oEditor.GetModelUnits()
GetNumObjects
Use:
Syntax:
GetNumObjects
Return Value:
Parameters:
None
Example:
totalobjects = oEditor.GetNumObjects
GetSelections
Use:
Informational.
Syntax:
GetSelections
Return Value:
Array of IDs.
Parameters:
None
Example:
Set oProject = oDesktop.SetActiveProject("Project6")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
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
GetUserPosition
Use:
Syntax:
GetUserPosition(<PositionInputPrompt>)
3D Modeler Editor Script Commands 11-65
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Return Value:
Array of coordinates
Parameters:
<PositionInputPrompt>
Type: <string>
Example:
Dim position
Dim coord
position = oEditor.GetUserPosition("Enter a point")
For Each coord in position
Msgbox(coord)
Next
GetVertexIDsFromEdge
Use:
Command:
None.
Syntax:
Return Value:
Parameters:
<EdgeID>
ID of the edge.
Example:
Dim oVertexIDs
oVertexIDs = Array()
oVertexIDs = oEditor.GetVertexIDsFromEdge(10)
GetVertexIDsFromFace
Use:
Command:
None.
Syntax:
Return Value:
Parameters:
<FaceID>
ID of the face
Example:
Dim oVertexIDs
oVertexIDs = Array()
oVertexIDs = oEditor.GetVertexIDsFromFace(10)
GetVertexIDsFromObject
Use:
Command:
None.
Syntax:
Return Value:
Parameters:
<ObjectName>
Name of the object
Example:
Dim oVertexIDs
oVertexIDs = Array()
oVertexIDs = oEditor.GetVertexIDsFromObject(Box1)
PageSetup
Use:
Command:
File>Page Setup
Syntax:
PageSetup <PageSetupParametersArray>
Return Value:
None
Parameters:
<PageSetupParametersArray>
Array("NAME:PageSetupData",
"margins:=",
Array("left:=", <value>,
"right:=", <value>,
"top:=", <value>,
"bottom:=", <value>))
RenamePart
Use:
Renames an object.
Command:
None
Syntax:
RenamePart <RenameParametersArray>
Return Value:
None
Parameters:
<RenameParametersArray>
Array("NAME:Rename Data",
"Old Name:=", <string>,
"New Name:=", <string>)
12
CreateOutputVariable
DeleteOutputVariable
EditOutputVariable
GetOutputVariables
GetOutputVariableValue
CreateOutputVariable
Use:
Add 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 or Sim values or with other
output variable names. It cannot have spaces or any arithmetic and other
operators in it. The definitions can not be cyclic. For example, A = 2*B,
B=3*A is not allowed.
Command:
HFSS>Results>Output Variable
Syntax:
Return Value:
None.
Parameters:
<OutputVarName>
Type: <string>
Name of the output variable
<Expression>
Type: <value>
Value to assign to the variable
<SolutionName>
Type: <string>
The name of the solution as seen in the output variable UI.
<reportTypeName >
Type: <string>
The name of the report type as seen in the output variable UI.
<ContextArray>
Type: <variant>
Context for which the output variable expression is being evaluated.
Example:
Set oModule = oDesign.GetModule("OutputVariable")
oModule.CreateOutputVariable "test","mag(S(WavePort1,WavePort1))", _
"Setup1 : LastAdaptive", "Modal Solution Data", _
Array("Domain:=", "Sweep")
DeleteOutputVariable
Use:
Command:
Syntax:
DeleteOutputVariable <OutputVarName>
Return Value:
None
Parameters:
<OutputVarName>
Type: <string>
Name of the output variable.
Example:
Set oModule = oDesign.GetModule("OutputVariable")
oModule.DeleteOutputVariable efield_online
EditOutputVariable
Use:
Syntax:
Return Value:
None
Parameters:
<OrigVarName>
Type: <string>
Name of the original output variable.
<NewExpression>
Type: <string>
New value to assign to the variable.
<NewVarName>
Type: <string>
New name of the variable if any, else pass 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.
<ContextArray>
Type: <variant>
Context for which the output variable expression is being evaluated
Output Variable Script Commands 12-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Array(Context:=, <Context>)
Example:
Set oModule = oDesign.GetModule("OutputVariable")
oModule.EditOutputVariable "test", "dB(S(WavePort1,WavePort1)) ", _
"testNew", "Setup1 : LastAdaptive", "Modal Solution Data", _
Array("Domain:=", "Sweep")
GetOutputVariables
Use:
Command:
None
Syntax:
GetOutputVariables
Return Value:
Parameters:
None.
Example:
Set oAnsoftApp = CreateObject("AnsoftMaxwell.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("iris")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("OutputVariable")
Dim vec
Set vec = oModule.GetOutputVariables
MsgBox(vec.Count)
For i = 0 to vec.Count - 1
MsgBox(vec.Item(i))
Next
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>,
<ContextArray>)
Return Value:
Parameters:
<OutputVarName>
Type: <string>
Name of the output variable.
<IntrinsicVariation>
Type: <string>
A set of intrinsic variable value pairs to use when evaluating the output expression.
Example: "Freq='20GHz' Theta='20deg' Phi='30deg' in HFSS
"" in Q3D Extractor
<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. Possible values are:
"Modal Solution Data" - Only for Driven Modal solution-type problems with
ports.
"Terminal S Parameters" - Only for Driven Terminal solution-type problems
with ports.
"Eigenmode Parameters" - Only for Eigenmode solution-type problems.
"Fields"
"Far Fields" - Only for problems with radiation or PML boundaries.
"Near Fields" - Only for problems with radiation or PML boundaries.
Emission Test
<Context>
Type: Array
Context for which the output variable expression is being evaluated. This can be
empty if there is no context (for example, for S- parameters). The Reporter uses interpolation to evaluate the values at the given special sweeps. If a requested specialsweep value is outside the range the Reporter does not do extrapolation. Rather it
issues an error message indicating values outside the available range for a primary
sweep.
Example:
Array("Context:=","Infinite Sphere1")
or Array("Context:=","Polyline1")
or Array()
Example:
' ----------------------------------------------------------Output Variable Script Commands 12-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
' ----------------------------------------------------------' Now, look at the original output variable in a different design
' variation
' ----------------------------------------------------------val = oModule.GetOutputVariableValue ( "fieldOV", _
"Distance='0' _
Freq='1GHz' xsize='0.4mm' ysize='4.1mm'", _
"Setup1 : LastAdaptive", "Fields", _
Array("Context:=", "Polyline1", "PointCount:=", 1 ) )
' ----------------------------------------------------------' Look at the same variable at a position 1mm along the line
' ----------------------------------------------------------val = oModule.GetOutputVariableValue ( "fieldOV", _
"Distance='1mm'
Freq='1GHz'", _
"Setup1 : LastAdaptive", _
"Fields", _
Array("Context:=", "Polyline1", "PointCount:=", 3 ) _
)
MsgBox( "2 val " & FormatNumber(val) )
13
Reporter commands should be executed by the oDesign object. One example of accessing this object is:
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("ReportSetup")
All Report and Trace 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, and number display.
Note: HFSS version 11 and above supports Reporter scripting. When you execute Tools>Record Script, HFSS Operations performed in the Reporter are
automatically recorded.
AddCartesianXMarker
AddDeltaMarker
AddMarker
AddNote
AddTraces
ClearAllMarkers
CopyTracesData
CopyReportData
CopyReportDefinitions
CopyTraceDefinitions
CreateReport
Reporter Editor Script Commands 13-1
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
CreateReportFromTemplate
DeleteAllReports
DeleteReports
DeleteTraces
FFTOnReport
ExportPlotImageToFile
ExportToFile
GetAllReportNames
GetDisplayType
ImportIntoReport
PasteReport
PasteTraces
RenameReport
RenameTrace
UpdateAllReports
UpdateReports
UpdateTrace
UpdateTracesContextandSweeps
AddCartesianXMarker
Use:
Command:
Report2D>Marker>Add X Marker
Syntax:
Return Value:
None
Parameters:
<ReportName>
Type: <string>
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:
None
Parameters:
<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>
Reporter Editor Script Commands 13-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
AddMarker
Use:
Command:
Report2D>Marker>Add Marker
Syntax:
Return Value:
None
Parameters:
<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",
AddNote
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<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:
Return Value:
None
Parameters:
<ReportName>
Type: <string>
Name of Report.
<SolutionName>
Type: <string>
Name of the solution as listed in the Modify Report dialog box.
Reporter Editor Script Commands 13-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ClearAllMarkers
Use:
Command:
Report2d>Markers>ClearAllMarkers
Syntax:
ClearAllMarkers <ReportName>
Return Value:
None
Parameters:
<ReportName>
Type: <string>
Name of Report.
Example:
Set oProject = oDesktop.SetActiveProject("dra_antenna")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("ReportSetup")
oModule.ClearAllMarkers "XY Plot 1"
CopyTracesData
Use:
Command:
Select a trace in the Project tree, right-click and select Copy Data
Syntax:
Return Value:
None
Parameters:
<ReportName>
Type: <string>
Name of Report.
<TracesArray>
Type: Array of Strings
Trace definitions from which to copy corresponding data.
Reporter Editor Script Commands 13-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Example:
oModule.CopyTracesData "Transmission", Array("mag(S(Port1,Port2))")
CopyReportData
Use:
Command:
Select a report in the Project tree, right-click and select Copy Data
Syntax:
CopyReportData <ReportsArray>
Return Value:
None
Parameters:
<ReportsArray>
Type: Array of strings
Names of reports from which to copy data.
Example:
oModule.CopyReportData Array("Transmission, Reflection")
CopyReportDefinitions
Use:
Command:
Select a report in the Project tree, right-click and select Copy Definition
Syntax:
CopyReportDefinitions <ReportsArray>
Return Value:
None
Parameters:
<ReportsArray>
Type: Array of strings
Names of reports from which to copy the definitions.
Example:
oModule.CopyReportDefinitions Array("Transmission, Reflection")
CopyTraceDefinitions
Use:
Command:
Select a trace in the Project tree, right-click and select Copy Definition
Syntax:
Return Value:
None
Parameters:
<ReportName>
Type: <string>
Name of Report.
<TracesArray>
CreateReport
Use:
Creates a new report with a single trace and adds it to the Results branch in
the project tree.
Command:
Syntax:
Return Value:
None
Parameters:
<ReportName>
Type: <string>
Name of Report.
<ReportType>
Type: <string>
Possible values are:
"Modal S Parameters" - Only for Driven Modal solution-type problems with
ports.
"Terminal S Parameters" - Only for Driven Terminal solution-type problems
with ports.
"Eigenmode Parameters" - Only for Eigenmode solution-type problems.
"Fields"
"Far Fields" - Only for problems with radiation or PML boundaries.
"Near Fields" - Only for problems with radiation or PML boundaries.
Emission Test
<DisplayType>
Type: <string>
If ReportType is "Modal S Parameters", "Terminal S Parameters", or "Eigenmode Parameters", then set to one of the following:
"Rectangular Plot", "Polar Plot", "Radiation Pattern",
"Smith Chart", "Data Table", "3D Rectangular Plot", or
"3D Polar Plot".
oModule.CreateReport "ReptSmithFreq",_
"Modal Solution Data", "Smith Plot", "Setup1 : Sweep1", _
Array("Domain:=", "Sweep"), _
Array("Freq:=", Array("All")),_
Array("Polar Component:=", _
Array("ln(Y(LumpPort1,LumpPort1))")), _
Array()
CreateReportFromTemplate
Use:
Command:
HFSS>Results>PersonalLib><TemplateName>
Syntax:
CreateReportFromTemplate <TemplatePath>
Return Value:
A new report.
Parameters:
<TemplatePath>
Type: <string>
Path to report template.
Example:
Set oProject = oDesktop.SetActiveProject("wg_combiner")
Set oDesign = oProject.SetActiveDesign("wg_combiner")
Set oModule = oDesign.GetModule("ReportSetup")
oModule.CreateReportFromTemplate
"C:\MyHFSS11Projects\PersonalLib\" & _
"ReportTemplates\TestTemplate.rpt"
DeleteAllReports
Use:
Command:
Right-click the report to delete in the project tree, and then click Delete
All Reports on the shortcut menu.
Syntax:
DeleteAllReports
Return Value:
None
Example:
oModule.DeleteAllReports
DeleteReports
Use:
Command:
Right-click the report to delete in the project tree, and then click Delete on
the shortcut menu.
Syntax:
DeleteReports(<ReportNameArray>)
Return Value:
None
Parameters:
<ReportNameArray>
Type: Array of strings
Example:
oModule.DeleteReports Array(Rept2DRectFreq)
DeleteTraces
Use:
Command:
Right-click the report to delete in the project tree, and then click Delete on
the shortcut menu.
Syntax:
DeleteTraces(<TraceSelectionArray>)
Return Value:
None
Parameters:
<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:
oModule.DeleteTraces Array("XY Plot 1:=", Array("dB(S(LumpPort1,LumpPort1))"), XY Plot 2:=, Array(Mag_E))
ExportPlotImageToFile [Reporter]
Use:
Create field plot exports of existing field plots from a given view points, and
with the model being auto-sized automatically for each view.
Command:
None.
Reporter Editor Script Commands 13-13
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Syntax:
Return Value:
An image file.
Parameters:
<FileName>
Type: <string>
Full path plus file name.
""
Type: <EmptyString>
<PlotItemName>
Type: <string>
Name of fields to plot.
<SetViewTopDownDirectionByRelativeCS>
Type: <string>
Name of relative coordinate system to use for the field plot.
Example:
This example demonstrates the creation of E-field plots of three different orientations:
Mag_E1 created in-plane with the XY-plane of the Global coordinate system
Mag_E2 created in-plane with the XY-plane of the RelativeCS1 coordinate system
Mag_E3 created in-plane with the XY-plane of the RelativeCS2 coordinate system
Dim oAnsoftApp, oDesktop, oProject, oDesign, oEditor, oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.GetActiveProject()
Set oDesign = oProject.GetActiveDesign()
Set oModule = oDesign.GetModule("FieldsReporter")
'First set the module FieldsReporter
oModule.ExportPlotImageToFile "C:\TestEPITF1.jpg", "", "Mag_E1",
"Global"
oModule.ExportPlotImageToFile "C:\TestEPITF2.jpg", "", "Mag_E2",
"RelativeCS1"
oModule.ExportPlotImageToFile "C:\TestEPITF3.jpg", "", "Mag_E3",
"RelativeCS2"
ExportToFile [Reporter]
Use:
From a data table or plot, generates text format, comma delimited, tab
delimited, or .dat type output files.
Command:
Right-click on report name in the Project tree and select Export Data.
Syntax:
Return Value:
None
Parameters:
<ReportName>
Type: string
<FileName>
Type: string
Path and file name.
.txt
.csv
.tab
Tab-separated file
.dat
Example:
oDesign.ExportToFile Plot1, c:\report1.dat
FFTOnReport
Use:
Command:
Syntax:
Return Value:
Parameters:
<PlotName>
Type: string
<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.
Reporter Editor Script Commands 13-15
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 3:39:35 PM
GetAllReportNames
Use:
Syntax:
GetAllReportNames()
Return Value:
Parameters:
None
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHFSS.HFSSScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
13-16 Reporter Editor Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
oDesktop.RestoreWindow
Set oProject = oDesktop.GetActiveProject
Set oDesign = oProject.GetActiveDesign
Set oReportModule = oDesign.GetModule("ReportSetup")
Dim names
names = oReportModule.GetAllReportNames
For index = 0 to UBound(names)
MsgBox(names(index))
Next
Set oFieldReportModule = oDesign.GetModule("FieldsReporter")
Set collection = oFieldReportModule.GetFieldPlotNames
For index = 0 to collection.Count-1
MsgBox(collection.Item(index))
Next
GetDisplayType
Use:
Command:
None
Syntax:
GetDisplayType <reportName>
Return Value:
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<ReportName>
Type: <string>
Report name.
Example:
Set oDesign = oProject.SetActiveDesign("wg_combiner")
Set oModule = oDesign.GetModule("ReportSetup")
MyPlotDisplayType = oModule.GetDisplayType "XY Plot1"
ImportIntoReport
Use:
Command:
Right-click on report name in the Project tree and select Export Data.
Syntax:
Return Value:
None
Parameters:
<ReportName>
Type: string
<FileName>
Type: string
Path and file name.
.csv
.tab
Tab-separated file
.dat
Example:
oDesign.ImportIntoReport Plot1, c:\report1.dat
PasteReports
Use:
Command:
Paste
Syntax:
PasteReports
Return Value:
None
Parameters:
None
Example:
oModule.PasteReports
PasteTraces
Use:
Command:
Paste
Syntax:
PasteTraces <plotName>
Return Value:
None
Parameters:
<plotName>
Type: <string>
Name of plot.
Example:
oModule.PasteTraces "XY Plot1"
RenameReport
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<OldReportName>
Type: string
<NewReportName>
Type: string
Example:
oModule.RenameReport "XY Plot1", "Reflection"
RenameTrace
Use:
Command:
None
Syntax:
Return Value:
None
Parameters:
<plotName>
Reporter Editor Script Commands 13-19
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Type: <string>
Name of plot.
<traceID>
Type: <string>
Name of trace.
<newName>
Type: <string>
New trace name.
Example:
oModule.RenameTrace "XY Plot1", "dB(S(WavePort1,WavePort1))1",_
Port1dbS"
UpdateAllReports
Use:
Updates the specified reports in the Results branch in the project tree.
Command:
Syntax:
UpdateReports Array("<plotname>")
Return Value:
None.
Parameters:
<plotname>
Type: <string>
Name of plot.
Example:
Set oModule = oDesign.GetModule("ReportSetup")
oModule.UpdateAllReports
UpdateReports
Use:
Updates the specified reports in the Results branch in the project tree.
Command:
Update Report
Syntax:
UpdateReports Array("<plotname>")
Return Value:
None.
Parameters:
<plotname>
Type: <string>
Name of plot.
Example:
Set oModule = oDesign.GetModule("ReportSetup")
oModule.UpdateReports Array("XY Plot 1")
UpdateTraces
Use:
Update the traces in a report for which traces are not automatically
updated by the Report Traces dialog, Update Report, Real Time selection.
Command:
Syntax:
Return Value:
Parameters:
<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"
<ContextArray>
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>
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
Reporter Editor Script Commands 13-21
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<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)))
Array()
Type: Empty array.
Denotes the end of the UpdateTraces command.
Example:
Set oModule = oDesign.GetModule("ReportSetup")
oModule.UpdateTraces "XY Plot1", _ Array("dB(S(WavePort1,WavePort1))"), _
"Setup1 : Sweep1", _
Array("Domain:=", "Sweep"), _
Array("Freq:=", Array("All")), _
Array("X Component:=", "Freq", _
"Y Component:=", Array("dB(S(WavePort1,WavePort1))")), _
Array()
Example:
oModule.UpdateTraces "XY Plot 1", Array("dB(S(WavePort1,WavePort1))"), _
"Setup1 : Sweep1", _
Array("Domain:=", "Time", "HoldTime:=", 1, _
"RiseTime:=", 0, "StepTime:=", 0, "Step:=", false, _
"WindowWidth:=", 1, _
"WindowType:=", 0, "KaiserParameter:=", 1, _
"MaximumTime:=", 0), _
Array("Time:=", Array("All")), _
Array("X Component:=", "Time", _
"Y Component:=", Array("dB(S(WavePort1,WavePort1))")), _
Array()
UpdateTracesContextandSweeps
Use:
Use this command to edit sweeps and context of multiple traces without
affecting their component expressions.
Command:
Syntax:
UpdateTracesContextandSweeps
Return Value:
None.
Parameters:
<ReportName>
Type: <string>
Name of Report.
Array(<traceIDs>)
<traceID>
Type: <string>
Name of trace.
<SolutionName>
Type: <string>
Name of the solution as listed in the Modify Report dialog box.
For example: "Setup1 : Last Adaptive"
<ContextArray>
Type: string.
Context for which the expression is being evaluated. This can be an empty string if
there is no context.
ex. Sweep or Time
Array<pointSet>
Type: <string>
Point set for the selected traces, for example, X and Y values for the plot.
Example:
Set oProject = oDesktop.SetActiveProject("Tee")
Set oDesign = oProject.SetActiveDesign("TeeModel")
Set oModule = oDesign.GetModule("ReportSetup")
oModule.UpdateTracesContextAndSweeps _
"Active S Parameter Quick Report", _
Array( _
Reporter Editor Script Commands 13-23
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"dB(ActiveS(Port1:1))", "dB(ActiveS(Port2:1))"), _
"Setup1 : Sweep1", Array(), _
Array("Freq:=", _
Array( _
"9GHz", "9.05GHz", "9.1GHz", "9.15GHz", "9.2GHz", _
"9.25GHz", "9.3GHz", "9.35GHz",
14
Radiation
Perfect H
Symmetry
Finite Conductivity
Master
Impedance
Slave
Layered Impedance
Lumped RLC
Lumped Port
Voltage
Gaussian Beam
Current
Magnetic Bias
GetNumBoundaries
GetNumBoundariesOfType
GetNumExcitations
GetNumExcitationsOfType
GetPortExcitationsCount
ReassignBoundary
RenameBoundary
ReprioritizeBoundaries
SetDefaultBaseName
AutoIdentifyPorts
Use:
Command:
Syntax:
Return Value:
None.
Parameters:
<FaceIDArray>
Array(NAME:Faces, <FaceID>, <FaceID>, ...)
<IsWavePort>
Type: Boolean
true = waveport, false = lumped port
<ReferenceConductorsArray>
Array(NAME:ReferenceConductors, <ConductorName>, <ConductorName>, ...)
<BaseNameforCreatedPorts>
Type: <string>
<empty string> = default name for the wave or lumped port, <string> = base name to
use for created ports
<UseConductorNamesAsBaseNameforTerminals>
Type: Boolean
true = use conductor names, false = use port object name as base name
Example:
Set oModule = oDesign.GetModule("BoundarySetup"
oModule.AutoIdentifyPorts Array("NAME:Faces", 52), true, _
Array("NAME:ReferenceConductors", Conductor1) true
AutoIdentifyTerminals
Use:
Command:
Syntax:
AutoIdentifyTerminals <ReferenceConductorsArray>,
<PortNames> <UseConductorNamesAsBaseNameforTerminals>
Return Value:
None
Parameters:
<ReferenceConductors>
Array(NAME:ReferenceConductors, <ConductorName>, <ConductorName>, ...)
<portNames>
List of names.
<UseConductorNamesAsBaseNameforTerminals>
Type: Boolean
true = use conductor names, false = use port object name as base name
Example:
Set oModule = oDesign.GetModule("BoundarySetup"
oModule.AutoIdentifyTerminals Array("NAME:ReferenceConductors", Conductor1), WavePort1 true
ChangeImpedanceMult
Use:
Command:
Syntax:
ChangeImpedanceMult <MultVal>
Return Value:
None
Parameters:
<MultVal>
Type: <value>
New value for the impedance multiplier.
Example:
oModule.ChangeImpedanceMult 0.5
DeleteAllBoundaries
Use:
Command:
HFSS>Boundaries>Delete All
Syntax:
DeleteAllBoundaries
Return Value:
None
Example:
oModule.DeleteAllBoundaries
DeleteAllExcitations
Use:
Command:
HFSS>Excitations>Delete All
Syntax:
DeleteAllExcitations
Return Value:
None
Example:
oModule.DeleteAllExcitations
DeleteBoundaries
Use:
Command:
Delete command in the List dialog box. Click HFSS>List to open the List
dialog box.
Syntax:
DeleteBoundaries <NameArray>
Return Value:
None
Parameters:
<NameArray>
Type: Array of strings
An array of boundary names.
Example:
oModule.DeleteBoundaries Array("PerfE1", "WavePort1")
GetBoundaryAssignment
Use:
Gets a list of face IDs associated with the given boundary or excitation
assignment.
Syntax:
GetBoundaryAssignment(<BoundaryName>)
Return Value:
Parameters:
<BoundaryName>
Type: <string>
Previously defined boundary or excitation name.
Example:
list = oModule.GetBoundaryAssignment("Rad1")
GetBoundaries
Use:
Syntax:
GetBoundaries()
Return Value:
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Parameters:
None
Example:
bndinfo_array = oModule.GetBoundaries()
GetBoundariesOfType
Use:
Syntax:
GetBoundariesOfType(<BoundaryType>)
Return Value:
Parameters:
<BoundaryType>
Type:<string>
Name of legal boundary type.
For example: "Radiation".
Example:
bndname_array = oModule.GetBoundariesOfType("Perfect E")
GetDefaultBaseName
Use:
Syntax:
GetDefaultBaseName <BoundaryType>
Return Value:
Parameters:
<BoundaryType>
Type:<string>
Name of legal boundary type.
For example: "Radiation".
Example:
bnddefault_BaseName = oModule.GetDefaultBaseName "Radiation"
GetExcitations
Use:
Syntax:
GetExcitations()
Return Value:
Pairs of strings. The first is the name of the excitation (e.g. "port1:1") and
the second is its type ("Wave Port")
Parameters:
None
Example:
excite_name_array = oModule.GetExcitations()
GetExcitationsOfType
Use:
Syntax:
GetExcitationsOfType(<ExcitationType>)
Return Value:
Parameters:
<ExcitationType>
Type: <string>
Name of legal excitation type.
For example: "Plane Incident Wave.
Example:
excite_name_array = _
oModule.GetExcitationsOfType("Wave Port")
GetNumBoundaries
Use:
Syntax:
GetNumBoundaries()
Return Value:
Integer count
Parameters:
None
Example:
numbound = oModule.GetNumBoundaries()
GetNumBoundariesOfType
Use:
Syntax:
GetNumBoundariesOfType(<BoundaryType>)
Return Value:
Integer count
Parameters:
<BoundaryType>
Type: <string>
Example:
numbound = oModule.GetNumBoundariesOfType("Perfect E")
GetNumExcitations
Use:
Gets the number of excitations in a design, including all defined modes and
terminals of ports.
Syntax:
GetNumExcitations()
Return Value:
Integer count
Parameters:
None
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Example:
numexcite = oModule.GetNumExcitations()
GetNumExcitationsOfType
Use:
Gets the number of excitations of the given type, including all defined
modes and terminals of ports.
Syntax:
GetNumExcitationsOfType(<ExcitationType>)
Return Value:
Integer count
Parameters:
<ExcitationType>
Type: <string>
Example:
numexcite = oModule.GetNumExcitationsOfType("Voltage")
GetPortExcitationCounts
Use:
Gets all port names and corresponding number of modes/terminals for each
port excitation.
Syntax:
GetPortExcitationCounts()
Return Value:
Parameters:
None
Example:
portinfo = oModule.GetPortExcitationCounts()
ReassignBoundary
Use:
Command:
HFSS>Boundaries>Reassign or HFSS>Excitations>Reassign
Syntax:
ReassignBoundary Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Return Value:
None
Example:
oModule.ReassignBoundary Array("NAME:PerfE1",_
"Objects:=", Array("Box2", "Box3"),_
"Faces:=", Array(12, 11))
RenameBoundary
Use:
Command:
Right-click a boundary in the project tree, and then click Rename on the
shortcut menu.
Syntax:
Return Value:
None
Parameters:
<OldName>
Type: <string>
<NewName>
Type: <string>
Example:
oModule.RenameBoundary "PerfE1"
"PerfE"
ReprioritizeBoundaries
Use:
Specifies the order in which the boundaries and excitations are recognized
by the solver. The first boundary in the list has the highest priority. Note:
this command is only valid if all defined boundaries and excitations appear
in the list. All ports must be listed before any other boundary type.
Command:
HFSS>Boundaries>Reprioritize
Syntax:
ReprioritizeBoundaries <NewOrderArray>
Return Value:
None
Parameters:
<NewOrderArray>
Array("NAME:NewOrder", <BoundName>, <BoundName>, ...)
Example:
oModule.ReprioritizeBoundaries Array("NAME:NewOrder", _
"Imped1", "PerfE1", "PerfH1")
SetDefaultBaseName
Use:
Syntax:
Return Value:
Parameters:
<BoundaryType>
Type:<string>
Name of legal boundary type.
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
EditMagneticBias
EditRadiation
EditSlave
EditSymmetry
EditTerminal
EditVoltage
EditWavePort
SetTerminalReferenceImpedances
UnassignIERegions
AssignCurent
Use:
Command:
HFSS>Excitations>Assign>Current
Syntax:
AssignCurrent <CurrentArray>
Return Value:
None
Parameters:
<CurrentArray>
Array("NAME:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Current:=", <value>,
<DirectionArray>,
"Faces:=", <AssignmentFaces>)
<DirectionArray>
Array("NAME:Direction",
"Start:=", <LineEndPoint>,
"End:=", <LineEndPoint>)
Example:
oModule.AssignCurrent Array("NAME:Current1",_
"Current:=", "1000mA",_
Array("NAME:Direction",_
"Start:=", Array(-0.4, 0.4, -1.6),_
"End:=", Array(-0.4, 0.4, 0)), _
"Faces:=", Array(12))
AssignFiniteCond
Use:
Command:
HFSS>Boundaries>Assign>Finite Conductivity
Syntax:
AssignFiniteCond <FiniteCondArray>
Return Value:
None
Parameters:
<FiniteCondArray>
Array("NAME:<BoundName>",
"UseMaterial:=",<bool>,
"Material:=", <string>,
"Conductivity:=", <value>,
"Permeability:=", <value>,
"Roughness:=" <value>,
"InfGroundPlane:=", <bool>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>
Radius:=", "<value>", "Ratio:=", "<value>"))
UseMaterial
If True, provide Material parameter.
If False, provide Conductivity and Permeability parameters.
For Huray Roughness, use Radius and Ratio. For Groisse roughness model, use Roughness.
Example:
oModule.AssignFiniteCond Array("NAME:FiniteCond1",_
"UseMaterial:=", false,_
"Conductivity:=", "58000000",_
"Permeability:=", "1",_
"InfGroundPlane:=", false,_
"Faces:=", Array(12))
Example:
oModule.AssignFiniteCond Array("NAME:FiniteCond1",_
"UseMaterial:=", true, _
"Material:=", "copper",_
"InfGroundPlane:=", false,_
"Faces:=", Array(12)
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
AssignFloquet
Use:
Command:
HFSS>Excitations>Assign>Floquet
Syntax:
AssignFloquetPort <FloquetPortArray>
Return Value:
None.
Parameters:
<FloquetPortArray>
Array("NAME:<BoundName>",
"Faces:=", <FaceIDArray>,
<ModesArray>,
"NumModes:=", <Int>,
"RenormalizeAllTerminals:=", <Boolean>,
"DoDeembed:=", <Boolean>,
Array("NAME:Modes", Array("NAME:Mode1",
"ModeNum:=", <Int>,
"UseIntLine:=", <Boolean>),
Array("NAME:Mode2", "ModeNum:=", <Int>,
"UseIntLine:=", <Boolean>)),
"ShowReporterFilter:=", <Boolean>,
"UseScanAngles:=", <Boolean>,
"Phi:=", "<numdeg>",
"Theta:=", "<numdeg>",
Array("NAME:LatticeAVector",
"Start:=", Array("<num><units>", "num><units>",
"<num><units>"),
"End:=", Array("<num><units>", "num><units>",
"<num><units>")),
Array("NAME:LatticeBVector",
"Start:=", Array("<num><units>", "num><units>",
"<num><units>"),
"End:=", Array("<num><units>", "num><units>",
"<num><units>")),
Array("NAME:ModesCalculator",
"Frequency:=", "<Value>GHz",
"FrequencyChanged:=", <Boolean>,
"PhiStart:=", "<num>deg",
"PhiStop:=", "<num>deg",
"PhiStep:=", "<num>deg",
"ThetaStart:=", "<num>deg",
"ThetaStop:=", "<num>deg",
"ThetaStep:=", "<num>deg"),
Array("NAME:ModesList",
Array("NAME:Mode",
"ModeNumber:=", <ModeID>,
"IndexM:=", <Index>,
"IndexN:=", <Index>,
"KC2:=", <value>,
"PropagationState:=", "Propagating",
"Attenuation:=", 0,
"PolarizationState:=", "TE",
"AffectsRefinement:=", <Boolean>),
Array("NAME:Mode",
"ModeNumber:=", <ModeID>,
"IndexM:=", <Index>,
"IndexN:=", <Index>,
"KC2:=", <value>,
"PropagationState:=", "<Propagating>",
"Attenuation:=", <value>,
"PolarizationState:=", "<TE or TM>",
"AffectsRefinement:=", <Boolean>)))
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 13.0.0
' 1:54:11 PM
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project44")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.AssignFloquetPort Array("NAME:FloquetPort1",
"Faces:=", Array(7),
"NumModes:=", 2,
"RenormalizeAllTerminals:=", true,
"DoDeembed:=", false,
Array("NAME:Modes", Array("NAME:Mode1", "ModeNum:=", 1,
"UseIntLine:=", false),
Array("NAME:Mode2", "ModeNum:=", 2, "UseIntLine:=", false)),
"ShowReporterFilter:=", false,
"UseScanAngles:=", true, "Phi:=", "0deg", "Theta:=", "0deg",
Array("NAME:LatticeAVector", "Start:=", Array("0mm", "0mm", "0.8mm"),
"End:=", Array( "0mm", "0.6mm", "0.8mm")),
Array("NAME:LatticeBVector", "Start:=", Array("0mm", "0mm", "0.8mm"),
"End:=", Array("0.8mm", "0mm", "0.8mm")),
Array("NAME:ModesCalculator", "Frequency:=", "1GHz",
"FrequencyChanged:=", false,
"PhiStart:=", "0deg", "PhiStop:=", "0deg", "PhiStep:=", "0deg", "ThetaStart:=", "0deg", "ThetaStop:=", "0deg", "ThetaStep:=", "0deg"),
Array("NAME:ModesList", Array("NAME:Mode", "ModeNumber:=", 1,
"IndexM:=", 0, "IndexN:=", 0, "KC2:=", 0,
"PropagationState:=", "Propagating",
"Attenuation:=", 0,
"PolarizationState:=", "TE",
"AffectsRefinement:=", false),
Array("NAME:Mode", "ModeNumber:=", 2,
"IndexM:=", 0, "IndexN:=", 0,
"KC2:=", 0,
"PropagationState:=", "Propagating",
"Attenuation:=", 0,
14-16 Boundary and Excitation Module Script
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
AssignIERegion
Use:
Command:
Assign IE Region
Syntax:
AssignIERegion <"geometryName">
Return Value:
None
Parameters:
<GeometryName>
Type: String
Name of the geometry assigned as an IE Region.
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 2:26:27 PM
AssignImpedance
Use:
Command:
HFSS>Boundaries>Assign>Impedance
Syntax:
AssignImpedance <ImpedanceArray>
Return Value:
None
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Parameters:
<ImpedanceArray>
Array("NAME:<BoundName>",
"Resistance:=", <value>,
"Reactance:=", <value>,
"InfGroundPlane:=", <bool>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example:
oModule.AssignImpedance Array("NAME:Imped1",_
"Resistance:=", "50",_
"Reactance:=", "50",_
"InfGroundPlane:=", false,_
"Faces:=", Array(12))
AssignIncidentWave
Use:
Command:
HFSS>Excitations>Assign>IncidentWave
Syntax:
AssignIncidentWave <IncidentWaveArray>
Return Value:
None
Parameters:
<IncidentWaveArray>
Array("NAME:<BoundName>",
"IsCartesian:=",<bool>
"EoX:=", <value>,
"EoY:=", <value>,
"EoZ:=", <value>,
"kX:=", <value>,
"kY:=", <value>,
"kZ:=", <value>
"PhiStart:=",<value>,
"PhiStop:=", <value>,
"PhiPoints:=", <int>,
"ThetaStart:=", <value>,
"ThetaStop:=", <value>,
"ThetaPoints:=", <int>,
"EoPhi:=", <value>,
"EoTheta:=", <value>)
IsCartesian
If true, provide the EoX, EoY, EoZ, kX, kY, kZ parameters.
If false, provide the PhiStart, PhiStop, PhiPoints, ThetaStart, ThetStop, ThetaPoints, EoPhi, EoTheta parameters.
Example:
oModule.AssignIncidentWave Array("NAME:IncWave1",_
"IsCartesian:=", true,_
"EoX:=", "1", "EoY:=", "0", "EoZ:=", "0",_
"kX:=", "0", "kY:=", "0", "kZ:=", "1")
Example:
oModule.AssignIncidentWave Array("NAME:IncWave2",_
"IsCartesian:=", false,_
"PhiStart:=","0deg",_
"PhiStop:=", "90deg",_
"PhiPoints:=", 2,_
"ThetaStart:=", "0deg",_
"ThetaStop:=", "180deg",_
"ThetaPoints:=", 3, _
"EoPhi:=", "1", "EoTheta:=", "0")
AssignLayeredImp
Use:
Command:
HFSS>Boundaries>Assign>Layered Impedance
Syntax:
AssignLayeredImp <LayeredImpArray>
Return Value:
None
Parameters:
<LayeredImpArray>
Array("NAME:<BoundName>",
"Frequency:=", <value>,
"Roughness:=", <value>,
"IsInternal:=", <bool>,
<LayersArray>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<LayersArray>
Array("NAME:Layers",
<OneLayerArray>, <OneLayerArray>, ...)
<OneLayerArray>
Array("NAME:<LayerName>",
"LayerType:=", <LayerType>,
"Thickness:=",<value>,
"Material:=", <string>)
<LayerName>
Type: <string>
Specifies the layer number, such as "Layer1" or "Layer2"
<LayerType>
Type: <string>
Should be specified for the last layer only.
Possible values: "Infinite", "PerfectE", or "PerfectH"
Thickness
Thickness of the layer. Should be specified for all layers except the last layer.
Material
Material assigned on the layer. For the last layer, do not specify a material if the
LayerType is "PerfectE" or "PerfectH".
InfGroundPlane <boolean>
For HFSS designs, you can specify whether one layer is an infinite ground plane.
Example:
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.AssignLayeredImp Array("NAME:Layered1",
"Objects:=", Array("Rectangle1"),
"Frequency:=", "10GHz",
"Roughness:=", "0um",
"IsInternal:=", false,
14-20 Boundary and Excitation Module Script
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Array("NAME:Layers",
Array("NAME:Layer1",
"Thickness:=",
"1um",
"Material:=", "vacuum"),
Array("NAME:Layer2",
"LayerType:=", "Infinite",
"Thickness:=",
"1um",
"Material:=", "vacuum")),
"InfGroundPlane:=", true)
AssignLumpedPort
Use:
Command:
HFSS>Excitations>Assign>Lumped Port
Syntax:
AssignLumpedPort <LumpedPortArray>
Return Value:
None
Parameters:
<LumpedPortArray>
Array("NAME:<BoundName>",
"Faces:=", <FaceIDArray>,
"RenormalizeAllTerminals:=", <boolean>
"DoDeembed:=" <boolean"
<ModesArray>,
TerminalIDList:=, <TerminalsArray>,
"FullResistance:=", <value>,
"FullReactance:=", <value>,
)
Example:
oModule.AssignLumpedPort Array("NAME:LumpPort1",_
Array("NAME:Modes",_
"Resistance:=", "50Ohm",_
"Reactance:=","0Ohm",_
Array("NAME:Mode1",_
"ModeNum:=",1,_
"UseIntLine:=", true,_
Array("NAME:IntLine",_
"Start:=", Array(-0.4, 0.4, -1.6),_
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
AssignLumpedRLC
Use:
Command:
HFSS>Boundaries>Assign>Lumped RLC
Syntax:
AssignLumpedRLC <LumpedRLCArray>
Return Value:
None
Parameters:
<LumpedRLCArray>
Array("NAME:<BoundName>",
"UseResist:=",<bool>,
"Resistance:=", <value>,
"UseInduct:=", <bool>,
"Inductance:=", <value>,
"UseCap:=", <bool>,
"Capacitance:=", <value>,
<CurrentLineArray>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
<CurrentLineArray>
Array("NAME:CurrentLine", _
"Start:=", <LineEndPoint>,
"End:=", <LineEndPoint>)
Example:
oModule.AssignLumpedRLC Array("NAME:LumpRLC1",_
"UseResist:=", true,_
"Resistance:=", "10Ohm",_
"UseInduct:=", true,_
"Inductance:=", "10nH",_
"UseCap:=", true,_
"Capacitance:=","10pF",_
Array("NAME:CurrentLine", _
"Start:=", Array(-0.4, -1.2, -1.6),_
"End:=", Array(-0.4, -1.2, 0)),
"Faces:=", Array(12))
AssignMagneticBias
Use:
Command:
HFSS>Excitations>Assign>Magnetic Bias
Syntax:
AssignMagneticBias <MagneticBiasArray>
Return Value:
None
Parameters:
<MagneticBiasArray>
Array("NAME:<BoundName>",
"IsUniformBias:=", <bool>,
"Bias:=", <value>,
"XAngle:=", <value>,
"YAngle:=", <value>,
"ZAngle:=", <value>,
"Project:=",<string>,
"Objects:=", <AssignmentObjects>)
IsUniformBias
If true, supply the Bias, XAngle, YAngle, and ZAngle parameters.
If false, supply the Project parameter.
Example:
oModule.AssignMagneticBias Array("NAME:MagBias1",_
"IsUniformBias:=", true,_
"Bias:=", "1",_
"XAngle:=", "10deg",_
"YAngle:=", "10deg",_
"ZAngle:=", "10deg",_
"Objects:=", Array("Box2"))
Example:
oModule.AssignMagneticBias Array("NAME:MagBias2",_
"IsUniformBias:=", false,_
"Project:=","D:/Maxwell/testing/m3dfs.pjt",_
"Objects:=", Array("Box2"))
AssignMaster
Use:
Command:
HFSS>Boundaries>Assign>Master
Syntax:
AssignMaster <MasterArray>
Return Value:
None
Parameters:
<MasterArray>
Array("NAME:<BoundName>",
<CoordSysArray>,
"ReverseV:=", <bool>,
"Faces:=", <AssignmentFaces>)
<CoordSysArray>
Array("NAME:CoordSysVector",
"Origin:=", <CoordSysPoint>,
"UPos:=", <LineEndPoint>)
Example:
oModule.AssignMaster Array("NAME:Master1",_
Array("NAME:CoordSysVector",_
"Origin:=", Array(-1.4, -1.4, -0.8),_
"UPos:=", Array(-1.4, -1.4, 0)),_
"ReverseV:=", false,_
"Faces:=", Array(12))
AssignPerfectE
Use:
Command:
HFSS>Boundaries>Assign>Perfect E
Syntax:
AssignPerfectE <PerfectEArray>
Return Value:
None
Parameters:
<PerfectEArray>
Array("NAME:<BoundName>",
"InfGroundPlane:=", <bool>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example:
oModule.AssignPerfectE Array("NAME:PerfE1",_
"InfGroundPlane:=", false,_
"Faces:=", Array(12))
AssignPerfectH
Use:
Command:
HFSS>Boundaries>Assign>PerfectH
Syntax:
AssignPerfectH <PerfectHArray>
Return Value:
None
Parameters:
<PerfectHArray>
Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example:
oModule.AssignPerfectH Array("NAME:PerfH1",_
"Faces:=", Array(12))
AssignRadiation
Use:
Command:
HFSS>Boundaries>Assign>Radiation
Syntax:
AssignRadiation <RadiationArray>
Return Value:
None
Parameters:
<RadiationArray>
Array("NAME:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>
"IsIncidentField:=", <boolean>, _
"IsEnforcedHField:=", <boolean>, _
"IsEnforcedEField:=", <boolean>, _
"IsFssReference:=", <boolean>, _
"IsForPML:=", <boolean>, _
"UseAdaptiveIE:=", <boolean>, _
"IncludeInPostproc:=", <boolean>))
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 2:27:20 PM
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project59")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.AssignRadiation Array("NAME:Rad1", _
"Objects:=", Array("Box1"), _
"IsIncidentField:=", false, _
"IsEnforcedField:=", false, _
"IsFssReference:=", false, _
"IsForPML:=", false, _
"UseAdaptiveIE:=", true, _
"IncludeInPostproc:=", true)
AssignScreeningImpedance
Use:
Command:
HFSS>Boundaries>Assign>Screening Impedance
Syntax:
AssignScreeningImpedance <ScreeningArray>
Return Value:
None.
Parameters:
<ScreeningArray>
Array("NAME:<name>",
"Objects:=", Array( "<name>"),
"IsAnisotropic:=", <Boolean>,
If true, you need to specify the coordinate system
"CoordSystem:=", <integer or name>,
"HasExternalLink:=", <Boolean>,
true or false. If False, specify XResistence and XReactance values. Also see the first
example.
"XResistance:=", "<value>",
"XReactance:=", "<value>"
If true, then specify the external link array with the project and solution to use. Also
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 13.0.0
' 4:17:23 PM
AssignSlave
Use:
Command:
HFSS>Boundaries>Assign>Slave
Syntax:
AssignSlave <SlaveArray>
Return Value:
None
Parameters:
<SlaveArray>
Array("NAME:<BoundName>",
<CoordSysArray>,
"ReverseV:=", <bool>,
"Master:=", <string>,
"UseScanAngles:=", <bool>,
"Phi:=", <value>,
"Theta:=", <value>,
"Phase:=", <value>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
<UseScanAngles>
If UseScanAngles is True, then Phi and Theta should be specified.
If it is False, then Phase should be specified.
Example:
oModule.AssignSlave Array("NAME:Slave1",_
Array("NAME:CoordSysVector", _
"Origin:=", Array(-1, 0, 0.2),_
"UPos:=", Array(-1, 0, 0)),_
"ReverseV:=", false,_
"Master:=", "Master1",_
"UseScanAngles:=", true,_
"Phi:=", "10deg",_
"Theta:=", "0deg",_
"Faces:=", Array(12))
Example:
oModule.AssignSlave Array("NAME:Slave2",_
Array("NAME:CoordSysVector",_
"Origin:=", Array(-1, 0, 0.2),_
14-30 Boundary and Excitation Module Script
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
AssignSymmetry
Use:
Command:
HFSS>Boundaries>Assign>Symmetry
Syntax:
AssignSymmetry <SymmetryArray>
Return Value:
None
Parameters:
<SymmetryArray>
Array("NAME:<BoundName>",
"IsPerfectE:=", <bool>
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example:
oModule.AssignSymmetry Array("NAME:Sym1",_
"IsPerfectE:=", true,_
"Faces:=", Array(12))
AssignTerminal
Use:
Command:
HFSS>Excitations>Assign>Terminal
Syntax:
AssignTerminal <TerminalArray>
Return Value:
None
Parameters:
<TerminalArray>
Array(NAME: <TerminalName>, Edges:, <EdgeIDArray>, ParentBndID:= ,
<PortName>, TeminalResistance:=, <value>)
<TerminalName>
Type: String
<EdgeIDArray>
Type: Array of strings
<PortName>
Type: String
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Name of Port.
<value>
Type: string
Value and units for the resistance.
Example:
oModule.AssignTerminal Array("NAME:Rectangle1_T1", _
"Edges:=", Array(36), "ParentBndID:=",
AssignVoltage
Use:
Command:
HFSS>Excitations>Assign>Voltage
Syntax:
AssignVoltage <VoltageArray>
Return Value:
None
Parameters:
<VoltageArray>
Array("NAME:<BoundName>",
"Voltage:=", <value>,
<DirectionArray>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
<DirectionArray>
Array("NAME:Direction",_
"Start:=",<LineEndPoint>,
"End:=", <LineEndPoint>)
Example:
oModule.AssignVoltage Array("NAME:Voltage1",_
"Voltage:=", "1000mV",_
Array("NAME:Direction",_
"Start:=", Array(-0.4, -1.2, 0),_
"End:=", Array(-1.4, -1.2, 0)),_
"Faces:=", Array(7))
AssignWavePort
Use:
Command:
HFSS>Excitations>Assign>Wave Port
Syntax:
AssignWavePort <WavePortArray>
Return Value:
None
Parameters:
<WavePortArray>
Array("NAME:<BoundName>",
"Faces:=", <FaceIDArray>,
"NumModes:=", <int>,
"PolarizeEField:=",<bool>,
"DoDeembed:=", <bool>,
"DeembedDist:=", <value>,
"DoRenorm:=", <bool>,
"RenormValue:=",<value>,
<ModesArray>,
TerminalIDList:=, <TerminalsArray>
)
NumModes
Number of modes for modal problems.
Number of terminals for terminal problems.
<ModesArray>
Specify for modal problems.
Array("NAME:Modes",
<OneModeArray>, <OneModeArray>, ...)
<OneModeArray>
Array("NAME:<ModeName>",
"ModeNum:=", <int>,
"UseIntLine:=", <bool>,
<IntLineArray>)
<ModeName>
Type: <string>
Name of the mode. Format is "Mode<int>". For example "Mode1".
<IntLineArray>
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Array("NAME:IntLine",
"Start:=", <LineEndPoint>,
"End:=", <LineEndPoint>,
"CharImp:=", <string>)
CharImp
Characteristic impedance of the mode. Possible values are "Zpi", "Zpv", or
"Zvi"
Example:
Modal problem:
oModule.AssignWavePort Array("NAME:WavePort1",_
"NumModes:=", 2,_
"PolarizeEField:=",false,_
"DoDeembed:=", true,_
"DeembedDist:=", "10mil",_
"DoRenorm:=", true,_
"RenormValue:=","50Ohm",
Array("NAME:Modes",_
Array("NAME:Mode1",_
"ModeNum:=", 1,_
"UseIntLine:=", true,_
Array("NAME:IntLine",_
"Start:=", Array(-0.4, -1.2, 0),_
"End:=", Array(-1.4, 0.4, 0)),_
"CharImp:=", "Zpi"), _
Array("NAME:Mode2",_
"ModeNum:=", 2,_
"UseIntLine:=", false)),_
"Faces:=", Array(7))
Example:
Terminal problem:
oModule.AssignWavePort Array("NAME:WavePort1",_
"Faces:=", Array(11)
"NumModes:=", 2,_
"PolarizeEField:=", false,_
"DoDeembed:=", false,
TeminalIDList:=, Array()
)
EditCurrent
Use:
Command:
Syntax:
Return Value:
None
EditDiffPairs
Use:
Command:
HFSS>Excitations>Differential Pairs
Syntax:
EditDiffPairs <DifferentialPairsArray>
Return Value:
None
Parameters:
<DifferentialPairsArray>
Array("NAME:EditDiffPairs",
<OneDiffPairArray>, <OneDiffPairArray>,...)
<OneDiffPairArray>
Array("NAME:Pair1",_
"PosBoundary:=", <string>,
"NegBoundary:=", <string>,
"CommonName:=", <string>,
"CommonRefZ:=", <value>,
"DiffName:=", <string>,
"DiffRefZ:=", <value>,
IsActive:=, <boolean>)
PosBoundary
Name of the terminal to use as the positive terminal.
NegBoundary
Name of the terminal to use as the negative terminal.
CommonName
Name for the common mode.
CommonRefZ
Reference impedance for the common mode.
DiffName
Name for the differential mode.
DiffRefZ
Reference impedance for the differential mode.
Example:
oModule.EditDiffPairs Array("NAME:EditDiffPairs", Array("NAME:Pair1",
"PosBoundary:=", _
"Rectangle1_T1", "NegBoundary:=", "Rectangle2_T1", _
"CommonName:=", "Comm1", "CommonRefZ:=", "25ohm", _
"DiffName:=", "Diff1", "DiffRefZ:=", "100ohm", "IsActive:=", true))
EditFiniteCond
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<FiniteCondArray>
Array("NAME:<BoundName>",
"UseMaterial:=",<bool>,
"Material:=", <string>,
"Conductivity:=", <value>,
"Permeability:=", <value>,
"Roughness:=" <value>,
"InfGroundPlane:=", <bool>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>
Radius:=", "<value>", "Ratio:=", "<value>"))
UseMaterial
If True, provide Material parameter.
If False, provide Conductivity and Permeability parameters.
For Huray Roughness, use Radius and Ratio. For Groisse roughness model, use Roughness.
Parameters:
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 2:12:43 PM
EditImpedance
Use:
Command:
Syntax:
Return Value:
None
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
EditIncidentWave
Use:
Command:
Syntax:
Return Value:
None
Parameters:
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Cube_RCS_00a")
Set oDesign = oProject.SetActiveDesign("PEC_d1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.EditIncidentWave "IncPWave1",
Array("NAME:IncPWave1", "IsCartesian:=", false,
"PhiStart:=", "$phi_inc",
"PhiStop:=", "$phi_inc",
"PhiPoints:=", 1,
"ThetaStart:=", "$theta_inc",
"ThetaStop:=", "$theta_inc",
"ThetaPoints:=", 1, "EoPhi:=", "$phi_pol",
"EoTheta:=", "$theta_pol",
"OriginX:=", "0mm",
"OriginY:=", "0mm",
"OriginZ:=", "0mm",
"TransientActive:=", 1,
"TimeProfile:=", "Broadband Pulse",
"HfssFrequency:=", "1GHz",
14-38 Boundary and Excitation Module Script
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"MinFreq:=", "100MHz",
"MaxFreq:=", "1GHz",
"Delay:=", "0.2s",
"NumFreqsExtracted:=", 401,
"SweepMinFreq:=", "100MHz",
"SweepMaxFreq:=", "1GHz",
"IsPropagating:=", true,
"IsEvanescent:=", false, "IsEllipticallyPolarized:=", false)
EditLayeredImpedance
Use:
Command:
Syntax:
Return Value:
None
EditMaster
Use:
Command:
Syntax:
Return Value:
None
EditPerfectE
Use:
Command:
Syntax:
Return Value:
None
EditPerfectH
Use:
Command:
Syntax:
Return Value:
None
EditLumpedPort
Use:
Command:
Syntax:
Parameters:
<LumpedPortArray>
Array("NAME:<BoundName>",
"Faces:=", <FaceIDArray>,
"RenormalizeAllTerminals:=", <boolean>
"DoDeembed:=" <boolean"
<ModesArray>,
TerminalIDList:=, <TerminalsArray>,
"FullResistance:=", <value>,
"FullReactance:=", <value>,
)
Return Value:
None
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 2:18:20 PM May 20, 2011
' ---------------------------------------------Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("calib_modal_test")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.EditLumpedPort "lp2", Array("NAME:lp2", "RenormalizeAllTerminals:=", true, "DoDeembed:=", _
EditLumpedRLC
Use:
Command:
Syntax:
Return Value:
None
EditMagneticBias
Use:
Command:
Syntax:
Return Value:
None
Parameters:
EditRadiation
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<RadiationArray>
Array("NAME:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>
"IsIncidentField:=", <boolean>, _
"IsEnforcedHField:=", <boolean>, _
"IsEnforcedEField:=", <boolean>, _
"IsFssReference:=", <boolean>, _
"IsForPML:=", <boolean>, _
"UseAdaptiveIE:=", <boolean>, _
"IncludeInPostproc:=", <boolean>))
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 2:34:08 PM
EditSlave
Use:
Command:
Syntax:
Return Value:
None
EditSymmetry
Use:
Command:
Syntax:
Return Value:
None
EditTerminal
Use:
Command:
Syntax:
EditTerminal <TerminalArray>)
Return Value:
None
Parameters:
<TerminalArray>
Array(NAME: <TerminalName>, ParentBndID:=, <PortName>, TerminalResistance:=, <value>)
<TerminalName>
Type:String
<PortName>
Type: String
<value>
Type: <string>
Value and units of resistance.
Example:
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.EditTerminal "Rectangle2_T1", Array("NAME:Rectangle2_T1", _
"ParentBndID:=", "WavePort1", "TerminalResistance:=", "75ohm")
EditVoltage
Use:
Command:
Syntax:
Return Value:
None
EditWavePort
Use:
Command:
Syntax:
Return Value:
None
Example:
Boundary and Excitation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
SetTerminalReferenceImpedances
Use:
To set the reference impedance for all terminals within a specified port.
Command:
Syntax:
Return Value:
None
Parameters:
<value>
Type: <string>
The value and units for the the impedance
<PortName>
Type: <string>
The name of the port.
Example:
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.SetTerminalReferenceImpedances "75ohm", "WavePort1"
UnassignIERegions
Use:
Command:
Unassign IE Regions
Syntax:
Return Value:
None
Parameters:
<GeometryName>
Type: String
Name of one or more geometries assigned as an IE Region.
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 14.0.0
' 2:51:43 PM
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project58")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.UnassignIERegions Array("Box1")
AssignAperature [HFSS-IE]
Use:
Command:
HFSS-IE>Boundary>Assign>Aperature...
Syntax:
Parameters:
<boundName>
Type: <string>
Boundary name.
<sheetName>
Type: <string>
Name of the sheet object to which you assign the boundary
Return Value:
None
Example:
Set oProject = oDesktop.SetActiveProject("Project15")
Set oDesign = oProject.SetActiveDesign("HFIEDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.AssignAperture Array("NAME:Aperture1", _
"Objects:=", Array("Rectangle1"))
AssignFiniteCond [HFSS-IE]
Use:
Command:
HFSS-IE>Boundaries>Assign>Finite Conductivity
Syntax:
AssignFiniteCond <FiniteCondArray>
Return Value:
None
Parameters:
<FiniteCondArray>
Array("NAME:<BoundName>",
"Objects:=", <AssignmentObjects>,
"UseMaterial:=",<bool>,
"Material:=", <string>,
"Conductivity:=", <value>,
"Permeability:=", <value>,
"InfGroundPlane:=", <bool>,
"Faces:=", <AssignmentFaces>)
UseMaterial
If True, provide Material parameter.
If False, provide Conductivity and Permeability parameters.
Example:
oModule.AssignFiniteCond Array("NAME:FiniteCond1",_
"Objects:=", Array("Rectangle2"), _
"UseMaterial:=", false, _
"Conductivity:=", "58000000", _
"Permeability:=", "1", _
"Roughness:=", "0um", _
"UseThickness:=", false)
AssignImpedance [HFSS-IE]
Use:
Command:
HFSS-IE>Boundaries>Assign>Impedance
Syntax:
AssignImpedance <ImpedanceArray>
Return Value:
None
Parameters:
<ImpedanceArray>
Array("NAME:<BoundName>",
"Resistance:=", <value>,
"Reactance:=", <value>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example:
oModule.AssignImpedance Array("NAME:Imped1",_
"Resistance:=", "50",_
"Reactance:=", "50",_
"Faces:=", Array(12))
AssignInfiniteGroundPlane [HFSS-IE]
Use:
Command:
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Syntax:
AssignInfGndPlane <Array>
Return Value:
None
Parameters:
<Array>
"NAME:"<InfGndPlaneName>
"ZLocation:=", <value>
"Roughness:=", <value>
"Material:=", "<name>"
Example:
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.AssignInfGndPlane Array("NAME:InfGndPlane1", _
"ZLocation:=", "0mm", _
"Roughness:=", "0mm", _
"Material:=", "Copper")
AssignLumpedPort [HFSS-IE]
Use:
Command:
HFSS>Excitations>Assign>Lumped Port
Syntax:
AutoIdentifyPorts <LumpedPortArray>
Return Value:
None
Parameters:
Array
Example:
Set oDesign = oProject.SetActiveDesign("HFSSIEDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.AutoIdentifyPorts Array("NAME:Faces", 12), _
Array("NAME:ReferenceConductors", "Box1"), _
"LumpPort1", true
CreatePML
Use:
Command to create a new PML group from the script. This is equivalent to
creating a new PML group in the user interface.
Command:
None
Syntax:
"RadDist:=", <value>,
"UseFreq:=", <bool>,
"MinFreq:=", <value>,
"MinBeta:=", <double>)
"RadIncidentField:=", <bool>
"RadFssReference:=", <bool>
Return Value:
None
Parameters:
PMLObj
Name of the object to use as the PML cover.
BaseObj
Name of the base object touching the PML cover object.
Orientation
String representing the orientation of the PML.
Possible values are: "XAxis", "YAxis", and "ZAxis"
UseFreq
If true, provide the MinFreq parameter.
If false, provide the MinBeta parameter.
Example:
oModule.CreatePML Array("UserDrawnGroup:=", false,_
"PMLFaces:=", Array(120), "CreateJoiningObjs:=",_
true,_
"Thickness:=", "0.33mm", "RadDist:=", "1.6mm",_
"UseFreq:=", true, "MinFreq:=", "1GHz")
Example:
oModule.CreatePML Array("UserDrawnGroup:=", true,_
"PMLObj:=", "Box1", "BaseObj:=", "Box2", _
"Thickness:=", "0.3mm", "Orientation:=", "ZAxis", _
"RadDist:=", "1.6mm", "UseFreq:=", false, _
"MinBeta:=", "2")
14-50 Boundary and Excitation Module Script
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ModifyPMLGroup
Use:
Command:
None
Syntax:
ModifyPMLGroup Array("NAME:<GroupName>",
"RadDist:=", <value>,
"UseFreq:=", <bool>,
"MinFreq:=", <value>,
"MinBeta:=", <double>)
Return Value:
None
Parameters:
<GroupName>
Name of the PML group to modify.
UseFreq
If true, provide the MinFreq argument.
If false, provide the MinBeta argument.
Example:
oModule.ModifyPMLGroup Array("NAME:PMLGroup1",
"RadDist:=", "1.166666667mm",
"UseFreq:=", false, "MinBeta:=", 2)
PMLGroupCreated
Use:
Command added by HFSS after a PML has been created. It is not responsible
for creating the PML objects and materials. It just contains the information
needed by the PML Setup wizard for future modification of the PML. This
script command is not intended to be modified by you. Removing this
command from the script will prevent future modification of the PML
through the user interface after the script is played back.
Command:
Syntax:
PMLGroupCreated <args>
Return Value:
None
PMLGroupModified
Use:
Command:
Syntax:
PMLGroupModified <args>
Return Value:
None
RecalculatePMLMaterials
Use:
Command:
None
Syntax:
RecalculatePMLMaterials
Return Value:
None
Example:
oModule.RecalculatePMLMaterials
15
Mesh setup and operations commands should be executed by the "MeshSetup" module.
Set oModule = oDesign.GetModule("MeshSetup")
oModule.CommandName <args>
Conventions Used in this Chapter
<OpName>
Type: <string>
Name of a mesh operation.
<AssignmentObjects>
Type: Array of strings
An array of object names.
<AssignmentFaces>
Type: Array of integers.
An array of face IDs. The ID of a face can be determined through the user interface
using the 3D Modeler>Measure>Area command. The face ID is given in the Measure Information dialog box.
General Commands Recognized by the Mesh Operations Module
Script Commands for Creating and Modifying Mesh Operations
DeleteOp
Use:
Command:
Delete command in the List dialog box. Click HFSS>List to access the List
dialog box.
Syntax:
DeleteOp <NameArray>
Return Value:
None
Parameters:
<NameArray>
Type: Array of strings.
An array of mesh operation names.
Example:
oModule.DeleteOp Array("Length1", "SkinDepth1",_
"Length2")
GetOperationNames
Use:
Syntax:
GetOperationNames(<OperationType>)
Return Value:
Parameters:
<OperationType>
Type: <string>
For example: "Skin Depth Based"
Example:
Set opnames = oModule.GetOperationNames("Length Based")
For Each name in opnames
Msgbox name
Next
RenameOp
Use:
Command:
Right-click the mesh operation in the project tree, and then click Rename
on the shortcut menu.
Syntax:
Return Value:
None
Parameters:
<OldName>
Type: <string>
Old name for the mesh operation.
<NewName>
Type: <string>
New name for the mesh operation.
Example:
oModule.RenameOp "SkinDepth1", "NewName"
AssignLengthOp
Use:
Command:
Syntax:
AssignLengthOp <LengthOpParams>
Return Value:
None
Parameters:
<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. Implies apply restrictions to triangles on the surface of the face or object.
RestrictElem
If true, NumMaxElem should be specified.
RestrictLength
true, _
"MaxLength:=", "1mm")
AssignModelResolutionOp
Use:
Assigns a model resolution name, value and unit for mesh operations, or
specify to UseAutoFeaturelength. If UseAutoFeature length is true, the
Defeature length is not used.
Command:
Syntax:
AssignModelResolutionOp Array(<ModelResParams>)
Return Value:
None
Parameters:
Array("NAME:<string>",
"Objects:=", Array( "<modelname>"), _
"UseAutoLength:=", <Boolean>, _
"DefeatureLength:=", "<value><units>")
Example:
Set oDesign = oProject.SetActiveDesign("wg_combiner")
Set oModule = oDesign.GetModule("MeshSetup")
oModule.AssignModelResolutionOp Array("NAME:ModelResolution1",
"Objects:=", Array( "waveguide"), _
"UseAutoLength:=", true, _
"DefeatureLength:=", "71.5891053163818mil")
AssignSkinDepthOp
Use:
Command:
Syntax:
AssignSkinDepthOp <SkinDepthOpParams>
Return Value:
None
Parameters:
<SkinDepthOpParams>
Mesh Operations Module Script Commands 15-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
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", _
"SurfTriMaxLength:=", "1mm", _
"NumLayers:=", 2)
AssignTrueSurfOp
Use:
Command:
Syntax:
AssignTrueSurfOp <TrueSurfOpParams>
Return Value:
None
Parameters:
<TrueSurfOpParams>
Array("NAME:<OpName>",
"Faces:=", <AssignmentFaces>,
"SurfDevChoice:=",
<RadioOption>,
"SurfDev:=", <value>,
"NormalDevChoice:=", <RadioOption>,
"NormalDev:=", <value>,
"AspectRatioChoice:=", <RadioOption>,
"AspectRatio:=", <double>)
<RadioOption>
15-6 Mesh Operations Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
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)
EditLengthOp
Use:
Command:
Syntax:
Return Value:
None
Example:
oModule.EditLengthOp "Length1", Array("NAME:Length1", _
"RefineInside:=", false, _
"RestrictElem:=", false, _
"RestrictLength:=", true, _
"MaxLength:=", "2mm")
EditModelResolutionOp
Use:
Assigns a model resolution name, value and unit for mesh operations. If
UseAutoLength is true, the Defeature length is not used.
Command:
Syntax:
EditModelResolutionOp Array(<ModelResParams>)
Return Value:
Parameters:
Array("NAME:<string>",
"Objects:=", Array( "<modelname>"), _
Mesh Operations Module Script Commands 15-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"UseAutoLength:=", <Boolean>, _
"DefeatureLength:=", "<value><units>")
Example:
Set oDesign = oProject.SetActiveDesign("wg_combiner")
Set oModule = oDesign.GetModule("MeshSetup")
oModule.EditModelResolutionOp "ModelResolution1", _ Array("NAME:ModelResolution1", "UseAutoLength:=", false, _
"DefeatureLength:=", "71.5891053163818mil")
EditSkinDepthOp
Use:
Command:
Syntax:
Return Value:
None
Example:
oModule.EditSkinDepthOp "SkinDepth1",
Array("NAME:SkinD",_
"RestrictElem:=", false, _
"SkinDepth:=", "2mm", _
"SurfTriMaxLength:=", "1mm", _
"NumLayers:=", 2)
EditTrueSurfOp
Use:
Command:
Syntax:
Return Value:
None
Example:
oModule.EditTrueSurfOp "TrueSurf2",
Array("NAME:trusurf", _
"SurfDevChoice:=", 2, _
"SurfDev:=","0.03mm", _
15-8 Mesh Operations Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"NormalDevChoice:=", 1, _
"AspectRatioChoice:=", 2, _
"AspectRatio:=", 10)
16
RevertAllToInitial
RevertSetupToInitial
DeleteDrivenSweep
Use:
Command:
Right-click a frequency sweep in the project tree, and then click Rename on
the shortcut menu.
Syntax:
Return Value:
None
DeleteSetups
Use:
Command:
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.
Syntax:
DeleteSetups <SetupArray>
Return Value:
None
Parameters:
<SetupArray>
Array(<name1>, <name2>, ...)
Example:
oModule.DeleteSetups Array("Setup1", "Setup2")
DeleteSweep [HFSS-IE]
Use:
Command:
Right-click a frequency sweep in the project tree, and then click Rename on
the shortcut menu.
Syntax:
Return Value:
None
EditFrequencySweep
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
EditSetup
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Name of the solution setup being edited.
<AttributesArray>
Array("NAME:<NewSetupName>", <NamedParameters>)
Analysis Setup Module Script Commands 16-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
EditSweep [HFSS-IE]
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Name of the solution setup containing the sweep to be edited.
<SweepName>
Type: <string>
Name of the sweep to be edited.
<Attributes Array>
Array("NAME:<SweepName>",
"IsEnabled:=", <boolean>,
"SetupType:=", <SetupType>,
<FrequencyInformation>,
"Type:=", <SweepType>,
<SaveFieldsList>
<DCExtrapInfo>)
See the InsertFrequencySweep command for details.
Example:
oModule.EditSweep "Setup1", "Sweep3", _
Array("NAME:Sweep3", "IsEnabled:=", true, _
"SetupType:=", "SinglePoints", _
"ValueList:=", Array("1GHz", "2GHz", "3GHz"), _
"Type:=", "Discrete", _
"SaveFieldsList:=", Array(false, false, false), _
"ExtrapToDC:=", false)
GetSetupCount
Use:
Syntax:
GetSetups()
Return Value:
Number of setups.
Parameters:
None
Example:
setupcount = oModule.GetSetupCount()
GetSetups
Use:
Syntax:
GetSetups()
Return Value:
Parameters:
None
Example:
setupnames = oModule.GetSetups()
GetSweepCount
Use:
Syntax:
GetSweepCount(<SetupName>)
Return Value:
Parameters:
<SetupName>
Type: <string>
Name of the setup.
Example:
sweepcount = oModule.GetSweepCount("Setup1")
GetSweeps
Use:
Syntax:
GetSweeps(<SetupName>)
Return Value:
Parameters:
<SetupName>
Type: <string>
Name of the setup.
Example:
sweepnames = oModule.GetSweeps("Setup1")
InsertFrequencySweep
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Name of the solution setup into which the sweep will be inserted.
<Attributes Array>
Array("NAME:<SweepName>",
"IsEnabled:=", true,
"SetupType:=", <SetupType>,
"Type:=", <SweepType>,
<FrequencyInformation>,
<SaveFieldsList>
<DCExtrapInfo>)
<SweepType>
Type: <string>
Ex. "Discrete", "Fast", or "Interpolating".
<SetupType>
Type: <string>
Ex. "LinearSetup", "LinearCount", or "SinglePoints".
<FrequencyInformation>
This will vary based on the sweep and solution type. See the examples below.
<DCExtrapInfo>
Information about whether and how to perform DC extrapolation. This parameter is
not used for Discrete sweeps. See the examples below.
Example:
Discrete Sweep
"SetupType:=", "LinearStep", _
"StartValue:=", "19.5GHz", _
"StopValue:=", "20.4GHz", _
"StepSize:=", "0.1GHz", _
"Type:=", "Discrete", _
"SaveFields:=", false, "ExtrapToDC:=", false)
Example:
Fast Sweep
Interpolating Sweep
Example:
A Fast sweep, specified using the starting and stopping frequencies and the
step count:
InsertSetup
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SetupType>
Type: <string>
"HfssDriven" or "HfssEigen". Must match the HFSS solution type.
<AttributesArray>
Array("NAME:<SetupName>", <Named Parameters>)
<Named Parameters>
The named parameters will vary according to the solution type. To see the required
parameters for a specific set of parameters and their format, use the record script
function, and view the resulting script in a text edtor. See the examples below.
Example:
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"Target:=", 0.3333,
"UseMaxTetIncrease:=", false,
"MaxTetIncrease:=", 1000000,
"EnableSolverDomains:=", false,
"ThermalFeedback:=", false,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
Example:
"ThermalFeedback:=", false,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
Example:
Example:
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Array("NAME:Setup2",
"Frequency:=", "1GHz",
"PortsOnly:=", false,
"MaxDeltaS:=", 0.02,
"UseMatrixConv:=", true,
Array("NAME:ConvergenceMatrix",
"AllDiagEntries:=", true,
"MagMinThreshold:=", 0.01,
"Entry:=", Array("Port1:=", "abc", "ModeNum1:=", 1)),
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", true,
"BasisOrder:=", 1,
"UseIterativeSolver:=", false,
"DoLambdaRefine:=", true,
"DoMaterialLambda:=", true,
"SetLambdaTarget:=", false,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", false,
"MaxTetIncrease:=", 1000000,
"PortAccuracy:=", 2,
"UseABCOnPort:=", true,
"SetPortMinMaxTri:=", false,
"EnableSolverDomains:=", false,
"ThermalFeedback:=", false,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
InsertSetup [HFSS-IE]
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SetupType>
Type: <string>
HFIESetup. Must match the HFSS solution type.
<AttributesArray>
Array("NAME:<SetupName>", <Named Parameters>)
<Named Parameters>
The named parameters will vary according to the solution type. To see the required
parameters for a specific set of parameters and their format, use the record script
function, and view the resulting script in a text edtor. See the HFSS-IE example
below.
Example:
oModule.InsertSetup "HFIESetup", Array("NAME:Setup3",
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"Enabled:=", true,
"AdaptiveFreq:=", "1GHz",
"DoLambdaRefine:=", true,
"UseDefaultLambdaTarget:=", true,
"Target:=", 0.25,
"DoMaterialLambda:=", true,
"MaxDeltaS:=", 0.02,
"MaxDeltaE:=", 0.1,
"UsePOSolver:=", true)
InsertSetup [Transient]
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SetupType>
Type: <string>
"HfssTransient". Must match the HFSS solution type.
<AttributesArray>
Array("NAME:<SetupName>", <Named Parameters>)
<Named Parameters>
The named parameters will vary according to the solution type. To see the required
parameters for a specific set of parameters and their format, use the record script
function, and view the resulting script in a text edtor. See the examples below.
Example:
InsertSweep [HFSS-IE]
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Name of the solution setup into which the sweep will be inserted.
<Attributes Array>
Array("NAME:<SweepName>",
"IsEnabled:=", true,
"SetupType:=", <SetupType>,
"Type:=", <SweepType>,
<FrequencyInformation>,
<SaveFieldsList>
<DCExtrapInfo>)
<SweepType>
Type: <string>
Ex. "Discrete", "Fast", or "Interpolating".
<SetupType>
Type: <string>
Ex. "LinearSetup", "LinearCount", or "SinglePoints".
<FrequencyInformation>
This will vary based on the sweep and solution type. See the examples below.
<DCExtrapInfo>
Information about whether and how to perform DC extrapolation. This parameter is
not used for Discrete sweeps. See the examples below.
Example:
Discrete Sweep
Fast Sweep
Interpolating Sweep
A Fast sweep, specified using the starting and stopping frequencies and the
step count:
Analysis Setup Module Script Commands 16-17
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
RenameDrivenSweep
Use:
Command:
Right-click a frequency sweep in the project tree, and then click Rename on
the shortcut menu.
Syntax:
Return Value:
None
Example:
oModule.RenameDrivenSweep "Setup1", "Sweep1", _
"MySweep"
RenameSetup
Use:
Command:
Right-click a solution setup in the project tree, and then click Rename on
the shortcut menu.
Syntax:
Return Value:
None
Parameters:
<OldName>
Type: <string>
Name of the solution setup being renamed.
<NewName>
Type: <string>
New name for the solution setup.
RenameSweep [HFSS-IE]
Use:
Command:
Right-click a frequency sweep in the project tree, and then click Rename on
the shortcut menu.
Syntax:
Return Value:
None
Example:
oModule.RenameSweep "Setup1", "Sweep1", _
"MySweep"
RevertAllToInitial
Use:
Marks the current mesh for all solution setups as invalid. This will force the
next simulation to begin with the initial mesh.
Command:
Syntax:
RevertAllToInitial
Return Value:
None
RevertSetupToInitial
Use:
Marks the current mesh for a solution setup as invalid. This will force the
next simulation to begin with the initial mesh.
Command:
Right-click a setup in the project tree, and then click Revert to Initial Mesh
on the shortcut menu.
Syntax:
RevertSetupToInitial <SetupName>
Return Value:
None
17
<StopV>
Type: <VarValue>
The stopping value of a variable.
<MinV>
Type: <VarValue>
The minimum value of a variable.
<MaxV>
Type: <VarValue>
The maximum value of a variable.
<IncludeVar>
Type: <bool>
Specifies whether the variable is included in the analysis.
<StartingPoint>
Array("NAME:StartingPoint",
"<VarName>:=",
"rel:=",
<StopV>))
<Soln>
Type: <string>
Name of the HFSS solution.
<Calc>
Type: <string>
An expression that is composed of a basic solution quantity and an
output variable.
<Geometry>
Type: <string>
Name of geometry needed in the evaluation of <Calc>.
<RangeType>
Type: <string>
if "r", start and stop values specify a range for the variable.
CopySetup
Use:
Command:
None
Syntax:
CopySetup <SetupName>
Return Value:
None
Parameters:
SetupName
Type: <string>
Example:
oModule.CopySetup OptimizationSetup1
DeleteSetups [Optimetrics]
Use:
Command:
Right-click the setup in the project tree, and then click Delete on the
shortcut menu.
Syntax:
DeleteSetups <NameArray>
Return Value:
None
Parameters:
<NameArray>
Type: Array of strings.
An array of setup names.
Example:
oModule.DeleteSetups Array("OptimizationSetup1")
DistributedAnalyzeSetup
Use:
Command:
Right-click the parametric setup name in the project tree and select
Distribute Analysis.
Syntax:
DistributedAnalyzeSetup <ParametricSetupName>
Return Value:
None
Parameters:
<ParametricSetupName>
Type: <string>
Example:
oModule.DistributedAnalyzeSetup "ParametricSetup1"
ExportDXConfigFile
Use:
Create an xml file with the setup information for Design Xplorer.
Command:
Right click on the Design Xplorer setup in the project tree and choose
Export External Connector Addin Configuration
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Must be one of existing DesignExplorer setup names.
<FileName>
Type : <string: file path>
Must be a valid file path and name.
Example:
oModule.ExportDXConfigFile "DesignXplorerSetup1",
"c:/exportdir/DXSetup1.xml")
ExportOptimetricsProfile
Use:
Command:
Right click on the Optimetrics setup in the project tree and choose View
Analysis Result On the Post Analysis Display dialog, click the Profile tab
and click on the Export button.
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Must be one of the existing Parametric, Optimization, Sensitivity, Statistical or
DesignXplorer setup names.
<FileName>
Type : <string: file path>
Must be a valid file path and name with extension of csv, tab, dat, or txt..
[profileNum]
Type : <string>
Must be a numeric string. Optional: defaulted to last profile number. It should be a
zero indexed profile number.
Example:
oModule.ExportOptimetricsProfile "StatisticalSetup1",
"c:/exportdir/test.csv"
ExportOptimetricsResult
Use:
Command:
Right click on the desired Optimetrics setup in the project tree and choose
View Analysis Result On the Post Analysis Display dialog, click the Result
tab, then select Table view, and click on the Export button.
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Must be one of the existing Optimization, Sensitivity, Statistical, or DesignXplorer
setup names.
<FileName>
Type : <string: file path>
Must be a valid file path and name with extension of csv, tab, dat, or txt..
[useFullOutputName]
Type : <boolean>
Optional: defaulted to false. If set to true values will be printed with units. This
parameter is ignored for Optimization and Statistical results.
Example:
ExportParametricResults
Use:
Command:
Right click on the desired Parametric setup in the project tree and choose
View Analysis Result On the Post Analysis Display dialog, click the Result
tab, then select Table view, and click on the Export button.
Syntax:
Return Value:
None
Parameters:
<SetupName>
Type: <string>
Must be one of the existing Parametric setup names.
<FileName>
Type : <string: file path>
Must be a valid file path and name with extension of csv, tab, dat, or txt..
<bOutputUnits>
Type : <boolean>
If set to true values will be printed with units.
Example:
GetSetupNames [Optimetrics]
Use:
Syntax:
GetSetupNames()
Return Value:
Parameters:
None
Example:
GetSetupNamesByType [Optimetrics]
Use:
Syntax:
GetSetupNamesByType(<Optimetrics type>)
Return Value:
Parameters:
<Optimetrics type>
Type: String
Examples: parametric, optimization, statistical, sensitivity
Example:
ImportSetup
Use:
Command:
None
Syntax:
Return Value:
None
Parameters:
SetupTypeName
Type: <string>
Must be one of "OptiParametric" , "OptiOptimization", "OptiSensitivity", "OptiStatistical", or "OptiDesignExplorer".
<SetupInfo>
Array("NAME:<SetupName>", "FilePath")
<SetupName>
Type: <string>
Name of the setup.
FilePath
Type : <string: file path>
Must be a valid file path and name.
Example:
oModule.ImportSetup "OptiStatistical",
Array("NAME:StatisticalSetup1",
"c:/importdir/mySetupInfoFile")
RenameSetup [Optimetrics]
Use:
Command:
Right-click the setup in the project tree, and then click Rename on the
shortcut menu.
Syntax:
Return Value:
None
Parameters:
<OldName>
Type: <string>
<NewName>
Optimetrics Module Script Commands 17-9
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Type: <string>
Example:
oModule.RenameSetup "OptimizationSetup1" "MyOptimization"
SolveSetup [Optimetrics]
Use:
Command:
Right-click the setup in the project tree, and then click Analyze on the
shortcut menu.
Syntax:
SolveSetup <SetupName>
Return Value:
None
Parameters:
oModule.SolveSetup "OptimizationSetup1"
EditSetup [Parametric]
Use:
Command:
Right-click the setup in the project tree, and then click Properties on the
shortcut menu.
Syntax:
Return Value:
None
GenerateVariationData (Parametric)
Use:
Generate variation data before parametric solve for CAD integrated project
Command:
Right click on the parametric setup in the project tree and choose
"Generate Variation Data"
Syntax:
GenerateVariationData <SetupName>
Return Value:
None
Parameters:
<SetupName>
Name of th esetup.
Example:
oModule.GenerateVariationData "ParametricSetup1"
InsertSetup [Parametric]
Use:
Command:
Right-click the Optimetrics folder in the project tree, and then click Add>
Parametric on the shortcut menu.
Syntax:
Return Value:
None
Parameters:
<Parametric Params>
Array("NAME:<SetupName>", "SaveFields:=",
<SaveField>, <StartingPoint>, "Sim. Setups:=",
<SimSetups>,
<SweepDefs>, <SweepOps>,
Array("NAME:Goals", Array("NAME:Goal",
Optimetrics Module Script Commands 17-11
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<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:=",
"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", _
"Context:=", "", _
Array("NAME:Ranges", _
Optimetrics Module Script Commands 17-13
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
EditSetup [Optimization]
Use:
Command:
Right-click the setup in the project tree, and then click Properties on the
shortcut menu.
Syntax:
Return Value:
None
InsertSetup [Optimization]
Use:
Command:
Right-click the Optimetrics folder in the project tree, and then click
Add>Optimization on the shortcut menu.
Syntax:
Return Value:
None
Parameters:
<OptimizationParams>
Array("NAME:<SetupName>", "SaveFields:=",
<SaveField>,
<StartingPoint>, "Optimizer:=",
<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>),
Optimetrics Module Script Commands 17-15
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<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 "OptiOptimization",_
Array("NAME:OptimizationSetup1", _
"SaveFields:=",
false, _
"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:=", _
"Setup1 : LastAdaptive", _
"Calculation:=", "reflect", _
Optimetrics Module Script Commands 17-17
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"Context:=", "", _
Array("NAME:Ranges", _
"Range:=", Array("Var:=",
"Freq", _
"Type:=", "s", _
"Start:=", "8GHz", "Stop:=", "8GHz")), _
"Condition:=",
"<=", _
Array("NAME:GoalValue", _
"GoalValueType:=", "Independent", _
"Format:=",
"Real/Imag", _
0.0002, _
"Noise:=", 0.0001, _
"UpdateDesign:=", true, _
"UpdateIteration:=", 5, _
"KeepReportAxis:=",
true, _
"UpdateDesignWhenDone:=", true)
EditSetup [Sensitivity]
Use:
Command:
Right-click the setup in the project tree, and then click Properties on the
shortcut menu.
Syntax:
Return Value:
None
InsertSetup [Sensitivity]
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<SensitivityParams>
Array("NAME:<SetupName>",
"SaveFields:=", <SaveField>,
<StartingPoint>,
"MaxIterations:=", <MaxIter>,
"PriorPSetup:=", <PriorSetup>,
"PreSolvePSetup:=", <Preceed>,
<SensitivityVars>,
<Constraint>,
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>,
Optimetrics Module Script Commands 17-19
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"IDisp:=", <InitialDisp>),...
"VarName:=", Array("i:=", <IncludeVar>,
"Min:=", <MinV>, "Max:=", <MaxV>,
"IDisp:=", <InitialDisp>))
<InitialDisp>
Type : <VarValue>
The initial displacement of the variable.
<MasterGoalID>
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"))),_
17-20 Optimetrics Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
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 [Statistical]
Use:
Command:
Right-click the setup in the project tree, and click Properties on the
shortcut menu.
Syntax:
Return Value:
None
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 13.0.0
' 3:04:05 PM
"Name:=", "returnloss",
Array("NAME:Ranges",
"Range:=", Array("Var:=", "Freq",
"Type:=", "s",
"Start:=", "8.2GHz", "Stop:=", "0"))),
Array("NAME:Goal",
"ReportType:=", "Modal Solution Data",
"Solution:=", "Setup1 : PortOnly",
Array("NAME:SimValueContext",
"Domain:=", "Sweep"),
"Calculation:=", "reflect",
"Name:=", "reflect",
Array("NAME:Ranges",
"Range:=", Array("Var:=", "Freq",
"Type:=", "s",
"Start:=", "8.2GHz", "Stop:=", "0")))))
InsertSetup [Statistical]
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<StatisticalParams>
Array("NAME:<SetupName>",
"SaveFields:=", <SaveField>,
<StartingPoint>,
"MaxIterations:=",
<MaxIter>,
"PriorPSetup:=", <PriorSetup>,
"PreSolvePSetup:=", <Preceed>,
<StatisticalVars>,
Array("NAME:Goals",
Array("NAME:Goal", <OptiGoalSpec>), ,
Array("NAME:Goal", <OptiGoalSpec>))),
<StatisticalVars>
Array("NAME:Variables",
Optimetrics Module Script Commands 17-23
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
acy.
<Prob>
Type: <double>
Probability for Gaussian distribution. A value >= 0 and < 0.1.
<Mean>
Type: <double>
Mean for Gaussian distribution.
Example:
' ---------------------------------------------' Script Recorded by Ansoft HFSS Version 13.0.0
' 3:29:39 PM
18
IsFieldAvailableAt
ListMatchingVariations
ListValuesOfVariables
ListVariations
DeleteImportData
Use:
Command:
HFSS>Results>Import Solutions
Syntax:
DeleteImportData <ImportSpecArray>
Return Value:
None
Parameters:
<ImportSpecArray>
Array(<ImportSpec>, ...)
<ImportSpec>
Type: <string>
Format of string is "importname:solnnameORtablename".
Example:
oModule.DeleteImportData _
Array("Import1:Adaptive_1", "Import2:DataTable")
EditSources
Use:
Indicates which source excitations should be used for fields post processing.
Command:
HFSS>Fields>Edit Sources
Syntax:
EditSources<FieldType>, <SourceArray>,
<MultiplicityArray>, <MagnitudeArray>,
<PhaseArray>, <TerminatedArray>,
<ImpedanceArray>, <IncludePostProcessing>
Return Value:
None
Parameters:
<FieldType>
Type: <string>
Possible values are:
"NoIncidentWave", "ScatteredFields", "TotalFields",
"IncidentFields", "EigenStoredEnergy", or "EigenPeakElectricField"
<SourceArray>
Array("NAME:SourceNames", <Source1Name>,
<Source2Name>, ...)
A source name is typically the name of the associated excitation.
<MultiplicityArray>
Array("NAME:Modes", <port1NumModes>, <port2NumModes>,
...)
or
Array("NAME:Terminals", <port1NumTerminals>, ...)
A non-port source should indicate multiplicity of 1.
<MagnitudeArray>
Array("NAME:Magnitudes", <Source1Mag>, <Source2Mag>,
...)
This gives the Mag of the complex excitation for each source.
<PhaseArray>
Array("NAME:Phases", <Source1Phase>, <Source2Phase>,
...)
This gives the Phase in degrees of the complex excitation for each source. For Eigenmoded stored energy problems, phase array is not recorded by Tools>Record Script
to File, , and is not needed when running scripts for such problems.
<TerminatedArray>
Array("NAME:Terminated", <IsSource1Terminated>, ...)
Only used for a Driven Terminal solution-type problem.
If it is Driven Terminal, then each source must have an entry, but
entries for non port sources are ignored.
<ImpedanceArray>
Array("NAME:Impedances", <Source1ComplexImped>, ...)
Only for a Driven Terminal solution-type problem.
If it is Driven Terminal, there must be an entry for each terminated
source. Complex format is a string representation as "re + im j".
<IncludePostProcessing>
Type: <bool>
Specifies whether to include post processing effects.
Solutions Module Script Commands 18-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
<useIncidentVoltage>
Type: <bool>
For driven terminal projects, this specifies whether to use incident voltage. The
default for this argument if missing is "false", so that legacy driven terminal projects
behave as if using total voltage.
Example:
oModule.EditSources "NoIncidentWave", _
Array("NAME:SourceNames", "WavePort1", _
"WavePort2"), Array("NAME:Terminals", 2, 2), _
Array("NAME:Magnitudes", 1, 0), _
Array("NAME:Phases",
0, 0),_
Example:
oModule.EditSources "NoIncidentWave", _
Array("NAME:SourceNames", "EigenMode"), _
Array("NAME:Modes",
2), Array("NAME:Magnitudes", _
DeleteFullVariation
Use:
Command:
HFSS>Results>Clean Up Solutions...
Syntax:
Parameters:
<DataSpecifierArray>
Array(<DesignVariationKey>, )
<DesignVariationKey>
Type: <string>
Design variation string.
<Boolean>
Type: boolean
Whether to also delete linked data.
Example:
Set oDesign = oProject.SetActiveDesign("HFSSModel1")
oDesign.DeleteFullVariation Array(""), false
Example:
Solutions Module Script Commands 18-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("ogive")
Set oDesign = oProject.SetActiveDesign("IEDesign1")
oDesign.DeleteFullVariation Array(""), true
Example:
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Tee")
Set oDesign = oProject.SetActiveDesign("TeeModel")
oDesign.DeleteFullVariation Array("offset=" &Chr(39) & "0.2in" _
& Chr(39) & "", "offset=" & Chr(39) & "0in" & Chr(39) & ""), false
DeleteSolutionVariation
Use:
Deletes all solution data for specific solutions and design variations. This is
supported for backward compatibility. You should use DeleteFullVariation.
Command:
HFSS>Results>Clean Up Solutions
Syntax:
DeleteSolutionVariation
Array(<DataSpecifierArray>, ...)
Return Value:
None
Parameters:
<DataSpecifierArray>
Array(<DesignVariationKey>, <SetupName>, <SolnName>)
<DesignVariationKey>
Type: <string>
Design variation string.
<SetupName>
Type: <string>
Name of the solution setup.
<SolnName>
Type: <string>
Name of the solutions within the solution setup.
Example:
oModule.DeleteSolutionVariation Array( _
Array("width=2in", "Setup1", "Adaptive_1") _
Array("width=2in", "Setup1", "Sweep1") )
DeleteVariation
Use:
Deletes matrix, field, and/or mesh solution data for specific variations,
across all solutions.
Command:
HFSS>Results>Browse Solutions
Syntax:
Return Value:
None
Parameters:
<VariationArray>
Array(<DesignVariationKey>, <DesignVariationKey>,...)
<FullVariations>
Type: <bool>
Specifies whether to delete meshes, fields, matrix data, profile, and convergence data.
<MeshAndFieldsOnly>
Type: <bool>
Specifies whether to delete only meshes and fields.
<FieldsOnly>
Type: <bool>
Specifies whether to delete fields only.
Example:
oModule.DeleteVariation _
Array("width=2in", "width=2.5in"), _
TRUE, FALSE, FALSE
ExportForSpice
Use:
Exports matrix solution data to a file in a format suitable for Spice analysis.
Available only for Driven Terminal solution types with ports. Output in an
appropriate format will be generated for each of the non-empty file names
provided.
Command:
None
Syntax:
ExportForSpice
<DesignVariationKey>, <SolnSelectionArray>, <SpiceType>,
<BandWidth>, <FWSFile>, <LumpedElementFile>,
<PoleZeroSpiceFile>, <PoleZeroMatlabFile>,
<PartialFractionFile>, <FittingErrorInPercent>,
<MaximumOrder>,
<UseCommonGround>,
<EnforcePassivity>
Return Value:
None
Parameters:
<SpiceType>
Type: <int>
Possible values are:
0: PSpice
2: Maxwell Spice
<BandWidth>
Type: <int>
Possible values are:
0: Low (narrow) band width
<FWSFile>
Type: <string>
<LumpedElementFile>
Type: <string>
<PoleZeroSpiceFile>
Type: <string>
<PoleZeroMatlabFile>
Type: <string>
<PartialFractionFile>
Type: <string>
<FittingErrorInPercent>
Type: <Float>
<MaximumOrder>
Type: <Integer>
<UseCommonground>
Type: 0/1
<EnforcePassivity>
Type: 0/1
Example:
oModule.ExportForSpice "width=2in", _
Array("Setup1:Sweep1"), 2, 0, _
"c:\mydir\Sweep1.fws", "", "", "", ""
ExportEigenmodes
Use:
Command:
None
Syntax:
ExportEigenmodes
<setupName> <solutionName> <DesignVariationKey>
<filename>
Return Value:
None
Parameters:
<SolutionName>
Type: <string>
Name of the solutions within the solution setup.
<DesignVariationKey>
Type: <string>
Design variation string.
Example:
Solutions Module Script Commands 18-9
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"C:\mydir\myeigenmode" & _
".eig"
ExportForHSpice
Use:
Command:
None
Syntax:
ExportForHSpice
<DesignVariationKey>, <SolnSelectionArray>, <SpiceType>,
<BandWidth>, <FWSFile>, <LumpedElementFile>,
<PoleZeroSpiceFile>, <PoleZeroMatlabFile>,
<PartialFractionFile>,
<FittingErrorInPercent>, <MaximumOrder>, <MinimumOrder>,
<EnforcePassivity>
Return Value:
None
Parameters:
<SpiceType>
Type: <int>
Possible value is:
1: HSpice
<BandWidth>
Type: <int>
Possible value is:
0: Low (narrow) band width
<FWSFile>
Type: <string>
<LumpedElementFile>
Type: <string>
<PoleZeroSpiceFile>
Type: <string>
<PoleZeroMatlabFile>
Type: <string>
<PartialFractionFile>
Type: <string>
<FittingErrorInPercent>
Type: <float>
The accuracy to use in fitting the pole zero model.
<MaximumOrder>
Type: <int>
Maximum number of poles in rational function expansion.
<UseCommonGround>
Type:<init>
0/1
<EnforcePassivity>
Type: : <int>
0/1
Example:
oModule.ExportForHSpice "width=2in", _
Array("Setup1:Sweep1"), 1, 0, _
"c:\mydir\Sweep1.fws", "", "", "", "", _
.005, 20, 200
ExportNetworkData
Use:
Exports matrix solution data to a file. Available only for Driven solution
types with ports.
Command:
None
Syntax:
ExportNetworkData
<DesignVariationKey>, <SolnSelectionArray>, <FileFormat>,
<OutFile>,<FreqsArray>, <DoRenorm>, <RenormImped>
<dataType> <pass> <complexFormat>
Return Value:
None
Parameters:
<SolnSelectionArray>
Solutions Module Script Commands 18-11
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
The pass to export. This is ignored if the sourceName is a frequency sweep. Leaving
out this value or specifying -1 gets all passes.
<ComplexFormat>
Type: "0", "1", or "2"
The format to use for the exported data.
0 = Magnitude/Phase.
1= Real/Imaginary.
2= db/Phase.
<TouchstonePrecision>
Type: <int>
Default if not specified is 15.
Example:
Example:
Example:
"C:/Ring_hybrid HFSSDesign.s4p", _
Array( "All"), true, 50, "S", -1, 0, 15
ExportNMFData
Use:
Command:
None
Syntax:
ExportNMFData
<SolnSelectionArray>, <OutFile>, <FreqsArray>,
<DesignVariationKey>, <DoRenorm>, <RenormImped>
Return Value:
None
Solutions Module Script Commands 18-13
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Example:
oModule.ExportNMFData Array("Setup1:Sweep1"), _
"c:\mydir\out.nmf", Array("all"), "", FALSE, 0
GetAdaptiveFreq
Use:
Syntax:
GetAdaptiveFreq(<SetupName>)
Return Value:
Parameters:
<SetupName>
Type: <string>
Example:
set oModule = oDesign.GetModule("Solutions")
adaptfreq = oModule.GetAdaptiveFreq("Setup1")
GetISolutionVersionID
Use:
Syntax:
GetISolutionVersionID(BSTR fullSolutionName)
Return Value:
Parameters:
None
Example:
versionID = oModule.GetISolutionVersionID(BSTR fullSolutionName)
GetSolveRangeInfo
Use:
Syntax:
GetSolveRangeInfo(<SolutionName>)
Return Value:
An array of frequencies.
Parameters:
<SolutionName>
Type: <string>
Example:
set oModule = oDesign.GetModule("Solutions")
18-14 Solutions Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
freqrange = oModule.GetSolveRangeInfo("Setup1:Sweep1")
GetValidISolutionList
Use:
Syntax:
GetValidISolutionList(<IncludeImportedSolutions>)
Return Value:
Array of names
Parameters:
<IncludeImportedSolutions>
Type: <Boolean>
If no parameter is given the default is False.
Example:
solution = oModule.GetValidISolutionList(True)
HasFields
Use:
Syntax:
HasFields(<SolutionName>, <DesignVariation>)
Return Value:
Parameters:
<SolutionName>
Type: <string>
Example: "Setup1:LastAdaptive"
<DesignVariation>
Type: <string>
Example: "x_size = 2mm"
Example:
set oModule = oDesign.GetModule("Solutions")
fieldsExist = oModule.HasFields("Setup1:Sweep1", _
"x_size=2mm")
HasMatrixData
Use:
Syntax:
HasMatrixData(<SolutionName>, <DesignVariation>)
Return Value:
Parameters:
<SolutionName>
Solutions Module Script Commands 18-15
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Type: <string>
Example: "Setup1:LastAdpative"
<DesignVariation>
Type: <string>
Example: "radius = 4in"
Example:
set oModule = oDesign.GetModule("Solutions")
matrixExist = 0Module.HasMatrixData("Setup1:Adaptive_1",_
"radius = 4in")
HasMesh
Use:
Syntax:
HasMesh(<SetupName>, <DesignVariation>)
Return Value:
Parameters:
<SetupName>
Type: <string>
<DesignVariation>
Type: <string>
Example:
set oModule = oDesign.GetModule("Solutions")
meshexist = oModule.HasMesh("Setup1", "x_size = 2in _
y_size = 1in")
ImportSolution
Use:
Command:
HFSS>Results>Import Solutions
Syntax:
Return Value:
None
Parameters:
<FileName>
Type: <string>
Location of the source data. The type of the data file will be determined strictly by its
file extension. Supported types are Touchstone (.sNp or .yNp or .zNp or .tou), and
Ansoft Designer (.flp).
<ImportName>
Type: <string>
Identifying name to use for the import, analogous to solution setup name.
<SolnArray>
Type: Array of strings
The names of the solutions selected for import from the file. The only import format
supporting multiple solutions in one file is HFSS8.x format.
Example:
oModule.ImportSolution "c:\mydir\in.s2p", _
"MeasuredData", Array("Sweep1")
ImportTable
Use:
Imports a data table for use in plotting reports in HFSS. Not used in HFSS-IE.
The table can have multiple independent real-valued columns of data, and
multiple dependent real- or complex-valued columns of data. The data
supported imports are either tab delimited format (.tab) or comma
delimited format (.csv). The first row may contain column names. Complex
data columns are inferred from the column data format. In tab delimited
format, "(double, double)" denotes a complex number. In comma
delimited format, "(double, double)" denotes a complex number.
Command:
HFSS>Results>Import Solutions
Syntax:
ImportTable
<FileName>, <ImportName>, <TableName>,
<ComplexIsRealImag>, <IsMatrixData>,
<ColNames>, <ColIndependentFlags>
Return Value:
None
Parameters:
<FileName>
Type: <string>
Location of the source data.
<ImportName>
Type: <string>
Solutions Module Script Commands 18-17
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Identifying name to use for the import, analogous to solution setup name.
<TableName>
Type: <string>
Identifying name for the table, analogous to solution name.
<ComplexIsRealImag>
Type: <bool>
Whether to use real/imag to interpret data for any complex column.
If false, then use mag/phase(degrees).
<IsMatrixData>
Type: <bool>
Controls whether the table data can be used in matrix data reports or in field data
reports.
<ColNames>
Array("ColName1", ...)
Non-empty array used only if you want to override the column names obtained from
the table data file, in which case all column names are required.
<ColIndependentFlags>
Array(<bool>, ...)
Indicates which columns are independent. If this is the empty array, the default is that
only the first column is independent. If this is the non- empty array, a flag must be
present for every column.
Example:
oModule.ImportTable "c:\mydir\mytable.tab", _
"ImportData", "Measurements", TRUE, TRUE, _
Array(), Array(TRUE, TRUE, FALSE, FALSE, FALSE)
IsFieldAvailableAt
Use:
Syntax:
IsFieldAvailableAt(<SolutionName>, <DesignVariation>,
<Freq>)
Return Value:
Parameters:
<SolutionName>
Type: <string>
<DesignVariation>
Type: <string>
Example: "y_start = 3mm"
<Freq>
Type: <double>
Example:
set oModule = oDesign.GetModule("Solutions")
fieldsExist = oModule.IsFieldAvailableAt _
("Setup1:Sweep1", " ", "9000000000.0")
ListMatchingVariations
Use:
Gets a list of solved variations that include the specified variable values.
Command:
None
Syntax:
ListMatchingVariations
(<FullSolutionName>, <ArrayOfMatchingVariableNames>,
<ArrayOfMatchingVariableValueStringsIncludingUits>)
Return Value:
Parameters:
<FullSolutionName>
Type: String
<ArrayOfMatchingVariableNames>
Type: String
<ArrayOfMatchingVariableValueStringsIncludingUnits>
Type: String
Example:
list = oModule.ListMatchingVariations("Setup1 : LastAdaptive",_
Array("x_size", "y_size"), Array("2mm", "1mm"))
ListValuesOfVariable
Use:
Command:
None
Syntax:
ListValuesOfVariable(<FullSolutionName>, <VariableName>)
Return Value:
Parameters:
<FullSolutionVariableName>
Type: String
<VariableName>
Type: String
Example:
list = oModule.ListValuesOfVariable("Setup1 : _LastAdaptive", "x_size")
ListVariations
Use:
Command:
None
Syntax:
ListVariations(<FullSolutionName>)
Return Value:
Parameters:
<FullSolutionName>
Type: String
Example:
list = oModule.ListVariations("Setup1 : LastAdaptive")
19
CreateFieldPlot
Use:
Command:
HFSS>Fields>Plot Fields>Mag_E
Syntax:
CreateFieldPlot
Return Value:
None
Parameters:
<PlotParameterArray>
<PlotParameterArray>
Array("NAME:<PlotName>",
"SolutionName:=", <string>,
"QuantityName:=", <string>,
"PlotFolder:=", <string>,
"UserSpecifyName:=",
<int>,
"UserSpecifyFolder:=", <int>,
"IntrinsicVar:=", <string>,
"PlotGeomInfo:=", <PlotGeomArray>,
"FilterBoxes:=", <FilterBoxArray>,
<PlotOnPointsSettings>,
<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"
HFSS requires a space on either side of the : character. If it is
missing, the plot will not be created.
QuantityName
Type of plot to create. Possible values are:
Mesh plots: "Mesh"
Field plots: "Mag_E", "Mag_H", "Mag_Jvol", "Mag_Jsurf",
"ComplexMag_E", "ComplexMag_H", "ComplexMag_Jvol",
"ComplexMag_Jsurf", "Vector_E", "Vector_H",
19-2 Field Overlays Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
no filtering
<PlotOnPointSettings>
Array("NAME:PlotOnPointSettings",
"PlotMarker:=", <bool>,
"PlotArrow:=", <bool>)
<PlotOnLineSettings>
Array("NAME:PlotOnLineSettings",
Array("NAME:LineSettingsID",
"Width:=", <int>,
"Style:=", <string>),
"IsoValType:=", <string>,
19-4 Field Overlays Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"ArrowUniform:=", <bool>,
"NumofArrow:=",
<int>)
Style
Possible values are "Cylinder", "Solid", "Dashdash",
"Dotdot", "Dotdash"
IsoValType
Possible values are "Tone", "Fringe", "Gourard"
<PlotOnSurfaceSettings>
Array("NAME:PlotOnSurfaceSettings",
"Filled:=", <bool>,
"IsoValType:=", <string>,
"SmoothShade:=", <bool>,
"AddGrid:=", <bool>,
"MapTransparency:=", <bool>,
"Transparency:=", <doubl.e>,
"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"),_
"FilterBoxes:=", Array(0),
Array("NAME:PlotOnSurfaceSettings", _
"Filled:=", false, _
"IsoValType:=", "Fringe", _
"SmoothShade:=", true, _
"AddGrid:=", false, _
"MapTransparency:=", true, _
"Transparency:=", 0, _
"ArrowUniform:=", true, _
"ArrowSpacing:=",
0.100000001490116, _
DeleteFieldPlot
Use:
Command:
HFSS>Fields>Delete Plot
Syntax:
DeleteFieldPlot <NameArray>
Return Value:
None
Parameters:
<NameArray>
Array of strings the names of the plots to delete.
Example:
oModule.DeleteFieldPlot Array("Mag_E1", "Vector_E1")
GetFieldPlotNames
Use:
Syntax:
GetFieldPlotNames()
Return Value:
Parameters:
None
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftHFSS.HFSSScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.GetActiveProject
Set oDesign = oProject.GetActiveDesign
Set oReportModule = oDesign.GetModule("ReportSetup")
Dim names
names = oReportModule.GetAllReportNames
For index = 0 to UBound(names)
MsgBox(names(index))
Next
Set oFieldReportModule = oDesign.GetModule("FieldsReporter")
Set collection = oFieldReportModule.GetFieldPlotNames
For index = 0 to collection.Count-1
MsgBox(collection.Item(index))
Next
ModifyFieldPlot
Use:
Command:
HFSS>Fields>Modify Plot
Syntax:
Return Value:
None
Example:
oModule.ModifyFieldPlot "Vector_E1",_
Array("NAME:Vector_E2", _
"SolutionName:=",
"Setup1 : LastAdaptive", _
Field Overlays Module Script Commands 19-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"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, _
RenameFieldPlot
Use:
Renames a plot.
Command:
Right-click the plot you want to rename in the project tree, and then click
Rename on the shortcut menu.
Syntax:
Return Value:
None
Parameters:
<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:
Right-click a plot folder in the project tree, and then click Rename on the
shortcut menu.
Syntax:
Return Value:
None
Parameters:
<OldName>
Type: <string>
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:
None
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", _
Field Overlays Module Script Commands 19-9
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
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)))
SetPlotFolderSettings
Use:
Command:
Syntax:
SetPlotFolderSettings <PlotFolderName>
<PlotFolderAttributes>
Return Value:
None
Parameters:
<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>,
"IntrinsicMin:=", <double>,
"IntrinsicMax:=",
<double>)
<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:=",
<double>)
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,
127, 127)), _
Array("NAME:Scale3DSettings", _
"m_nLevels:=",
27, _
"m_autoScale:=", true, _
"minvalue:=", 9.34379863739014, _
"maxvalue:=",
13683.755859375, _
"log:=", false, _
19-12 Field Overlays Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"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))
20
Fields Calculator commands should be executed by the Field Overlays module, which is called "FieldsReporter" in HFSS scripts.
Set oModule = oDesign.GetModule("FieldsReporter")
oModule.CommandName <args>
The command associated with each of the following scripting commands will
be a button pressed in the Fields Calculator.
AddNamedExpression
AddNamedExpr
CalcOp
CalculatorRead
CalcStack
CalculatorWrite
ChangeGeomSettings
ClcEval
ClcMaterial
ClearAllNamedExpr
CopyNamedExprToStack
DeleteNamedExpr
EnterComplex
EnterComplexVector
EnterLine
EnterPoint
Fields Calculator Script Commands 20-1
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
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.
Command:
Click Add.
Syntax:
AddNamedExpression <Name>
Return Value:
None
Parameters:
Example:
oModule.AddNamedExpression "Mag_JxE", "Fields"
AddNamedExpr
Use:
Creates a named expression using the expression at the top of the stack.
Command:
Click Add.
Syntax:
AddNamedExpr <Name>
Return Value:
None
Parameters:
<ExpressionName>
Type: <string>
Name for the new named expression.
<FieldType>
Type: <string>
Example:
oModule.AddNamedExpr "Mag_JxE", "Fields"
CalcOp
Use:
Command:
Syntax:
CalcOp <OperationString>
Return Value:
None
Parameters:
<OperationString>
Type: String
The text on the corresponding calculator button.
Examples: Mag, +
Fields Calculator Script Commands 20-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
CalculatorRead
Use:
Command:
Click Read
Syntax:
Return Value:
None
Parameters:
<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:
oModule.CalculatorRead "c:\test.reg", _
"Setup1 : LastAdaptive", "Fields", _
Array("Freq:=", "1GHz", "Phase:=", "0deg")
CalcStack
Use:
Command:
Syntax:
CalcStack <OperationString>
Return Value:
None
Parameters:
<Operation String>
Type: <string>
The text on the corresponding calculator button.
Example:
oModule.CalcStack "push"
CalculatorWrite
Use:
Command:
Click Write
Syntax:
Return Value:
None
Parameters:
<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:\test.reg", _
Array("Solution:=", "Setup1 : LastAdaptive"), _
Array("Freq:=", "1GHz", "Phase:=", "0deg")
ChangeGeomSettings
Use:
Command:
Geom Settings
Syntax:
ChangeGeomSettings <int>
Return Value:
None
Parameters:
ClcEval
Use:
Evaluates the expression at the top of the stack using the provided solution
name and variable values.
Command:
Click Eval.
Syntax:
Return Value:
None
Parameters:
<SolutionName>
Type: <string>
<VariablesArray>
Array of variable name, value pairs.
Example:
oModule.ClcEval "Setup1: LastAdaptive", _
Array ("Freq:=", "10GHz",_
"Phase:=", "0deg")
ClcMaterial
Use:
Command:
Click Matl.
Syntax:
Return Value:
None
Parameters:
<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:
Command:
Click ClearAll.
Syntax:
ClearAllNamedExpr
Return Value:
None
Parameters:
None
CopyNamedExprToStack
Use:
Command:
Syntax:
CopyNamedExprToStack <Name>
Return Value:
None
Parameters:
<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:
DeleteNamedExpr <Name>
Return Value:
None
Parameters:
<Name>
Type: <string>
The name of the named expression to be deleted.
Example:
oModule.DeleteNamedExpr "Mag_JxE"
EnterComplex
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<Real>
Type: <double>
Real component of the scalar.
<Imaginary>
Type: <double>
Imaginary component of the scalar.
Example:
oModule.EnterComplex "1 + 2 j"
EnterComplexVector
Use:
Command:
Syntax:
Return Value:
None
Parameters:
Example:
oModule.EnterComplexVector Array("1 + 2 j",_
"1 + 2 j",_
"1 + 2 j")
EnterLine
Use:
Command:
Syntax:
EnterLine <LineName>
Return Value:
None
Parameters:
<LineName>
Type: <string>
Name of a line defined in the 3D Modeler editor.
Example:
oModule.EnterLine "Line1"
EnterPoint
Use:
Command:
Syntax:
EnterPoint <PointName>
Return Value:
None
Parameters:
<PointName>
Type: <string>
Name of a point defined in the 3D Modeler editor.
Example:
oModule.EnterPoint "Point1"
EnterQty
Use:
Command:
Syntax:
EnterQty <FieldQuantityString>
Return Value:
None
Parameters:
Example:
oModule.EnterQty "E"
EnterScalar
Use:
Command:
Click Number and then click Scalar. Complex option not selected.
Syntax:
EnterScalar <Scalar>
Return Value:
None
Parameters:
<Scalar>
Type: <double>
The real number to enter onto the stack.
EnterScalarFunc
Use:
Command:
Syntax:
EnterScalarFunc <VarName>
Return Value:
None
Parameters:
<VarName>
Type: <string>
Name of a variable to enter as a scalar function onto the stack.
Example:
oModule.EnterScalarFunc "Phase"
EnterSurf
Use:
Command:
Syntax:
EnterSurf <SurfaceName>
Return Value:
None
Parameters:
<SurfaceName>
Type: <string>
Name of a surface defined in the 3D Modeler editor.
Example:
oModule.EnterSurf "Rectangle1"
EnterVector
Use:
Command:
Click Number, and then click Vector. Complex option not selected.
Syntax:
Return Value:
None
Parameters:
<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:
None
Parameters:
Example:
oModuleEnterVectorFunc Array("X", "Y", "Z")
EnterVol
Use:
Command:
Syntax:
EnterVol <VolumeName>
Return Value:
None
Parameters:
<VolumeName>
Type: <string>
Name of a volume defined in the 3D Modeler editor.
Example:
oModule.EnterVol "Box1"
ExportOnGrid
Use:
Evaluates the top stack element at a set of points specified by a grid and
exports the data to a file.
Command:
Syntax:
Return Value:
None
Parameters:
<OutputFile>
Type: <string>
Name of the output file.
<MinArray>, <MaxArray>, <SpacingsArray>
Type: Array<double, double, double>
Min, Max, and Spacing for the coordinate components of the grid system, Cartesian
(default), Cylindrical or Spherical.
<setup>
Type: <string>
Fields Calculator Script Commands 20-11
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ExportToFile
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<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:
Syntax:
GetTopEntryValue(<SolutionName>, <VariablesArray>)
Return Value:
Parameters:
<SolutionName>
Type: <string>
Example: "Setup1: LastAdaptive"
<VariablesArray>
Array of variable name, value pairs.
Example:
dim topvalue
topvalue = _
oModule.GetTopEntryValue("Setup1:LastAdaptive", _
Array("Freq:=", "1GHz", "Phase:=", "0deg", _
"x_size:=", "2mm"))
If cdbl(topvalue(0)) <- 180.0 then ...
LoadNamedExpressions
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<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>
Fields Calculator Script Commands 20-13
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
SaveNamedExpressions
Use:
Command:
Syntax:
Return Value:
None
Parameters:
<FileName>
Type:<String>
Filename and full path to the file to hold the named expression definition.
<NamedExpressions>
Type: Array<string, string,...>
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.
Example:
oModule.SaveNamedExpressions "C:\Ansoft\PersonalLib\smth.clc", Array("smoothedtemp"), true
21
Script Commands for Exporting Antenna Parameters and Max Field Parameters
DeleteFarFieldSetup
Use:
Command:
Delete command in the List dialog box. Click HFSS>List to access the List
dialog box.
Syntax:
DeleteFarFieldSetup <NameArray>
Return Value:
None
Parameters:
<NameArray>
Type: Array of strings.
An array of radiation setup names.
Example:
oModule.DeleteFarFieldSetup Array("Infinite Sphere1")
DeleteNearFieldSetup
Use:
Command:
Delete command in the List dialog box. Click HFSS>List to access the List
dialog box.
Syntax:
DeleteNearFieldSetup <NameArray>
Return Value:
None
Parameters:
<NameArray>
Type: Array of strings.
An array of radiation setup names.
Example:
oModule.DeleteNearFieldSetup Array("Line1", "Sphere1")
GetSetupNames
Use:
Gets the names of far field and near field radiation setups in a design.
Syntax:
GetSetupNames(<RadiationType>)
Return Value:
Parameters:
<RadiationType>
Type: <string>
For example: "Sphere"
Example:
Set setupnames = oModule.GetSetupNames("Infinite Sphere")
For Each setup in setupnames
Msgbox setup
Next
RenameSetup [Radiation]
Use:
Command:
Right-click a radiation setup in the project tree, and then click Rename on
the shortcut menu.
Syntax:
Return Value:
None
Parameters:
<OldName>
Type: <string>
<NewName>
Type: <string>
Example:
oModule.RenameSetup "Sphere1", "MyNearSphere"
EditFarFieldSphereSetup
Use:
Command:
Syntax:
EditFarFieldSphereSetup <InfSphereParams>
Return Value:
None
Example:
oModule.EditFarFieldSphereSetup Array("NAME:InfSphere",_
"UseCustomRadiationSurface:=", true, _
"CustomRadiationSurface:=", "FaceList1", _
"ThetaStart:=", "0deg", _
"ThetaStop:=", "180deg", _
"ThetaStep:=", "10deg", _
"PhiStart:=", "15deg", _
"PhiStop:=", "36deg", _
"PhiStep:=", "10deg", _
"UseLocalCS:=", false)
EditNearFieldLineSetup
Use:
Command:
Double-click the radiation setup in the project tree to modify its settings.
Syntax:
EditNearFieldLineSetup <LineParams>
Return Value:
None
Example:
oModule.EditNearFieldLineSetup Array("NAME:MyLine", _
"UseCustomRadiationSurface:=", false, _
"Line:=", "Polyline2", _
21-4 Radiation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"NumPts:=", "100")
EditNearFieldSphereSetup
Use:
Command:
Syntax:
EditNearFieldSphereSetup <SphereParams>
Return Value:
None
Example:
oModule.EditNearFieldSphereSetup Array("NAME:MySphere", _
"UseCustomRadiationSurface:=", true, _
"CustomRadiationSurface:=", "FaceList1", _
"Radius:=", "35mm", _
"ThetaStart:=", "0deg", "ThetaStop:=", "180deg", _
"ThetaStep:=", "10deg", "PhiStart:=", "15deg", _
"PhiStop:=", "36deg", "PhiStep:=", "10deg", _
"UseLocalCS:=", false)
Example:
Partial values can be specified, in which case default values will be used to
populate the rest of the fields:
oModule.EditNearFieldSphereSetup "NAME:MyInfSphere", _
Array("NAME:MySphere", _
"UseCustomRadiationSurface:=", true, _
"CustomRadiationSurface:=", "FaceList1", _
"Radius:=", "45mm")
This will cause default values to be used for the rest of the fields such as
ThetaStop, ThetaStart, ThetaStep, PhiStep, PhiStart, and
PhiStop;however, the value for the key CustomRadiationSurface has
to be specified if custom radiation surfaces are used.
InsertFarFieldSphereSetup
Use:
Command:
Syntax:
InsertFarFieldSphereSetup <InfSphereParams>
Return Value:
None
Parameters:
<InfSphereParams>
Radiation Module Script Commands 21-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
Array("NAME:<SetupName>",
"UseCustomRadiationSurface:=", <bool>,
"CustomRadiationSurface:=", <FaceListName>,
"ThetaStart:=", <value>,
"ThetaStop:=", <value>,
"ThetaStep:=", <value>,
"PhiStart:=", <value>,
"PhiStop:=", <value>,
"PhiStep:=", <value>,
"UseLocalCS:=", <bool>,
"CoordSystem:=", <CSName>)
UseCustomRadiationSurface
If true, provide CustomRadiationSurface parameter.
If false, radiation boundary/PML boundaries will be used as radiation surfaces.
UseLocalCS
If true, provide CoordSystem parameter.
If false, global coordinate system will be used.
Example:
oModule.InsertFarFieldSphereSetup
Array("NAME:InfiniteSphere1",_
"UseCustomRadiationSurface:=", false, _
"ThetaStart:=", "0deg",_
"ThetaStop:=", "180deg",_
"ThetaStep:=", "10deg",_
"PhiStart:=", "0deg",_
"PhiStop:=", "36deg",_
"PhiStep:=", "10deg",_
"UseLocalCS:=", true,_
"CoordSystem:=", "RelativeCS1")
InsertNearFieldLineSetup
Use:
Inserts a near-field line setup. Requires the presence of lines in the model.
Command:
Syntax:
InsertNearFieldLineSetup <LineParams>
Return Value:
None
Parameters:
<LineParams>
Array("NAME:<SetupName>",
"UseCustomRadiationSurface:=", <bool>,
"CustomRadiationSurface:=", <FaceListName>,
"Line:=", <PolyLineName>,
"NumPts:=", <int>)
<PolyLineName>
Type: String.
Name of the polyline as determined by name in the history tree.
UseCustomRadiationSurface
If true, provide CustomRadiationSurface parameter.
If false, radiation boundary/PML boundaries will be used as radiation surfaces.
Example:
oModule.InsertNearFieldLineSetup Array("NAME:MyLine", _
"UseCustomRadiationSurface:=", false, _
"Line:=", "Polyline1", _
"NumPts:=", "100")
InsertNearFieldSphereSetup
Use:
Command:
Syntax:
InsertNearFieldSphereSetup <SphereParams>
Return Value:
None
Parameters:
<SphereParams>
Array("NAME:<SetupName>",
"UseCustomRadiationSurface:=", <bool>,
"CustomRadiationSurface:=", <FaceListName>,
"Radius:=", <value>,
"ThetaStart:=", <value>,
"ThetaStop:=", <value>,
"ThetaStep:=", <value>,
Radiation Module Script Commands 21-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"PhiStart:=", <value>,
"PhiStop:=", <value>,
"PhiStep:=", <value>,
"UseLocalCS:=", <bool>,
"CoordSystem:=", <CSName>)
UseCustomRadiationSurface
If true, provide CustomRadiationSurface parameter.
If false, radiation boundary/PML boundaries will be used as radiation surfaces.
UseLocalCS
If true, provide CoordSystem parameter.
If false, global coordinate system will be used.
Example:
oModule.InsertNearFieldSphereSetup _
Array("NAME:MySphere", _
"UseCustomRadiationSurface:=", true, _
"CustomRadiationSurface:=", "FaceList1", _
"ThetaStart:=", "0deg", "ThetaStop:=", "180deg", _
"ThetaStep:=", "10deg", "PhiStart:=", "0deg", _
"PhiStop:=", "360deg", "PhiStep:=", "10deg", _
"UseLocalCS:=", true, _
"CoordSystem:=", "FaceCS1")
EditAntennaArraySetup
Use:
Modifies the antenna array setup. There are 3 choices in the setup. The
default is set to No Array Setup. There are two (other) kinds of arrays that
the user can set: Regular Array Setup and Custom Array Setup.
Command:
Syntax:
EditAntennaArraySetup <AntennaArrayParams>
Return Value:
None
Parameters:
<AntennaArrayParams>
Array("NAME:ArraySetupInfo",
"UseOption:=", <ArrayOption>,
<RegularArrayParams>,
<CustomArrayParams>)
<ArrayOption>
Type: <string>
Can be one of three strings: "NoArray", or "RegularArray",
"CustomArray".
If "RegularArray" is specified, then <RegularArrayParams> must
be specified. If "CustomArray" is specified, <CustomArrayParams>
must be specified. You can also supply both the custom and regular
array specifications and switch between them by setting this flag to the
option you want to use.
<RegularArrayParams>
Array("NAME:RegularArray",
"NumUCells:=", <value>,
"NumVCells:=", <value>,
"CellUDist:=", <value>,
"CellVDist:=", <value>,
"UDirnX:=", <value>,
"UDirnY:=", <value>,
"UDirnZ:=", <value>,
"VDirnX:=", <value>,
"VDirnY:=", <value>,
"VDirnZ:=", <value>,
"FirstCellPosX:=", <value>,
"FirstCellPosY:=", <value>,
"FirstCellPosZ:=", <value>,
"UseScanAngle:=", <bool>,
"ScanAnglePhi:=", <value>,
"ScanAngleTheta:=", <value>,
"UDirnPhaseShift:=", <value>,
"VDirnPhaseShift:=", <value>)
UseScanAngle
If true, the values of the ScanAnglePhi and ScanAngleTheta
parameters will be used and need to be specified.
If false, the values of the UDirnPhaseShift and VDirnPhaseShift
parameters will be used and must be specified.
<CustomArrayParams>
Array("NAME:CustomArray",
"NumCells:=", <int>,
<CellsParamsArray
<CellsParamsArray>
Array("NAME:Cell",
<CellParams>, <CellParams>, ...)
<CellParams>
Array("Name:<CellName>",
"XCoord:=", <double>,
"YCoord:=", <double>,
"ZCoord:=", <double>,
"Amplitude:=", <double>,
"Phase:=", <double>)
The <double> values above should be in SI units.
<CellName>
Type: <string>
Format is: "Cell_n"
Replace n with the index number of the cell, for example: "Cell_1"
Example:
Example:
Array("NAME:RegularArray", _
"NumUCells:=", "10", "NumVCells:=", "10",_
"CellUDist:=", "10mm", "CellVDist:=", "10mm", _
"UDirnX:=", "1", "UDirnY:=", "0", "UDirnZ:=", _
"0", _
"VDirnX:=", "0", "VDirnY:=", "1", "VDirnZ:=",_
"0", _
"FirstCellPosX:=", "0mm", _
"FirstCellPosY:=", "0mm", _
"FirstCellPosZ:=", "0mm",
"UseScanAngle:=", true, _
"ScanAnglePhi:=","45deg", _
"ScanAngleTheta:=", "45deg"))
Example:
ExportRadiationParametersToFile
Use:
Command:
Syntax:
ExportRadiationParametersToFile <ExportToFileParams>
Return Value:
None
Parameters:
<ExportToFileParams>
Array("ExportFileName:=", <FilePath>
"SetupName:=", <SetupName>
"IntrinsicVariationKey:=", <string>,
"DesignVariationKey:=", <string>,
"SolutionName:=", <string>)
<FilePath>
Type: String.
Specifies the file to export to, for example: "C:\projects\exportantparams.txt".
IntrinsicVariationKey
Specifies the frequency at which to extract the parameters. Example:
"Freq='10GHz'"
DesignVariationKey
Specifies the design variations at which to extract the parameters. Example:
"width=5mm"
Example:
oModule.ExportRadiationParametersToFile _
Array("ExportFileName:=", _
"C:\projects\exportantparams.txt",_
"SetupName:=", "Infinite Sphere1", _
"IntrinsicVariationKey:=", "Freq='10GHz'", _
"DesignVariationKey:=", "",
21-12 Radiation Module Script Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"SolutionName:=", "LastAdaptive")
22
CreateUserDefinedSolution
Use:
Command:
Create User Defined Solution popup menu is available in the Result folder
context menu when applicable.
Syntax:
CreateUserDefinedSolution <SolutionName>,
<PluginFileLocation>, <PluginFileRelativePathName>,
<PropertyValuesArray>, <ProbeSelectionArray>,
<DynamicProbesArray>
Return Value:
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.
Parameters:
<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:
Type: Array of strings representing how a single probe is defined by a 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 dynamicprobes.
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
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
DeleteUserDefinedSolutions
Use:
Command:
Syntax:
DeleteUserDefinedSolutions <UserDefinedSolutionNames>
Return Value:
None
Parameters:
<UserDefinedSolutionNames>
Type: Array of strings
Name of User Defined Solutions to be deleted.
Example:
Example:
EditUserDefinedSolution
Use:
Command:
Syntax:
Return Value:
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.
Parameters:
<ExistingSolutionName>
Type: String
Name of the existing user defined solution
<NewSolutionName>
22-4 User Defined Solutions Commands
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
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",
23
NdExplorer Script
Commands
The definition manager controls the use of NdExplorer for HFSS scripts.
Set oProject = oDesktop.SetActiveProject("Project1")
Set oDefinitionManager = oProject.GetDefinitionManager()
The topics for this section include:
NdExplorer Manager Script Commands
ExportFullWaveSpice [NdExplorer]
NdeExportFullWaveSpice
Use:
Command:
Syntax:
ExportFullWaveSpice
"DesignName", // Design name. Can be left blank, if loading solution from a file.
true/false,
"Name",
// If loading from design this is the solution name, else this is the
// full path of the file from which the solution is loaded
NdExplorer Script Commands -1
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"variation",
"EnforceCausality:=", false,
// Fitting error
"MaxPoles:=", 400,
// Maximum Order
"TouchstoneFormat:=", "MA",
"TouchstoneUnits:=", "Hz",
"MHz"
"TouchStonePrecision:=", 8,
// Touchstone precision
"ExportDirectory:=", "C:/Examples/LNA/",
// Directory to export to
ExportNetworkData [NdExplorer]
NdeExportNetworkData
Use:
Command:
Syntax:
ExportNetworkData
"DesignName", // Design name. Can be left blank, if loading solution from a file.
true/false,
"Name",
// If loading from design this is the solution name, else this is the
"DataTypes:=", Array("S"),
"DisplayFormat:=", "MA",
"FileType:=", "",
"Renormalize:=", false,
// Renormalize true/false
"RefImpedance:=",50,
// Reference Impedance
"Precision:=", 8,
ExportNMFData [NdExplorer]
NdeExportNMFData
Use:
Command:
Syntax:
ExportNMFData
"DesignName", // Design name. Can be left blank, if loading solution from a file.
true/false,
"Name",
// If loading from design this is the solution name, else this is the
// full path of the file from which the solution is loaded
"ExportFile",
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
"FileType:=", "",
"Renormalize:=", false,
// Renormalize true/false
"RefImpedance:=",50,
// Reference Impedance
"Precision:=", 8,
Array("NAME: DependentVars")
empty
"MatrixSize:=", 2,
23
Example Scripts
= CreateObject("AnsoftHfss.HfssScriptInterface")
Case "mm"
Case "um"
Case "in"
Case "mil"
Case Else
MsgBox("Invalid Units - defaults to m")
Units = ""
End Select
Redim points(NumPoints+1)
Redim segments(NumPoints)
points(0) = "NAME:PolylinePoints"
segments(0) = "NAME:PolylineSegments"
Build the Point and Segment Arrays needed in the HFSS polyline call.
For n = 1 To (NumPoints+1)
Example Scripts 23-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
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)
If n<=NumPoints Then
segments(n) = Array("NAME:PLSegment", "SegmentType:=", _
"Line", "StartIndex:=", (n-1), "NoOfPoints:=", 2)
End If
Next
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)
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
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
oEditor.SweepAlongPath _
Array("NAME:Selections", "Selections:=", _
"Circle_Helix,Line_Helix"),
Array("NAME:PathSweepParameters", "DraftAngle:=", "0deg", _
"DraftType:=", "Round", "TwistAngle:=", "0deg")
= CreateObject("AnsoftHfss.HfssScriptInterface")
oProject.GetActiveDesign()
Dim oFS,ofile,x,y,z,path,range,
Dim arr2,del_f,freq,cfreq,val,temp,stn,stw,i,line
If the user clicks Cancel, the path will be blank, in which case the script should just exit.
If path <>"" then
Create the file, open it for data entry, and output the column labels.
Input the needed freq, solution, and sweep data and clean it up.
Get the values of the output variables for the desired freq.
val
= oDesign.GetOutputVariableValue("re_S","Setup" & _
= oDesign.GetOutputVariableValue("im_S","Setup" & _
Create the line of text to send to the file and write it to the file.
oDesign.DeleteOutputVariable "re_S"
oDesign.DeleteOutputVariable "im_S"
ofile.close
End if
Index
Numbers
3D Modeler editor commands
AssignMaterial 11-28
Chamfer 11-29
ChangeProperty 11-58
Connect 11-29
Copy 11-21
CoverLines 11-29
CoverSurfaces 11-30
CreateBondwire 11-3
CreateBox 11-4
CreateCircle 11-5
CreateCone 11-5
CreateCutplane 11-6
CreateCylinder 11-6
CreateEllipse 11-7
CreateEntityList 11-30
CreateEquationCurve 11-7
CreateEquationSurface 118
CreateFaceCS 11-30, 11-32
CreateHelix 11-9
CreateObjectFromdges 11-34
CreateObjectFromFaces 1135
CreatePoint 11-10
CreatePolyline 11-10
CreateRectangle 11-12
CreateRegion 11-13
CreateRegularPolygon 11-15
CreateRegularPolyhedron
11-15
CreateRelativeCS 11-36
CreateSphere 11-16
CreateSpiral 11-16
CreateTorus 11-17
Delete 11-59
DeleteLastOperation 11-36
DeletePolylinePoint 11-22
DetachFaces 11-37
DuplicateAlongLine 11-22
DuplicateAroundAxi 11-23
DuplicateMirror 11-24
EditEntityList 11-37
EditFaceCS 11-38
EditObjectCS 11-38
EditPolyline 11-18
EditRelativeCS 11-40
Export 11-40
ExportModelImagetoFile
11-41
Fillet 11-42
GenerateHistory 11-43
GetBodyNamesByPosition
Index-1
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
11-59
GetEdgeByPosition 11-60
GetEdgeIDsfromFace 11-60
GetEdgeIDsfromObject 11-61
GetFaceArea 11-61
GetFaceByPosition 11-61
GetFaceCenter 11-61
GetFaceIDs 11-62
GetModelBoundingBox 11-62
Import 11-45
ImportDXF 11-46
ImportGDSII 11-47
InsertPolylineSegment 11-18
Intersect 11-49
Mirror 11-25
Move 11-25
MoveCSToEnd 11-49
MoveFaces 11-50
OffsetFaces 11-26
PageSetup 11-67
ProjectSheet 11-51
RenamePart 11-67
Rotate 11-26
Scale 11-27
Section 11-52
SeparateBody 11-52
SetModelUnits 11-53
SetWCS 11-53
Split 11-54
Subtract 11-54
SweepAlongPath 11-19
SweepAlongVector 11-20
SweepAroundAxis 11-21
SweepFacesAlongNormal 11-55
ThickenSheet 11-56
UncoverFaces 11-56
Unite 11-57
A
AddCartesianXMarker 13-3
AddDataset 8-2
AddDeltaMarker 13-3
AddMarker 13-4
AddMaterial 6-2, 6-3
AddNamedExpr 20-3
AddNamedExpression 20-3
AddNote 13-4
AddTraces 13-5, 13-7
Analysis module commands
Analyze 9-3
DeleteDrivenSweep 16-2
DeleteSetups 16-2
EditFrequencySweep 16-2, 16-4
EditSetup 16-3
GetSetupCount 16-4
GetSetups 16-5
GetSweepCount 16-5
GetSweeps 16-5
InsertFrequencySweep 16-6, 16-15
InsertSetup 16-8
InsertSetup HFSS-IE 16-12
InsertSetup Transient 16-13
RenameDrivenSweep 16-18
RenameSetup 16-18
RevertAllToInitial 16-19
RevertSetupToInitial 16-19
Analyze
Analysis module command 9-3
AnalyzeDistributed 9-4
Ansoft Application Object commands 3-1
Ansoft Application object commands
GetAppDesktop 3-2
SetDesiredRamMBLimit 3-5
ApplyMeshOps 9-3
arithmetic operators 1-5
array variables 1-4
AssignAperature 14-46
AssignArray 10-2
AssignCurrent 14-12
AssignDCThickness 9-4
AssignFiniteCond 14-13, 14-46
AssignFloquet 14-14
AssignIERegion 14-17
AssignImpedance 14-17, 14-47
Index-2
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
AssignIncidentWave 14-18
AssignLayeredImp 14-19
AssignLengthOp 15-4
AssignLumpedPort 14-21
AssignLumpedRLC 14-23
AssignMagneticBias 14-23
AssignMaster 14-24
AssignMaterial 11-28
AssignModelResolutionOp 15-5
AssignPerfectE 14-25
AssignPerfectH 14-25
AssignRadiation 14-26
AssignScreeningImpedance 14-27
AssignSkinDepthOp 15-5
AssignSlave 14-30
AssignSymmetry 14-31
AssignTerminal 14-31
AssignTrueSurfOp 15-6
AssignVoltage 14-32
AssignWavePort 14-32
AutoIdentifyPorts 14-3
AutoIdentifyTerminals 14-4
B
Boundary/Excitation module commands
AssignAperature 14-46
AssignCurrent 14-12
AssignFiniteCond 14-13, 14-46
AssignFloquet 14-14
AssignIERegion 14-17
AssignImpedance 14-17, 14-47
AssignIncidentWave 14-18
AssignLayeredImp 14-19
AssignLumpedPort 14-21
AssignLumpedRLC 14-23
AssignMagneticBias 14-23
AssignMaster 14-24
AssignPerfectE 14-25
AssignPerfectH 14-25
AssignRadiation 14-26
AssignScreeningImpedance 14-27
AssignSlave 14-30
AssignSymmetry 14-31
AssignTerminal 14-31
AssignVoltage 14-32
AssignWavePort 14-32
AutoIdentifyPorts 14-3
AutoIdentifyTerminals 14-4
ChangeImpedanceMult 14-4
CreatePML 14-49
DeleteAllBoundaries 14-4
DeleteAllExcitations 14-5
DeleteBoundaries 14-5
EditCurrent 14-35
EditFiniteCond 14-36
EditImpedance 14-37
EditIncidentWave 14-38
EditLayeredImpedance 14-39
EditLumpedPort 14-40
EditLumpedRLC 14-41
EditMagneticBias 14-41
EditMaster 14-39
EditPerfectE 14-39
EditPerfectH 14-39
EditRadiation 14-41
EditSlave 14-42
EditSymmetry 14-42
EditTerminal 14-43
EditVoltage 14-43
EditWavePort 14-43
GetBoundaries 14-5
GetBoundariesofType 14-6
GetBoundaryAssignment 14-5
GetDefaultBaseName 14-6
GetExcitations 14-6
GetExcitationsOfType 14-7
GetNumBoundaries 14-7
GetNumBoundariesofType 14-7
GetNumExcitations 14-7
GetNumExcitationsOfType 14-8
GetPortExcitationsCounts 14-8
ModifyPMLGroup 14-51
PMLGroupCreated 14-51
PMLGroupModified 14-52
Index-3
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
ReassignBoundaries 14-8
RecalculatePMLMaterials 14-52
RenameBoundary 14-9
ReprioritizeBoundary 14-9
SetDefaultBaseName 14-9
SetTerminalReferenceImpedances 1444
UnassignIERegions 14-44
C
CalcOp 20-3
CalcStack 20-4
CalculatorRead 20-4
CalculatorWrite 20-5
Chamfer 11-29
ChangeGeomSettings 20-5
ChangeImpedanceMult 14-4
ChangeProperty 7-4, 11-58
ClcEval 20-5
ClcMaterial 20-6
ClearAllMarkers 13-7
ClearAllNamedExpr 20-6
Close 5-2
CloseAllWindows 4-3
CloseProject 4-3
CloseProjectNoForce 4-3
comment lines 1-2
comparison operators 1-5
conditional statements
If...Then... Else 1-6
Select Case 1-6
types of 1-6
Connect 11-29
ConstructVariationString 9-5
conventions
command syntax 2-8
data types 2-8
script command 2-8
converting data types 1-7
Copy 11-21
CopyDesign 5-2
CopyNamedExprToStack 20-6
CopyReportData 13-8
CopyReportDefinition 13-8
copyright notices 1-9
CopySetup
Optimetrics module command 17-5
CopyTracesDefinitions 13-8
Count 4-4
CoverLines 11-29
CoverSurfaces 11-30
CreateBondwire 11-3
CreateBox 11-4
CreateCircle 11-5
CreateCone 11-5
CreateCutplane 11-6
CreateCylinder 11-6
CreateEllipse 11-7
CreateEntityList 11-30
CreateEquationCurve 11-7
CreateEquationSurface 11-8
CreateFaceCS 11-30, 11-32
CreateFieldPlot 19-2
CreateHelix 11-9
CreateObjectFromEdges 11-34
CreateObjectFromFaces 11-35
CreateOutputVariable 12-2
CreatePML 14-49
CreatePoint 11-10
CreatePolyline 11-10
CreateRectangle 11-12
CreateRegion 11-13
CreateRegularPolygon 11-15
CreateRegularPolyhedron 11-15
CreateRelativeCS 11-36
CreateReport 13-9
CreateReportFromTemplate 13-12
CreateSphere 11-16
CreateSpiral 11-16
CreateTorus 11-17
CreateUserDefinedSolution 22-2
CutDesign 5-2
Index-4
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
D
dataset commands
AddDataset 8-2
DeleteDataset 8-2
EditDataset 8-3
ImportDataset 8-3
Delete 11-59
DeleteAllBoundaries 14-4
DeleteAllExcitations 14-5
DeleteAllReports 13-12
DeleteArray 10-3
DeleteBoundaries 14-5
DeleteDataset 8-2
DeleteDesign 5-2
DeleteDrivenSweep 16-2
DeleteFarFieldSetup 21-2
DeleteFieldPlot 19-6
DeleteFullVariation 18-5
DeleteImportData 18-2
DeleteLastOperation 11-36
DeleteLinkedDataVariation 9-6
DeleteNamedExpr 20-7
DeleteNearFieldSetup 21-2
DeleteOp 15-2
DeleteOutputVariable 12-2
DeletePolylinePoint 11-22
DeleteReport 13-12
DeleteSetups
Analysis module command 16-2
Optimetrics module command 17-5
DeleteSolutionVariation 18-6
Deletetraces 13-13
DeleteUserDefinedSolution 22-4
DeleteVariation 18-7
Design object commands
13-16
AddCartesianXMarker 13-3
AddDeltaMarker 13-3
AddMarker 13-4
AddNote 13-4
AddTraces 13-5, 13-7
AnalyzeDistributed 9-4
ApplyMeshOps 9-3
AssignDCThickness 9-4
CalculatorRead 20-4, 20-5
ClearAllMarkers 13-7
CloseAllWindows 4-3
CopyReportData 13-8
CopyReportDefinition 13-8
CopyTracesData 13-8
CreateOutputVariable 12-2
CreateReport 13-9
CreateReportFromTemplate 13-12
DeleteAllReports 13-12
DeleteOutputVariable 12-2
DeleteReport 13-12
DeleteTraces 13-13
EditOutputVariable 12-3
ExportConvergence 9-6
ExportMeshStats 9-7
ExportPlotImageToFile 13-13
ExportProfile 9-7
ExportToFile 13-15
FFTOnReport 13-15
GetDesiredRamMBLimit 3-2
GetDisplayType 13-17
GetEditSourcesCount 9-8
GetHPCLicenseType 3-2
GetLibraryDirectory 4-6
GetMatchedObjectName 11-64
GetMaximumRamMBLimit 3-3
GetModelUnits 11-64
GetModule 9-9
GetMPIVendor 3-3
GetName 9-9
GetNominalVariation 9-9
GetNumberOfProcessors 3-4
GetNumObjects 11-65
GetObjectIDByName 11-63
GetObjectName 11-63, 11-64
GetObjectsInGroup 11-63
GetOutputVariables 12-4
GetOutputVariableValue 12-4
GetProjectDirectory 4-7
Index-5
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
GetSelections 11-65
GetSolutionType 9-10
GetSolveInsideThreshold 9-10
GetSourceContexts 9-10
GetTempDirectory 4-7
GetUseHPCforMP 3-4
GetUser Position 11-65
GetVariationVariableValue 9-10
GetVersion 4-7
GetVertexIDsFromEdge 11-66
GetVertexIDsFromFace 11-66
GetVertexIDsFromObject 11-67
ImportIntoReport 13-18
PasteReports 13-18
PasteTraces 13-19
Redo 9-11
RenameDesignInstance 9-11
RenameReport 13-19
RenameTraces 13-19
RunToolkit 9-14
SARSetup 9-11
SetActiveEditor 9-12
SetDesignSettings 9-12
SetHPCLicenseType 3-5
SetLibraryDirectory 4-12
SetMaximumRamMBLimit 3-6
SetMPIVendor 3-6
SetNumberOfProcessors 3-7
SetProjectDirectoryVBCommand> 4-12
SetSolutionType 9-13
SetSolveInsideThreshold 9-13
SetSourceContexts 9-14
SetTempDirectory 4-12
SetUseHPCforMP 3-7
ShowWindow 11-54
Solve 9-14, 9-16
UpdateAllReports 13-20
UpdateReports 13-20
UpdateTraces 13-21
UpdateTracesContextandSweeps 13-23
Desktop object commands
CloseProject 4-3
CloseProjectNoForce 4-3
Count 4-4
EnableAutosave 4-4
GetActiveProject 4-5
GetAutosaveEnabled 4-5
GetDesigns 4-5
GetDistributedAnalysisMachines 4-6
GetName 4-6
GetProjectList 4-7
GetProjects 4-6
NewProject 4-8
OpenMultipleProjects 4-8
OpenProject 4-8
PauseScript 4-9
Print 4-9
QuitApplication 4-9
RestoreWindow 4-9
RunProgram 4-10
RunScript 4-10
SetActiveProject 4-11
SetActiveProjectByPath 4-11
Sleep 4-13
DetachFaces 11-37
DistributedAnalyzeSetup
Optimetrics module command 17-6
DuplicateAlongLine 11-22
DuplicateAroundAxis 11-23
DuplicateMirror 11-24
E
EditAntennaArraySetup 21-8
EditArray 10-4
EditCurrent 14-35
EditDataset 8-3
EditEntityList 11-37
EditFaceCS 11-38
EditFarFieldSphereSetup 21-4
EditFiniteCond 14-36
EditFrequencySweep 16-2, 16-4
EditImpedance 14-37
EditIncidentWave 14-38
EditLayeredImpedance 14-39
Index-6
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
EditLengthOp 15-7
EditLumpedPort 14-40
EditLumpedRLC 14-41
EditMagneticBias 14-41
EditMaster 14-39
EditMaterial 6-4
EditModelResolutionOp 15-7
EditNearFieldLineSetup 21-4
EditNearFieldSphereSetup 21-5
EditObjectCS 11-38
EditOutputVariable 12-3
EditPerfectE 14-39
EditPerfectH 14-39
EditPolyline 11-18
EditRadiation 14-41
EditRelativeCS 11-40
EditSetup
Analysis module command 16-3
optimization command 17-15
parametric command 17-11
sensitivity command 17-19
statistical command 17-21
EditSkinOp 15-8
EditSlave 14-42
EditSources 18-2
EditSymmetry 14-42
EditTerminal 14-43
EditTrueSurfOp 15-8
EditUserDefinedSolution 22-4
EditVoltage 14-43
EditWavePort 14-43
EnableAutoSave 4-4
EnterComplex 20-7
EnterComplexVector 20-7
EnterLine 20-8
EnterPoint 20-8
EnterQty 20-9
EnterScalar 20-9
EnterScalarFunc 20-9
EnterSurf 20-10
EnterVector 20-10
EnterVectorFunc 20-10
EnterVol 20-11
Export 11-40
ExportConvergence 9-6
ExportDXConfigFile
Optimetrics module command 17-6
ExportEignemodes 18-9
ExportForHSpice 18-10
ExportForSpice 18-8
ExportFullWaveSpice 23-1
ExportMaterial 6-4
ExportMesh Stats 9-7
ExportModelImagetoFile 11-41
ExportNetworkData 23-2
ExportNetworkData 18-11
ExportNMFData 23-3
ExportNMFData 18-13
ExportOnGrid 20-11
ExportOptimetricsProfile
Optimetrics module command 17-6
ExportOptimetricsResults
Optimetrics module command 17-7
ExportParametricResults
Optimetrics module command 17-7
ExportPlotImageToFile 13-13
ExportProfile 9-7
ExportRadiationParametersToFile 21-12
ExportToFile 13-15, 20-12
F
FFTONReport 13-15
Field Overlay module commands
GetFieldPlotNames 19-6
Field Overlays module commands
AddNamedExpr 20-3
AddNamedExpression 20-3
CalcOp 20-3
CalcStack 20-4
ChangeGeomSettings 20-5
ClcEval 20-5
ClcMaterial 20-6
ClearAllNamedExpr 20-6
CopyNamedExprToStack 20-6
Index-7
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
CreateFieldPlot 19-2
DeleteFieldPlot 19-6
DeleteNamedExpr 20-7
EnterComplex 20-7
EnterComplexVector 20-7
EnterLine 20-8
EnterPoint 20-8
EnterQty 20-9
EnterScalar 20-9
EnterScalarFunc 20-9
EnterSurf 20-10
EnterVector 20-10
EnterVectorFunc 20-10
EnteVol 20-11
ExportOnGrid 20-11
ExportToFile 20-12
ModifyFieldPlot 19-7
RenameFieldPlot 19-8
RenamePlotFolder 19-9
SetFieldPlotSettings 19-9
SetPlotFolderSettings 19-10
Fields Calculator commands
AddNamedExpr 20-3, 20-6
CalcOp 20-3
CalcStack 20-4
ChangeGeomSettings 20-5
ClcEval 20-5
ClcMaterial 20-6
CopyNamedExprToStack 20-6
DeleteNamedExpr 20-7
EnterComplex 20-7
EnterComplexVector 20-7
EnterLine 20-8
EnterPoint 20-8
EnterQty 20-9
EnterScalar 20-9
EnterScalarFunc 20-9
EnterSurf 20-10
EnterVector 20-10
EnterVectorFunc 20-10
EnterVol 20-11
ExportOnGrid 20-11
ExportToFile 20-12
Fillet 11-42
For...Next loop 1-7
G
GenerateHistory 11-43
GenerateVariationData Parametric
parametric command 17-11
GetActiveDesign 5-3
GetActiveProject 4-5
GetAdaptiveFrq 18-14
GetAllReportNames 13-16
GetArrayVariables 7-10
GetAutoSaveEnabled 4-5
GetBodyNamesByPosition 11-59
GetBoundaries 14-5
GetBoundariesOfType 14-6
GetBoundaryAssignment 14-5
GetDefaultBaseName 14-6
GetDesign 5-3
GetDesigns 4-5
GetDesiredRamMBLimit 3-2
GetDisplayType 13-17
GetDistributedAnalysisMachines 4-6
GetEdgeByPosition 11-60
GetEdgeIDsFromFace 11-60
GetEdgeIDsFromObject 11-61
GetEditSourcesCount 9-8
GetExcitations 14-6
GetExcitationsOfType 14-7
GetFaceArea 11-61
GetFaceByPosition 11-61
GetFaceCenter 11-61
GetFaceIDs 11-62
GetFieldPlotNames
Field Overlay module command 19-6
GetHPCLicenseType 3-2
GetLibraryDirectory 4-6
GetMatchedObjectName 11-64
GetMaximumRamMBLimit 3-3
GetModelBoundingBox 11-62
GetModelUnits 11-64
Index-8
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
GetModule 9-9
GetMPVendor 3-3
GetName 4-6, 5-3, 9-9
GetNominalVariation 9-9
GetNumberOfProcessors 3-4
GetNumBoundaries 14-7
GetNumBoundariesOfType 14-7
GetNumExcitations 14-7
GetNumExcitationsOfType 14-8
GetNumObjects 11-65
GetObjectIDByName 11-63
GetObjectName 11-63, 11-64
GetObjectsIngroup 11-63
GetOperationNames
Mesh Operations module command 15-2
GetOutputVariable 12-4
GetOutputVariableValue 12-4
GetPath 5-3
GetPortExcitationsCounts 14-8
GetProjectDirectory 4-7
GetProjectList 4-7
GetProjects 4-6
GetProperties 7-9
GetPropertyValue 7-10
GetSelections 11-65
GetSetupCount
Analysis module command 16-4
GetSetupNames 21-2
GetSetupNames (Optimetrics)
Optimetrics module command 17-8
GetSetupNamesByType (Optimetrics)
Optimetrics module command 17-8
GetSetups
Analysis module command 16-5
GetSolutionType 9-10
GetSolutionVesrionID 18-14
GetSolveInsideThreshold 9-10
GetSolveRangeInfo 18-14
GetSourceContexts 9-10
GetSweepCount
Analysis module command 16-5
GetSweeps
Analysis module command 16-5
GetTempDirectory 4-7
GetTopDesignList 5-4
GetTopEntryValue 20-13
GetUseHPCforMP 3-4
GetUserPosition 11-65
GetValidISolutionList 18-15
GetVariables 7-10
GetVariableValue 7-11
GetVariationVariableValue 9-10
GetVersion 4-7
GetVertexIDsFromEdge 11-66
GetVertexIDsFromFace 11-66
GetVertexIDsFromObject 11-67
H
HasFields 18-15
AssignLumpedPort 14-48
Boundary/Excitation module commands
AssignLumpedPort 14-48
Analysis module commands
RenameSweep 16-19
RenameSweep 16-19
hierarchy of variables in HFSS 2-2
I
If...Then... Else statement 1-6
Import 11-45
ImportDataset 8-3
ImportDXF 11-46
ImportGDSII 11-47
ImportINtoReport 13-18
ImportSetup
Optimetrics module command 17-9
ImportSolution 18-16
ImportTable 18-17
InputBox function 1-7
InsertDesign 5-4
InsertFarFieldSphereSetup 21-5
InsertFrequencySweep 16-6, 16-15
InsertNearFieldLineSetup 21-6
Index-9
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
InsertNearFieldSphereSetup 21-7
InsertPolylineSegment 11-18
InsertSetup
Analysis module command 16-8
optimization command 17-15
parametric command 17-11
sensitivity command 17-19
statistical command 17-23
InsertSetup HFSS-IE
Analysis module command 16-12
InsertSetup Transient
Analysis module command 16-13
Intersect 11-49
IsFieldAvailableAt 18-18
J
JavaScript, script format 1-1
K
keywords, VBScript 1-2
L
ListMatchingVariations 18-19
ListValuesOfVariable 18-19
ListVariations 18-20
logical operators 1-6
M
material commands
AddMaterial 6-2, 6-3
EditMaterial 6-4
ExportMaterial 6-4
RemoveMaterial 6-4
Mesh Operations module commands
AssignLengthOp 15-4
AssignModelResolutionOp 15-5
AssignSkinDepthOp 15-5
AssignTrueSurfOp 15-6
DeleteOp 15-2
EditLengthOp 15-7
EditModelResolutionOp 15-7
EditSkinOp 15-8
EditTrueSurfOp 15-8
GetOperationNames 15-2
RenameOp 15-2
Microsoft
VBScript users guide 1-8
Visual Basic 1-1
Mirror 11-25
Model Setup commands
AssignArray 10-2
DeleteArray 10-3
EditArray 10-4
ModifyFieldPlot 19-7
modifying a script 2-7
ModifyPMLGroup 14-51
ModuleHasMatrixData 18-15
ModuleHasMesh 18-16
modules in HFSS scripting 2-4
Move 11-25
MoveCSToEnd 11-49
MoveFaces 11-50
MsgBox function 1-8
N
ndExplorer Manager Script Commands 23-1
NewProject 4-8
O
oAnsoftApp object 2-3
oDesign object 2-3
oDesktop object 2-3
oEditor object 2-4
OffsetFaces 11-26
oModule object 2-4
OpenMultipleProjects 4-8
OpenProject 4-8
operators
Index-10
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
arithmetic 1-5
categories in VBScript 1-4
comparison 1-5
logical 1-6
precedence of 1-5
oProject object 2-3
Optimetrics module commands
DeleteSetups 17-5
DistributeAnalyzeSetup 17-6
ExportDXConfigFile 17-6
ExportOptimetricsProfile 17-6
ExportOptimetricsResults 17-7
ExportParametricResults 17-7
GetSetupNames 17-8
GetSetupNamesByType 17-8
ImportSetup 17-9
RenameSetup 17-9
SolveSetup 17-5, 17-10
optimization commands
EditSetup 17-15
InsertSetup 17-15
output variable commands
CreateOutputVariable 12-2
DeleteOutputVariable 12-2
EditOutputVariable 12-3
GetOutputVariables 12-4
GetOutputVariableValue 12-4
P
PageSetup 11-67
parametric commands
EditSetup 17-11
GenerateVariationData
17-11
InsertSetup 17-11
Paste 5-4
PasteReports 13-18
PasteTraces 13-19
PauseScript 4-9
pausing a script 2-7
PMLGroupCreated 14-51
Parametric
PMLGroupModified 14-52
Print 4-9
Project object commands
AddDataset 8-2
AddMaterial 6-2, 6-3
ChangeProperty 7-4
Close 5-2
CopyDesign 5-2
CutDesign 5-2
DeleteDataset 8-2
DeleteDesign 5-2
EditDataset 8-3
EditMaterial 6-4
ExportMaterial 6-4
GetActiveDesign 5-3
GetArrayVariables 7-10
GetDesign 5-3
GetName 5-3
GetPath 5-3
GetProperties 7-9
GetPropertyValue 7-10
GetTopDesignList 5-4
GetTopEntryValue 20-13
GetVariables 7-10
GetVariableValue 7-11
InsertDesign 5-4
Paste 5-4
Redo 5-5
RemoveMaterial 6-4
Save 5-5
SaveAs 5-5
SetActiveDesign 5-6
SetPropertyValue 7-11
SetVariableValue 7-12
SimulateAll 5-6
Undo 5-6
ProjectSheet 11-51
property commands
ChangeProperty 7-4
GetArrayVariables 7-10
GetProperties 7-9
GetPropertyValue 7-10
GetTopEntryValue 20-13
Index-11
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
GetVariables 7-10
GetVariableValue 7-11
SetPropertyValue 7-11
SetVariableValue 7-12
Q
QuitApplication 4-9
R
Radiation module commands
DeleteFarFieldSetup 21-2
DeleteNearFieldSetup 21-2
EditAntennaArraySetup 21-8
EditFarFieldSphereSetup 21-4
EditNearFieldSphereSetup 21-5
EditNearLineSetup 21-4
ExportRadiationParametersToFile
21-12
GetSetupNames 21-2
InsertFarFieldSphereSetup 21-5
InsertNearFieldLineSetup 21-6
InsertNearFieldSphereSetup 21-7
RenameSetup 21-3
ReassignBoundaries 14-8
RecalculatePMLMaterials 14-52
recording a script 2-6
Redo
design-level command 9-11
project-level command 5-5
references, for VBScript 1-8
RemoveMaterial 6-4
RenameBoundary 14-9
RenameDesignInstance 9-11
RenameDrivenSweep 16-18
RenameFieldPlot 19-8
RenameOp 15-2
RenamePart 11-67
RenamePlotFolder 19-9
RenameReport 13-19
RenameSetup
Index-12
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
S
sample scripts
data export 24-6
simple HFSS 1-2
variable helix 24-2
SARSetup 9-11
Save 5-5
SaveAs 5-5
Scale 11-27
scripts
in JavaScript format 1-1
modifying for easier playback 2-7
pausing 2-7
recording 2-6
resuming 2-7
running 2-6
running from command prompt 1-1
stop recording 2-6
stopping execution of 2-7
Section 11-52
Select Case statement 1-6
sensitivity commands
EditSetup 17-19
InsertSetup 17-19
SeparateBody 11-52
SetActiveDesign 5-6
SetActiveEditor 9-12
SetActiveProject 4-11
SetActiveProjectByPath 4-11
SetDefaultBaseName 14-9
SetDesignSettings 9-12
SetDesiredRamMBLimit 3-5
SetFieldPlotSettings 19-9
SetHPCLicenseType 3-5
SetLibraryDirectory 4-12
SetMaximumRAMMBLimit 3-6
SetModelUnits 11-53
SetMPVendor 3-6
SetNumberOfProcessors 3-7
SetPlotFolderSettings 19-10
SetProjectDirectory 4-12
SetPropertyValue 7-11
SetSolutionType 9-13
SetSolveInsideThreshold 9-13
SetSourceContexts 9-14
SetTempDirectory 4-12
SetTerminalReferenceImpedances 14-44
SetUseHPCforMP 3-7
SetVariableValue 7-12
SetWCS 11-53
SGetAppDesktop 3-2
ShowlWindow 11-54
SimulateAll 5-6
Sleep 4-13
Solutions module commands
ConstructVariationString 9-5
DeleteFullVariation 18-5
DeleteImportData 18-2
DeleteLinkedDataVariation 9-6
DeleteSolutionVariation 18-6
DeleteVariation 18-7
EditSources 18-2
ExportEigenmodes 18-9
ExportForHSpice 18-10
ExportForSpice 18-8
ExportNetworkData 18-11
ExportNMF 18-13
GetAdaptiveFreq 18-14
GetSolutionVersionID 18-14
GetSolveRangeInfo 18-14
GetValidISolutionLIst 18-15
HasFields 18-15
ImportSolution 18-16
ImportTable 18-17
IsFieldAvailableAt 18-18
ListMatchingVariations 18-19
ListValuesOfVariable 18-19
ListVariations 18-20
ModuleHasMatrixData 18-15
ModuleHasMesh 18-16
Solve 9-14
SolveSetup
Optimetrics module command 17-10
Split 11-54
Index-13
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.
statistical commands
EditSetup 17-21
InsertSetup 17-23
stopping a script 2-7
stopping script recording 2-6
Sub procedures 1-2
Subtract 11-54
SweepAlongPath 11-19
SweepAlongVector 11-20
SweepAroundAxis 11-21
SweepFacesAlongNormal 11-55
T
ThickenSheet 11-56
trademark notices 1-9
U
UnassignIERegions 14-44
UncoverFaces 11-56
underscore ( _ ) character 1-3
Undo
design-level command 9-16
project-level command 5-6
Unite 11-57
UpdateAllReports 13-20
UpdateReports 13-20
UpdateTraces 13-21
UpdateTracesContextandSweeps 13-23
UserDefinedSolutions module commands
CreateUserDefinedSolution 22-2
DeleteUserDefinedSolution 22-4
EditUserDefinedSolution 22-4
V
variables
array 1-4
assigning information 1-4
declaring 1-4
hierarchy in HFSS 2-2
Index-14
ANSYS Electromagnetics Suite 15.0 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential information
of ANSYS, Inc. and its subsidiaries and affiliates.