HF Ss Scripting Guide
HF Ss Scripting Guide
Release 2023 R1
ANSYS, Inc. January 2023
Southpointe
2600 Ansys Drive ANSYS, Inc. and
Canonsburg, PA 15317 ANSYS Europe,
[email protected] Ltd. are UL
https://www.ansys.com registered ISO
9001:2015 com-
(T) 724-746-3304 panies.
(F) 724-514-9494
HFSS Scripting Guide
2
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Table of Contents
Table of Contents Contents-1
1 - Introduction to Scripting 1-1
Scripting Help Conventions 1-1
Variable Types 1-2
Introduction to VBScript 1-2
Simple and Composite Names 1-3
VBScript Variables 1-3
Declaring Variables 1-3
Declaring Variables in Python 1-4
Variable Naming Conventions 1-4
Scope and Lifetime of Variables 1-4
Array Variables 1-4
VBScript Operators 1-5
Operator Precedence 1-6
Arithmetic Operators 1-6
String Concatenation Operator 1-7
Comparison Operators 1-7
Logical Operators 1-8
Controlling Program Execution 1-8
Using If...Then...Else 1-8
Using Select Case 1-8
Looping Through Code 1-9
Using a For...Next Loop 1-9
Using a Do Loop 1-9
Repeating Statements While a Condition is True 1-9
Repeating a Statement Until a Condition Becomes True 1-10
VBScript Procedures 1-10
Function Procedures 1-10
Contents-1
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-2
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-3
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-4
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-5
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oAnsoftApp 1-77
oDesktop 1-77
oProject 1-77
oDesign 1-77
oEditor 1-78
oModule 1-78
Example Script Opening 1-79
GetActiveProject and GetActiveDesign for Wider Use 1-80
Running a Script 1-80
Within Electronics Desktop 1-80
From the Command Line 1-81
Direct Launch 1-81
Recording a Script 1-82
Recording a Script to File 1-82
Recording a Script to a Project 1-83
Working with Project Scripts 1-84
Executing a Script from Within a Script 1-85
Electronics Desktop Scripting Conventions 1-85
Named Arguments 1-86
VBscript Example 1-86
IronPython Example 1-87
Setting Numerical Values 1-88
Layout Scripts and the Active Layer 1-89
Scripts and Locked Layers 1-89
Event Callback Scripting 1-89
2 - Application Object Script Commands 2-1
GetAppDesktop 2-2
3 - Desktop Object Script Commands 3-1
AddMessage 3-6
ClearMessages 3-7
Contents-6
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
CloseAllWindows 3-8
CloseProject 3-8
CloseProjectNoForce 3-9
Count 3-10
DeleteProject 3-11
DownloadJobResults 3-12
DeleteRegistryEntry 3-13
DoesRegistryValueExist 3-14
EnableAutoSave 3-15
ExportOptionsFiles 3-16
GetActiveProject 3-16
GetActiveScheduler 3-17
GetActiveSchedulerInfo 3-18
GetAutoSaveEnabled 3-19
GetBuildDateTimeString 3-20
GetCustomMenuSet 3-21
GetDefaultUnit 3-21
GetDesktopConfiguration 3-24
GetDistributedAnalysisMachines 3-24
GetDistributedAnalysisMachinesForDesignType 3-25
GetExeDir 3-26
GetGDIObjectCount 3-27
GetLibraryDirectory 3-27
GetLocalizationHelper 3-29
GetMessages 3-29
GetPersonalLibDirectory 3-31
GetPPELicensingEnabled 3-31
GetProcessID 3-32
GetProjectDirectory 3-33
GetProjectList 3-33
Contents-7
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetProjects 3-34
GetRegistryInt 3-35
GetRegistryString 3-36
GetRunningInstancesMgr 3-36
GetSchematicEnvironment 3-37
GetScriptingToolsHelper 3-38
GetSysLibDirectory 3-39
GetTempDirectory 3-39
GetUserLibDirectory 3-40
GetVersion 3-41
IsFeatureEnabled 3-41
KeepDesktopResponsive 3-43
LaunchJobMonitor 3-43
NewProject 3-44
OpenAndConvertProject 3-45
OpenMultipleProjects 3-46
OpenProject 3-47
OpenProjectWithConversion 3-47
PageSetup (Layout Editor) 3-48
PauseRecording 3-49
PauseScript 3-49
Print 3-50
QuitApplication 3-51
RefreshJobMonitor 3-51
ResetLogging 3-52
RestoreProjectArchive 3-53
RestoreWindow 3-54
ResumeRecording 3-55
RunACTWizardScript 3-56
RunProgram 3-56
Contents-8
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
RunScript 3-57
RunScriptWithArguments 3-59
SelectScheduler 3-60
SetActiveProject 3-61
SetActiveProjectByPath 3-62
SetCustomMenuSet 3-63
SetDesktopConfiguration 3-64
SetLibraryDirectory 3-65
SetProjectDirectory 3-66
SetRegistryFromFile 3-67
SetRegistryInt 3-67
SetRegistryString 3-68
SetSchematicEnvironment 3-69
SetTempDirectory 3-70
ShowDockingWindow 3-70
Sleep 3-71
SubmitJob 3-72
TileWindows 3-73
Desktop Commands For Registry Values 3-74
DeleteRegistryEntry 3-75
DoesRegistryValueExist 3-76
GetRegistryInt 3-77
GetRegistryString 3-77
SetRegistryFromFile 3-78
SetRegistryInt 3-79
SetRegistryString 3-80
ImportExport Tool Commands 3-81
ImportANF 3-81
ImportANFv2 3-83
ImportAutoCAD 3-85
Contents-9
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ImportAWRMicrowaveOffice 3-85
ImportEDB 3-87
ImportExtracta 3-88
ImportGDSII 3-89
ImportGerber 3-90
ImportIDF 3-91
ImportIDFandMerge 3-94
ImportIDX 3-95
ImportIPC 3-98
ImportODB 3-99
ImportXFL 3-100
4 - Running Instances Manager Script Commands 4-1
GetAllRunningInstances 4-1
GetRunningInstanceByProcessID 4-2
GetRunningInstancesMgr 4-2
5 - Project Object Script Commands 5-1
AddDataset 5-3
AddMaterial 5-6
AnalyzeAll [project] 5-10
ChangeProperty (3D Modeler Layout Component Visualisation) 5-11
ChangeProperty (Symbol Editor) 5-15
ClearMessages 5-28
CloneMaterial 5-29
Close 5-30
CopyDesign 5-31
CutDesign 5-31
DeleteDataset 5-32
DeleteDesign 5-33
DeleteToolObject 5-34
EditDataset 5-35
Contents-10
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditMaterial 5-37
ExportDataset 5-47
ExportMaterial 5-47
GetActiveDesign 5-48
GetArrayVariables 5-49
GetChildNames [Project] 5-50
GetChildObject [Project] 5-51
GetChildTypes [Project] 5-52
GetConfigurableData (Project) 5-52
GetDefinitionManager 5-53
GetDependentFiles 5-53
GetDesign 5-54
GetDesigns 5-55
GetEDBHandle 5-56
GetLegacyName 5-56
GetName [Project] 5-57
GetObjPath [Project] 5-58
GetPath 5-59
GetPropNames [Project] 5-59
GetPropValue [Project] 5-60
GetProperties 5-61
GetPropertyValue 5-62
GetTopDesignList 5-64
GetVariableValue 5-65
GetVariables 5-65
ImportDataset 5-66
InsertDesign 5-68
InsertDesign [HFSS 3D Layout] 5-69
InsertDesignWithWorkflow 5-69
InsertToolObject 5-71
Contents-11
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-12
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-13
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-14
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
DistributeAnalysis 9-44
EditCoSimulationOptions 9-44
EditDesignSettings 9-45
EditImportData 9-49
EditInfiniteArray 9-49
Edit (Layout Editor) 9-50
EditLayoutForLayoutComponent 9-51
EditNotes 9-52
EditNotes [HFSS 3D Layout] 9-53
EditOptions [HFSS 3D Layout] 9-53
EMDesignOptions 9-54
ExportConvergence 9-56
ExportDataset 9-57
ExportForHSpice 9-57
ExportForHSpice [HFSS 3D Layout] 9-59
ExportForSpice [HFSS 3D Layout] 9-61
ExportMatrixData 9-62
ExportMeshStats 9-66
ExportNetworkData 9-66
ExportNetworkData 9-69
ExportNMFData 9-72
ExportProfile 9-77
Generate Mesh 9-78
GetActiveEditor [HFSS 3D Layout] 9-79
GetChildNames [Design] 9-79
GetChildObject [Design] 9-80
GetChildTypes [Design] 9-81
GetConfigurableData 9-81
GetData 9-82
GetDesignID 9-83
Contents-15
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetDesignName 9-83
GetDesignType 9-84
GetDesignValidationInfo 9-85
GetEdgePositionAtNormalizedParameter 9-86
GetEditSourcesCount 9-87
GetEditor [HFSS 3D Layout] 9-87
GetManagedFilesPath 9-88
GetModule 9-88
GetModule [HFSS 3D Layout] 9-90
GetModule (RadiationSetupMgr) 9-90
GetName 9-91
GetName [HFSS 3D Layout] 9-92
GetNominalVariation 9-92
GetNoteText 9-93
GetObjPath [Design] 9-94
GetOutputVariableValue 9-94
GetOutputVariables 9-96
GetPostProcessingVariables 9-97
GetProperties 9-97
GetPropertyValue 9-99
GetPropNames [Design] 9-100
GetPropValue [Design] 9-101
GetSelections [Design] 9-102
GetSolutionType 9-102
GetSolveInsideThreshold 9-103
GetVariables 9-103
GetVariableValue 9-104
GetVariationVariableValue 9-105
ImportDataset 9-106
InsertDesign 9-108
Contents-16
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-17
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetPhaseCenterPerPort 9-138
SetPropValue [Design] 9-139
SetPropertyValue 9-140
SetShowLayoutForLayoutComponent 9-142
SetSinglePhaseCenter 9-142
SetSolutionType 9-143
SetSolveInsideThreshold 9-145
SetSourceContexts 9-146
SetVariableValue 9-147
SimulateLink 9-147
Solve 9-148
StartAnalysis [HFSS 3D Layout] 9-149
StopSimLink 9-149
Undo [Design] 9-150
Undo [HFSS 3D Layout] 9-151
ValidateLink 9-151
ValidateDesign 9-152
ValidateLink 9-152
10 - Model Setup Script Commands 10-1
Assign Array 10-1
CreateArrayAirbox 10-4
CreateOpenRegion 10-6
DeleteArray 10-7
EditArray 10-8
GetArrayNames 10-12
GetLatticeVectors 10-12
IsArrayDefined 10-13
UpdateArrayAirbox 10-14
UpdateOpenRegionPadding 10-16
11 - 3D Modeler Editor Script Commands 11-1
Contents-18
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-19
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
CreateRelativeCS 11-55
DeleteEmptyGroups 11-57
DeleteLastOperation 11-58
DeleteOperation 11-59
DetachEdges 11-61
DetachFaces 11-62
EditEntityList 11-64
EditFaceCS 11-65
EditObjectCS 11-71
EditRelativeCS 11-78
Export 11-80
ExportModelImageToFile 11-82
ExportModelMeshToFile 11-85
Fillet 11-86
FlattenGroup 11-88
GenerateHistory 11-89
GetActiveCoordinateSystem 11-90
GetActiveCoordinateSystemTransform 11-90
GetCoordinateSystems 11-91
HealObject 11-92
Import 11-96
ImportDXF [Modeler] 11-100
ImportFromClipboard 11-104
ImportGDSII [Modeler] 11-105
Imprint 11-108
ImprintProjection 11-109
Intersect 11-111
MoveCStoEnd 11-113
MoveEntityToGroup 11-114
MoveFaces 11-115
Contents-20
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ProjectSheet 11-117
PurgeHistory 11-118
ReplaceWith3DComponent 11-119
Section 11-122
SeparateBody 11-124
SetModelUnits 11-125
SetWCS 11-126
ShowWindow 11-127
Simplify 11-128
Split 11-131
Stitch 11-133
Subtract 11-135
SweepFacesAlongNormal 11-136
ThickenSheet 11-138
UncoverFaces 11-140
Unite 11-141
Ungroup 11-142
WrapSheet 11-143
Other oEditor Commands 11-144
AddDefinitionFromBlock 11-147
AddDefinitionFromLibFile 11-152
AddViewOrientation 11-156
AssignSurfaceMaterial 11-164
BreakUDMConnection 11-166
ChangeProperty 11-167
CloseAllWindows[Editor] 11-170
Defeature 11-171
Delete 11-172
FitAll 11-173
GenerateAllUserDefinedModels 11-173
Contents-21
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GenerateUserDefinedModel 11-174
GeometryCheckAndAutofix 11-175
GetBodyNamesByPosition 11-177
GetChildNames [Modeler] 11-178
GetChildObject [Modeler] 11-182
GetChildTypes [Modeler] 11-185
GetEdgeByPosition 11-187
GetEdgeIDFromNameForFirstOperation 11-189
GetEdgeIDsFromFace 11-189
GetEdgeIDsFromObject 11-190
GetEdgeLength 11-191
GetEntityListIDByName 11-191
GetExtendedDefinitionObject 11-192
GetFaceArea 11-193
GetFaceCenter 11-194
GetFaceByPosition 11-195
GetFaceIDFromNameForFirstOperation 11-196
GetFaceIDs 11-197
GetFaceIDsOfSheet 11-198
GetGeometryModelerMode 11-198
GetGroupSubmodelNames 11-199
GetMatchedObjectName 11-200
GetModelBoundingBox 11-200
GetModelUnits 11-201
GetNumObjects 11-202
GetObjectIDByName 11-202
GetObjectName 11-203
GetObjectNameByEdgeID 11-204
GetObjectNameByFaceID 11-204
GetObjectNameByID 11-205
Contents-22
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetObjectNameByVertexID 11-206
GetObjectsByMaterial 11-206
GetObjectShapeType 11-207
GetObjectsInGroup 11-208
GetObjectVolume 11-209
GetObjPath [Editor] 11-209
GetPartsForUserDefinedModel 11-210
GetPoints [3D Modeler Editor] 11-211
GetPropEvaluatedValue 11-211
GetPropertyValue 11-212
GetPropNames [Modeler] 11-214
GetPropSIValue 11-215
GetPropValue [Modeler] 11-216
GetRelativeCoordinateSystems 11-217
GetSelections [Model Editor] 11-218
GetSubGroupsInGroup 11-218
GetUserPosition 11-219
GetVertexIDFromNameForFirstOperation 11-220
GetVertexIDsFromEdge 11-221
GetVertexIDsFromFace 11-221
GetVertexIDsFromObject 11-222
GetVertexPosition 11-223
GetWireBodyNames 11-223
OpenExternalEditor 11-224
PageSetup 11-225
RemoveBadEdges 11-227
RemoveBadFaces 11-227
RemoveBadVertices 11-228
RenamePart 11-229
SetPropValue [Modeler] 11-230
Contents-23
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetTopDownViewDirectionForActiveView 11-231
SetTopDownViewDirectionForAllViews 11-232
UpdatePriorityList 11-232
UpgradeVersion 11-233
Validate3DComponent 11-235
WriteHistoryTreeLayoutForTest 11-235
Cable Modeling Commands 11-237
AddCableToBundle 11-238
CreateCableBundle 11-239
CreateCableHarness 11-241
CreateClockSource 11-243
CreatePWLSource 11-245
CreateStraightWireCable 11-247
CreateTwistedPairCable 11-248
ExportCableLibrary 11-250
ImportCableLibrary 11-251
RemoveCable 11-251
UpdateCableHarness 11-252
12 - Output Variable Script Commands 12-1
CreateOutputVariable 12-1
DeleteOutputVariable 12-3
DoesOutputVariableExist 12-4
EditOutputVariable 12-5
ExportOutputVariables 12-6
GetOutputVariables 12-7
GetOutputVariableValue 12-8
ImportOutputVariables 12-9
SimValueContext 12-10
13 - Reporter Editor Script Commands 13-1
AddAllEyeMeasurements 13-4
Contents-24
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AddCartesianLimitLine 13-5
AddCartesianLimitLineFromCurve 13-7
AddCartesianLimitLineFromEquation 13-9
AddCartesianXMarker 13-10
AddCartesianYMarker 13-11
AddCartesianYMarkerToStack 13-12
AddDeltaMarker 13-13
AddMarker 13-14
AddNote 13-15
AddTraceCharacteristics 13-17
AddTraces 13-19
ApplyReportTemplate 13-21
ChangeProperty[ReportSetup] 13-22
ClearAllMarkers 13-26
ClearAllTraceCharacteristics 13-26
CloneReportsFromDatasetSolution 13-27
CopyPlotSettings 13-28
CopyReportDefinitions 13-29
CopyReportsData 13-29
CopyTraceDefinitions 13-30
CopyTracesData 13-31
CreateReport 13-32
CreateReport [Designer] 13-47
CreateReportFromFile 13-52
CreateReportFromTemplate 13-53
CreateReportOfAllQuantities 13-54
DeleteMarker 13-55
DeleteAllReports 13-56
DeleteReports 13-57
DeleteTraceCharacteristics 13-57
Contents-25
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
DeleteTraces 13-58
DoesSupportTraceCharacteristics 13-59
DumpAllReportsData 13-60
EditCartesianXMarker 13-61
EditCartesianYMarker 13-61
EditMarker 13-62
ExportEyeMaskViolation 13-63
ExportImageToFile [Reporter] 13-64
ExportModelImageToFile 13-65
ExportModelMeshToFile 13-68
ExportPlot3DToFile [Reporter] 13-69
ExportReport 13-70
ExportReportDataToFile 13-72
ExportTableToFile 13-72
ExportToFile [Reporter] 13-73
ExportUniformPointsToFile 13-74
GetAllCategories 13-76
GetAllQuantities 13-77
GetAllReportNames 13-78
GetAvailableDisplayTypes 13-79
GetAvailableReportTypes 13-80
GetAvailableSolutions 13-80
GetChildNames [Report Setup] 13-81
GetChildObject [Report Setup] 13-82
GetChildTypes [ReportSetup] 13-83
GetCurvePropServerName 13-83
GetDisplayType 13-84
GetDynLinkIntrinsicVariables 13-85
GetDynLinkQtyValueState 13-85
GetDynLinkTraces 13-86
Contents-26
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetDynLinkVariableValues 13-87
GetName 13-87
GetObjPath [Design] 13-88
GetPropertyValue 13-89
GetPropNames [Reporter] 13-90
GetPropValue [Report Setup] 13-91
GetQtyExpressionsForSourceTrace 13-92
GetReportTraceNames 13-92
GetReportSummaryForRegressionTesting 13-93
GetSolutionContexts 13-94
GetSolutionDataPerVariation 13-95
GetDataExpressions 13-97
GetDataUnits 13-98
GetDesignVariableNames 13-99
GetDesignVariableUnits 13-100
GetDesignVariableValue 13-101
GetDesignVariationKey 13-102
GetImagDataValues 13-102
GetPerQuantityPrimarySweepValues 13-103
GetRealDataValues 13-104
GetSweepNames 13-105
GetSweepUnits 13-106
GetSweepValues 13-107
IsDataComplex 13-108
IsPerQuantityPrimarySweep 13-109
Release Data 13-110
GroupPlotCurvesByGroupingStrategy 13-111
ImportIntoReport 13-112
ImportReportDataIntoReport 13-113
MovePlotCurvesToGroup 13-113
Contents-27
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
MovePlotCurvesToNewGroup 13-114
OpenWindowForAllReports 13-115
OpenWindowForReports 13-116
PastePlotSettings 13-117
PasteReports 13-117
PasteReportsWithLegacyNames 13-118
PasteTraces 13-119
PasteTracesWithLegacyNames 13-119
RenameReport 13-120
RenameTrace 13-121
ResetPlotSettings 13-122
SavePlotSettingsAsDefault 13-122
SetLinkOutputTraces 13-123
SetPropValue [Report Setup] 13-124
UnGroupPlotCurvesInGroup 13-125
UpdateAllReports 13-126
UpdateReports 13-126
UpdateTraces 13-127
UpdateTracesContextAndSweeps 13-130
14 - Boundary and Excitation Module Script Commands 14-1
General Commands Recognized by the Boundary/Excitations Module 14-3
AddAssignmentToBoundary 14-5
AutoIdentifyLatticePair 14-6
AutoIdentifyNets 14-7
AutoIdentifyPorts 14-7
AutoIdentifyTerminals 14-8
ChangeImpedanceMult 14-10
ConvertNportCircuitElementsToPorts 14-10
CreateNportCircuitElements 14-11
DeleteAllBoundaries 14-13
Contents-28
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
DeleteAllExcitations 14-14
DeleteBoundaries 14-15
EditNportCircuitElement 14-15
GetBoundaries 14-17
GetBoundariesOfType 14-17
GetBoundaryAssignment 14-18
GetDefaultBaseName 14-19
GetDiffPairs 14-19
GetExcitations 14-20
GetExcitationsOfType 14-21
GetHybridRegions 14-21
GetHybridRegionsOfType 14-22
GetNumBoundaries 14-23
GetNumBoundariesOfType 14-23
GetNumExcitations 14-24
GetNumExcitationsOfType 14-25
GetNumHybridRegions 14-25
GetNumHybridRegionsOfType 14-26
GetPortExcitationCounts 14-27
IdentifyNets 14-27
ListNets 14-28
ReassignBoundary 14-29
RemoveAssignmentFromBoundary 14-30
RenameBoundary 14-31
ReprioritizeBoundaries 14-31
SetDefaultBaseName 14-33
SetPhaseCenterPerPort 14-33
SetSinglePhaseCenter 14-35
Script Commands for Creating and Modifying Boundaries 14-35
AssignAnisotropicImpedance 14-38
Contents-29
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignAperture 14-41
AssignCircuitPort 14-42
AssignCurrent 14-44
AssignCylindricalWave 14-45
AssignDielectricCavity 14-48
AssignFarFieldWave 14-49
AssignFEBI 14-52
AssignFiniteCond 14-53
AssignFloquet 14-56
AssignFresnel 14-63
AssignGaussianBeam 14-64
AssignHalfSpace 14-68
AssignHertzianDipoleWave 14-69
AssignHybridRegion 14-71
AssignIERegion 14-73
AssignImpedance 14-73
AssignIncidentWave 14-75
AssignLatticePair 14-79
AssignLayeredImp 14-81
AssignLinearAntennaWave 14-84
AssignLinkedImpedance 14-88
AssignLinkedRegion 14-91
AssignLumpedPort 14-92
AssignLumpedRLC 14-95
AssignMagneticBias 14-98
AssignMultipactionChargeRegion 14-100
AssignMultipactionDCBias 14-102
AssignMultipactionSEE 14-106
AssignNearFieldWave 14-107
AssignPerfectE 14-111
Contents-30
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignPerfectH 14-112
AssignPlaneWave 14-113
AssignPrimary 14-117
AssignRadiation 14-119
AssignRFDischargeDCBias 14-120
AssignScreeningImpedance 14-122
AssignSecondary 14-125
AssignSymmetry 14-129
AssignTerminal 14-130
AssignVoltage 14-131
AssignWavePort 14-133
AutoCreatePECCapforWavePort 14-136
CircuitPortToLumpedPort 14-138
EditAnisotropicImpedance 14-139
EditAperture 14-141
EditCircuitPort[HFSS] 14-142
EditCurrent 14-144
EditDielectricCavity 14-146
EditDiffPairs 14-147
EditFEBI 14-149
EditFiniteCond 14-150
EditFloquetPort 14-151
EditFresnel 14-158
EditGlobalMatEnv 14-159
EditHalfSpace 14-160
EditHybridRegion 14-161
EditImpedance 14-162
EditIncidentWave 14-163
EditLatticePair 14-166
EditLayeredImp 14-167
Contents-31
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditLinkedImpedance 14-170
EditLinkedRegion 14-173
EditLumpedPort 14-174
EditLumpedRLC 14-177
EditMagneticBias 14-179
EditMultipactionChargeRegion 14-181
EditMultipactionDCBias 14-183
EditMultipactionSEE 14-186
EditRFDischargeDCBias 14-188
EditPerfectE 14-189
EditPerfectH 14-191
EditPrimary 14-191
EditRadiation 14-193
EditSecondary 14-195
EditSymmetry 14-197
EditTerminal 14-198
EditVoltage 14-199
EditVoltageDrop 14-201
EditWavePort 14-201
LumpedPortToCircuitPort 14-205
SetAllHybridRegionsToOneWayCoupled 14-206
SetAllHybridRegionsToTwoWayCoupled 14-206
SetHybridRegionCoupledGroup 14-207
SetHybridRegionsCoupling 14-210
SetScatteredFieldFormulation 14-211
SetSBRCreepingWaveSettings 14-211
SetSBRSources 14-213
SetSBRSourcesBlockage 14-216
SetSBRTxRxSettings 14-217
SetSBRWedgeSettings 14-219
Contents-32
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetTerminalReferenceImpedances 14-222
SetTotalFieldFormulation 14-223
SwapCircuitPortDirection 14-223
SwapLatticePair 14-224
UnassignIERegions 14-225
Script Commands for Creating and Modifying PMLs 14-226
CreatePML 14-226
ModifyPMLGroup 14-229
PMLGroupCreated 14-231
PMLGroupModified 14-232
RecalculatePMLMaterials 14-234
AssignMultiFloatingLine 14-235
AssignMultiSignalLine 14-236
AssignMultiNonIdealGround 14-237
ToggleConductor 14-239
EditSignalLine 14-239
EditSurfaceGround 14-240
EditFloatingLine 14-241
AssignFiniteCond 14-242
EditFiniteCond 14-245
AssignThinConductor 14-246
ToggleTerminal 14-248
15 - Mesh Operations Module Script Commands 15-1
General Commands Recognized by the Mesh Operations Module 15-2
DeleteOp 15-2
GetMeshOpAssignment 15-3
GetOperationNames 15-3
ReassignOp 15-4
RenameOp 15-5
Script Commands for Creating and Modifying Mesh Operations 15-6
Contents-33
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignApplyCurvilinearElementsOp 15-7
AssignCloneOp 15-8
AssignCurvatureExtractionOp (Beta) 15-10
AssignCylindricalGapOp 15-11
AssignDensityControlOp 15-13
AssignEdgeCutLayerOp 15-16
AssignLengthOp 15-17
AssignMeshRegion 15-19
AssignModelResolutionOp 15-21
AssignRotationalLayerOp 15-22
AssignSkinDepthLayerSetting 15-23
AssignSkinDepthOp 15-25
AssignSurfPriorityForTauOp 15-26
AssignTrueSurfOp 15-28
EditApplyCurvilinearElementsOp 15-30
EditCloneOp 15-31
EditCurvatureExtractionOp (Beta) 15-33
EditCylindricalGapOp 15-34
EditDensityControlOp 15-36
EditEdgeCutLayerOp 15-38
EditLengthOp 15-39
EditMeshRegion 15-41
EditModelResolutionOp 15-42
EditRotationalLayerOp 15-43
EditSBRCurvatureExtractionOp (Beta) 15-45
EditSkinDepthOp 15-46
EditSurfPriorityOp 15-47
EditTrueSurfOp 15-48
InitialMeshSettings 15-50
16 - Analysis Setup Module Script Commands 16-1
Contents-34
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-35
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ResetToTimeZero 16-93
RevertAllToInitial 16-94
RevertAllToInitialTemperature 16-95
RevertAllToZeroDisplacement 16-95
RevertSetupToInitial 16-96
RevertSetupToInitialTemperature 16-97
RevertSetupToZeroDisplacement 16-97
SetMPIVendor 16-98
SolveSetup 16-99
17 - Optimetrics Module Script Commands 17-1
CopySetup 17-6
DeleteSetups [Optimetrics] 17-7
DistributedAnalyzeSetup 17-7
EditSetup 17-8
EnableSetup 17-20
ExportDXConfigFile 17-21
ExportOptimetricsProfile 17-22
ExportOptimetricsResult 17-23
ExportParametricResults 17-24
ExportParametricSetupTable 17-25
ExportRespSurfaceMinMaxTable 17-26
ExportRespSurfaceRefinePoints 17-27
ExportRespSurfaceResponsePoints 17-27
ExportRespSurfaceVerificationPoints 17-28
GenerateVariationData [Parametric] 17-29
GetChildNames [Optimetrics] 17-30
GetChildObject [Optimetrics] 17-30
GetChildTypes [Optimetrics] 17-31
GetName 17-32
GetObjPath [Design] 17-32
Contents-36
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetOptimetricResult 17-33
GetOptimetricsResult 17-34
GetPropNames [Optimetrics] 17-35
GetPropValue [Optimetrics] 17-36
GetSetupNames [Optimetrics] 17-36
GetSetupNamesByType [Optimetrics] 17-37
ImportSetup 17-38
InsertSetup 17-39
PasteSetup [Optimetrics] 17-74
RenameSetup [Optimetrics] 17-75
SetPropValue [Optimetrics] 17-76
SolveAllSetup 17-77
SolveSetup [Optimetrics] 17-77
ValidateSetup [Parametric] 17-78
General Commands Recognized by the Optimetrics Module 17-79
CopySetup 17-80
DeleteSetups [Optimetrics] 17-81
DistributedAnalyzeSetup 17-81
EditSetup 17-82
EnableSetup 17-94
ExportDXConfigFile 17-95
ExportOptimetricsProfile 17-96
ExportOptimetricsResult 17-97
ExportParametricResults 17-98
ExportParametricSetupTable 17-99
ExportRespSurfaceMinMaxTable 17-100
ExportRespSurfaceRefinePoints 17-100
ExportRespSurfaceResponsePoints 17-101
ExportRespSurfaceVerificationPoints 17-102
GenerateVariationData [Parametric] 17-103
Contents-37
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-38
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-39
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetISolutionVersionID 18-25
GetSolveRangeInfo 18-26
GetSourceContexts 18-26
GetSourceData [HFSS 3D Layout] 18-27
GetTerminalExcitationType 18-27
GetTransientSolveTimes 18-28
GetValidISolutionList 18-29
HasFields 18-30
HasMatrixData 18-30
HasMesh 18-31
ImportSolution 18-32
ImportTable 18-33
IsFieldAvailableAt 18-34
ListMatchingVariations 18-35
ListValuesOfVariable 18-36
ListVariations 18-37
SetSourceContexts 18-37
TDROnReport 18-38
19 - Fields Calculator Script Commands 19-1
AddNamedExpression 19-2
AddNamedExpr 19-3
CalcOp 19-4
CalcRead(deprecated) 19-4
CalculatorRead 19-5
CalcStack 19-6
CalculatorWrite 19-7
CalcWrite 19-8
ChangeGeomSettings 19-9
ClcEval 19-10
ClcMaterial 19-11
Contents-40
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ClcMaterialValue 19-11
ClearAllNamedExpr 19-12
CopyNamedExprToStack 19-13
DeleteNamedExpr 19-13
DoesNamedExpressionExists 19-14
EnterComplex 19-15
EnterComplexVector 19-16
EnterCoord 19-17
EnterEdge 19-17
EnterLine 19-18
EnterOutputVar 19-19
EnterPoint 19-19
EnterQty 19-20
EnterScalar 19-21
EnterScalarFunc 19-22
EnterSurf 19-22
EnterVector 19-23
EnterVectorFunc 19-24
EnterVol 19-24
ExportOnGrid [Fields Calculator] 19-25
ExportToFile [Fields Calculator] 19-28
GetTopEntryValue 19-31
LoadNamedExpressions 19-32
SaveNamedExpressions 19-33
20 - Radiation Module Script Commands 20-1
General Commands Recognized by the Radiation Module 20-2
CopyRadFieldSetup 20-2
DeleteFarFieldSetup 20-3
DeleteNearFieldSetup 20-4
DeleteSetup 20-4
Contents-41
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditRadiatedPowerCalculationMethod 20-5
GetChildNames [Radiation] 20-6
GetChildObject [Radiation] 20-6
GetChildTypes [Radiation] 20-7
GetPropNames [Radiation] 20-7
GetPropValue [Radiation] 20-7
GetSetupNames 20-8
PasteRadFieldSetup 20-9
RenameSetup [Radiation] 20-9
SetPropValue [Radiation] 20-10
Script Commands for Creating and Modifying Radiation Setups 20-11
AddAntennaOverlay 20-11
AddRadFieldSourceGroup 20-13
EditAntennaOverlay 20-15
EditBoxSetup 20-17
EditFarFieldSphereSetup 20-19
EditInfiniteSphereSetup 20-21
EditLineSetup 20-23
EditNearFieldBoxSetup 20-25
EditNearFieldLineSetup 20-27
EditNearFieldRectangleSetup 20-28
EditNearFieldSphereSetup 20-30
EditRadFieldSourceGroup 20-32
EditRectangleSetup 20-33
EditSphereSetup 20-35
InsertBoxSetup 20-37
InsertFarFieldSphereSetup 20-39
InsertInfiniteSphereSetup 20-41
InsertLineSetup 20-44
InsertNearFieldBoxSetup 20-45
Contents-42
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
InsertNearFieldLineSetup 20-47
InsertNearFieldRectangleSetup 20-48
InsertNearFieldSphereSetup 20-50
InsertRectangleSetup 20-52
InsertSphereSetup 20-54
Script Commands for Modifying Antenna Array Setups 20-56
EditAntennaArraySetup 20-56
Script Commands for Exporting Antenna Parameters and Max Field Parameters 20-61
ExportElementPatternToFile 20-62
ExportFieldsToFile 20-63
ExportParametersToFile 20-65
ExportRadiationFieldsToFile 20-67
ExportRadiationParametersToFile 20-69
21 - Radiation Setup Manager Module Script Commands 21-1
Add (Infinite Sphere) 21-1
Edit (RadiationSetupMgr for Infinite Sphere) 21-5
Add (Near Field Line) 21-8
Edit (RadiationSetupMgr for Near Field Line) 21-10
Add (Near Field Plane) 21-12
Edit (RadiationSetupMgr for Near Field Plane) 21-15
Add (Near Field Sphere) 21-18
Edit (RadiationSetupMgr for Near Field Sphere) 21-22
22 - User Defined Document Script Commands 22-1
AddDocument 22-1
DeleteAllDocuments 22-4
DeleteDocument 22-5
EditDocument 22-5
GetDocumentDefinitionNames 22-7
GetDocumentNames 22-8
RenameDocument 22-8
Contents-43
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SaveHtmlDocumentAs 22-9
SavePdfDocumentAs 22-10
UpdateAllDocuments 22-10
UpdateDocument 22-11
ViewHtmlDocument 22-12
ViewPdfDocument 22-13
Explication of a Sample UDD Script 22-13
Example Python Script: Defining a Document 22-15
23 - User Defined Solutions Commands 23-1
CreateUserDefinedSolution 23-1
DeleteUserDefinedSolutions 23-3
EditUserDefinedSolution 23-4
GetUserDefinedSolutionNames 23-6
GetUserDefinedSolutionProperties 23-6
24 - Network Data Explorer Script Commands 24-1
AddDiffPair 24-4
Cascade (SPISim) 24-5
ClearDiffPairs 24-6
Clone 24-7
Close 24-8
Combine (SPISim) 24-9
Deembed (SPISim) 24-10
DeembedBack (SPISim) 24-11
DeembedFront (SPISim) 24-13
DisableDiffPairs 24-14
EnableDiffPairs 24-15
ExportCitiFile 24-16
ExportFullWaveSpice 24-18
ExportMatlab 24-19
ExportNMFData 24-21
Contents-44
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ExportNetworkData 24-26
ExportSpreadsheet 24-29
ExportTouchstone 24-31
ExportTouchstone2 24-34
Extract (SPISim) 24-36
GetFrequencies 24-37
GetFrequencyCount 24-38
GetName 24-39
GetPortCount 24-40
GetPortNumber 24-41
GetPostProcSettings 24-42
GetSolutionVariation 24-43
GetVariation 24-44
HasSameData 24-45
LoadSolution 24-47
Open 24-48
Rename (SPISim) 24-49
Renormalize (SPISim) 24-50
Reorder 24-51
Reorder (SPISim) 24-52
Reset 24-53
SetAllPortImpedances 24-54
SetPortDeembedDistance 24-56
SetPortImpedance 24-57
SetPostProcSettings 24-58
Smooth 24-59
Stretch (SPISim) 24-60
Terminate 24-61
25 - CompInstance Script Commands (multiple)
Callback Scripting Using CompInstance Object (multiple)
Contents-45
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
CompInstance Functions 64
GetComponentName 64
GetInstanceID [Component Instance] 65
GetInstanceName [Component Instance] 66
GetParentDesign 66
GetPropServerName 67
26 - Simulation Setup Commands 26-1
AddSetup [HFSS 3D Layout] 26-2
AddSweep [HFSS 3D Layout] 26-2
Analyze [HFSS 3D Layout] 26-3
AnalyzeSweep [HFSS 3D Layout] 26-3
Delete [HFSS 3D Layout] 26-3
DeleteSweep [HFSS 3D Layout] 26-4
DynamicMeshOverlays [HFSS 3D Layout] 26-4
Edit [HFSS 3D Layout] 26-4
EditSweep [HFSS 3D Layout] 26-4
ExportToHFSS [HFSS 3D Layout] 26-5
ExportToQ3D [HFSS 3D Layout] 26-5
GetAllSolutionNames [HFSS 3D Layout] 26-5
GetSetupData [HFSS 3D Layout] 26-5
LayoutMeshOverlay [HFSS 3D Layout] 26-6
Layout3DMeshOverlay [HFSS 3D Layout] 26-6
ListVariations [HFSS 3D Layout] 26-6
RefreshMeshOverlays [HFSS 3D Layout] 26-7
RenameSweep [HFSS 3D Layout] 26-7
27 - Excitations Commands 27-1
Add [Excitation HFSS 3D Layout] 27-2
AddRefPort [HFSS 3D Layout] 27-2
AddRefPortUsingEdges [HFSS 3D Layout] 27-3
ConvertPlaneToTrace [HFSS 3D Layout] 27-5
Contents-46
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-47
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-48
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-49
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-50
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-51
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-52
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-53
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-54
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-55
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SendToBack 31-96
SetPageData [Schematic Editor] 31-97
ShowVariableBlock (Schematic Editor) 31-100
SortComponents (Schematic Editor) 31-100
Wire (Schematic Editor) 31-101
ZoomArea (Schematic Editor) 31-102
ZoomIn (Schematic Editor) 31-103
ZoomOut (Schematic Editor) 31-104
ZoomPrevious (Schematic Editor) 31-105
ZoomToFit (Schematic Editor) 31-106
Property Method List 31-107
ChangeProperty (Schematic Editor) 31-107
GetEvaluatedPropertyValue (Schematic Editor) 31-108
GetProperties (Schematic Editor) 31-109
GetPropertyAttribute [Schematic Editor] 31-111
GetPropertyValue (Schematic Editor) 31-112
SetPropertyValue (Schematic Editor) 31-113
Information Method List 31-114
GetAllPorts 31-115
GetCompInstanceFromRefDes (Schematic Editor) 31-115
GetComponentInfo (Schematic Editor) 31-116
GetComponentPins (Schematic Editor) 31-118
GetComponentPinInfo (Schematic Editor) 31-119
GetComponentPinLocation [Schematic Editor] 31-120
GetEditorName (Schematic Editor) 31-121
GetNetConnections (Schematic Editor) 31-122
GetNumPages [Schematic Editor] 31-123
GetPortInfo (Schematic Editor) 31-124
GetSelections (Schematic Editor) 31-125
GetSignals (Schematic Editor) 31-126
Contents-56
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-57
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-58
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-59
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-60
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
DeleteRuleSet 33-5
DeleteRun 33-5
EditRuleSet 33-5
EditRun 33-7
RenameRuleSet 33-9
RenameRun 33-10
RunAllDV 33-10
RunAllRuleSetDV 33-11
RunDV 33-11
34 - Core Global Script Context Commands 34-1
AddErrorMessage 34-1
AddFatalMessage 34-2
AddInfoMessage 34-2
AddWarningMessage 34-3
LogDebug 34-3
LogError 34-4
35 - Example Scripts 35-1
VBScript Example Scripts 35-1
Data Export Script 35-1
Variable Helix Script 35-4
GetPropNames and GetPropValues for Layered Impedance Boundary Script 35-8
IronPython Example Scripts 35-11
BH Coordinates Python Script 35-11
Script Contents 35-11
Posco_BH_Curve.tab Contents 35-13
Equation Based Curve Python Script 35-16
HFSS Waveguide Array Python Script 35-19
Index Index-1
Contents-61
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Contents-62
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
1 - Introduction to Scripting
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 in the order in which they appear.
Electronics Desktop can record scripts in VBScript or IronPython, and can run external scripts
written in VBScript, IronPython, CPython, or JavaScript. Additionally, it contains an IronPython
command shell for executing scripts.
When running Ansys Electronics Desktop from the command line, scripts can be written in any
language that provides Microsoft COM methods.
The following sections contain more information about scripting:
l Scripting Help Conventions – explains the layout of the scripting help.
l Introduction to VBscript – provides a broad overview of VBscript
l Introduction to IronPython – provides a broad overview of IronPython.
l Introduction to C-Python – provides guidance on using C-Python for Ansys Electronics
Desktop scripts.
l Ansys Electronics Desktop Scripting – details instructions and tips for running, recording,
and working with scripts in Electronics Desktop.
Parameters
[List of arguments taken by the script command, if any. Includes argument
types and brief descriptions.]
Return Value [The script's return value, if any.]
Python Syn- [Correct syntax for the command in Python. Arguments are enclosed in angle
tax brackets (<>).]
Python [Sample script]
Example
Variable Types
The following data types are used throughout the help:
l <string> – use within quotation marks.
l <bool> – boolean value; should be set to either True or False.
l <int> – an integer. For example, 1.
l <double> – a double precision value. For example, 1.2.
l <array> – in VBscript, an array; in IronPython, a list contained in square brackets.
l <value> – can be an integer, string, or VBscript variable, depending on context.
Introduction to VBScript
Ansys Electronics Desktop can use Microsoft® Visual Basic® Scripting (VBScript) to record mac-
ros. VBScript is based on the Microsoft Visual Basic programming language.
This chapter provides an overview of key VBScript components.
Simple and Composite Names
VBScript Variables
VBScript Operators
Controlling Program Execution
Looping Through Code
VBScript Procedures
Converting Between Data Types
Including Scripts
Aborting Scripts
Interacting with a Script
Recommended VBScript References
Sample HFSS Script
Sample Circuit Script
Sample Q3D Script
For more details about VBScript, please see the Recommended VBScript References section at
the end of this chapter.
Simple and Composite Names
Components, symbols, footprints, models, and padstacks possess either "simple" names or
"composite" names. Composite names are used to distinguish items from libraries that may pos-
sess the same simple name. A composite name is created by combining an item’s library name
with its simple name. Composite names for definitions are unique, but simple names are not.
l Composite names are used by definition manager script commands to uniquely identify
script definitions.
l Materials and scripts do not have composite names, so project definitions for these items
must possess a unique simple name.
l The format of a composite name is LibraryName:SimpleDefinitionName. For example, the
composite name for the component "CAP_ in" the system library Nexxim Circuit Ele-
ments\Capacitors is "Nexxim Circuit Elements\Capacitors:CAP_in."
l The format of a composite name in a project is OriginLibraryName:SimpleDefinitionName.
For example, the composite name for the project component "CAP_" that was originally
from the system library Nexxim Circuit Elements\Capacitors is "Nexxim Circuit Ele-
ments\Capacitors:CAP_".
l Not all definitions in a project have a library of origin. Newly added definitions do not have
a library of origin, and project definitions whose names are changed do not have a library
of origin (even if they did before the name change). As a result, the composite name for
items without a library of origin is the item’s simple name itself. For example, the com-
posite name for the project component "CAP_" that came from a system library and was
renamed to "MyCAP_" is "MyCAP_".
To construct a composite name, select Tools > Edit Configured Libraries > Components to
open the Edit Libraries dialog box. The subnames used to construct a composite name can be
found in the Name and Origin columns that correspond to a particular component. The Origin
column contains the library portion of the composite name, while the Name column contains the
simple portion of the composite name.
VBScript Variables
A VBScript variable is a placeholder representing information that may change during the time
your script is running. Variables are useful because they let you assign a short and easy to
remember name to each piece of data you plan to use. Use a variable name in a script to view or
modify its value.
Declaring Variables
To declare variables explicitly in a script, use the Dim, Public, or Private statements. For
example:
Dim box_xsize
After declaring a variable, you can assign information to it. For example:
box_xsize = "3mm"
You can declare multiple variables by separating each variable name with a comma. For
example:
Dim Top, Bottom, Left, Right
You can also declare a variable implicitly by simply using its name in your script. Doing so is not
generally a good practice because you could misspell the variable name in one or more places,
causing unexpected results when your script is run. For that reason, the Option Explicit state-
ment is available to require explicit declaration of all variables. The Option Explicit statement
should be the first statement in your script.
Declaring Variables in Python
Python does not require you to declare variables before you assign a value to them.
You can directly assign information to it. For example:
box_xsize = "3mm"
Variable Naming Conventions
You should use names that are short but intuitive and easy to remember. Use the following con-
ventions for naming variables in VBScript:
l Begin with an alphabetic character.
l Cannot contain an embedded period.
l Must not exceed 255 characters.
l Must be unique in the scope in which it is declared.
l Do not use VBScript keywords.
All arrays in VBScript are zero-based, so the array above actually contains 3 elements. You
assign data to each of the array’s 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 ele-
ment. For example:
one_prim = Primitives(1)
You can also use the Array function to assign an array of elements to a variable. For example:
Dim Primitives
Primitives = Array ("Box1", "cone1", "Cylinder1")
Note:
When using the Array function, do not use parentheses on the variable when it is
declared. For example, use Dim myarray, not Dim myarray().
If you do not know the size of the array at declaration or the size changes during the time your
script is running, you can use dynamic arrays. They are declared without size or number of
dimensions inside the parentheses. For example:
Dim FirstArray()
ReDim SecondArray()
To use a dynamic array, you must subsequently use ReDim to determine the number of dimen-
sions and the size of each dimension. You can also use the Preserve keyword to preserve the
contents of the array as the resizing takes place.
ReDim FirstArray(25)
ReDim Preserve FirstArray(30)
VBScript Operators
VBScript provides operators, which are grouped into these categories: arithmetic operators,
comparison operators, and logical operators.
Please see the online VBScript User’s Guide for more details.
Operator Precedence
When several operations occur in an expression, each part is evaluated and resolved in a pre-
determined 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 par-
entheses, however, standard operator precedence is maintained.
When an expression contains operators from more than one category, they are evaluated in the
following order:
1. Arithmetic Operators
2. String Concatenation Operator (&)
3. Comparison Operators
4. Logical Operators
Arithmetic operators within a single expression are evaluated in the following order of pre-
cedence:
1. Exponentiation (^)
2. Multiplication and Division (*,/): These two operators are of equal precedence and are eval-
uated in the left-to-right order in which they appear within the expression.
3. Integer Division (\)
4. Modulus Arithmetic (Mod)
5. Addition and Subtraction (+,-): These two operators are of equal precedence and are eval-
uated in the order in which they appear within the expression.
If the same arithmetic operator appears multiple times within a single expression, they are eval-
uated in the left-to-right order in which they appear.
Comparison operators all have equal precedence and are evaluated in the left-to-right order in
which they appear within the expression.
Logical operators all have equal precedence and are evaluated in the left-to-right order in which
they appear within the expression.
Arithmetic Operators
Following is a list of VBScript’s arithmetic operators:
Symbol Description
^ Exponentiation
- Unary negation
* Multiplication
/ Division
\ Integer division
Mod Modulus arithmetic
+ Addition
- Subtraction
Note:
For the order of precedence for these operators, see Operator Precedence.
Symbol Description
= Equality
<> Inequality
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
Is Object equivalence
Note:
All comparison operators have the same precedence. When multiple comparisons
exist in a single expression, evaluate them in the left-to-right order in which they
appear.
Logical Operators
Following is a list of VBScript’s logical operators:
Symbol Description
Not Logical negation
And Logical conjunction
Or Logical disjunction
Xor Logical exclusion
Eqv Logical equivalence
Imp Logical implication
Note:
All logical operators have the same precedence. When multiple logical operators exist
in a single expression, evaluate them in the left-to-right order in which they appear.
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
Using Select Case
Following is an example that demonstrates the Select Case conditional statement:
When using conditional statements that test for zero voltage/current, it is important to note that a
real voltage or current should not be trusted to be exactly zero, even when it should be. Typ-
ically, the voltage or current is often on the order of 'epsilon' (1e-16) or smaller; hence, it is
nonzero in value.
Using a For...Next Loop
The For...Next type of loop allows you to run a group of statements repeatedly. It uses a counter
to run statements a specified number of times. Following is an example that demonstrates the
For...Next loop:
For variable = start To end
<statements to execute>
Next
You can exit early from a For...Next loop with the Exit For statement.
Using a Do Loop
You can use Do...Loop statements to run a block of statements until (or while) a condition is
true.
Repeating Statements While a Condition is True
Use the While keyword to check a condition in a Do...Loop statement. The syntax is as follows:
Do While condition
<statements to execute>
Loop
Including Scripts
You can include one script within another using the following command:
#include "<scriptfilename>"
Where scriptfilename is the full path name to a file that contains script text, or is the name of a
script in the project library or script library (listed in the project window under the Defin-
itions/Scripts directory).
The command works for VBScript, JScript, and for the following:
l Scripts in the project library that are run by right-clicking the script icon in the project win-
dow and choosing Run Script
l Scripts in files that are external are run by choosing Tools> Run Script
l Scripts that are specified as callbacks in the Property dialog box
l Scripts that are run to draw parameterized footprints in layout
An include command can be placed anywhere in a script, but for readability it is recommended
that commands be placed at the beginning of a file. The same script can be included multiple
times without error, and circular inclusions will be ignored.
Aborting Scripts
You can abort a script that is running in the desktop simply by pressing the ESC key. Ter-
minating a script in this manner works for each of the following:
l Scripts in the project library that are run by right-clicking the script icon in the project win-
dow and choosing Run Script.
l Scripts in files that are external can be run by choosing Tools > Run Script.
l Scripts that are specified as callbacks in the Property dialog box.
l Scripts that are run to draw parameterized footprints in layout.
The MsgBox function shows a message and returns a number based on the button the user
presses. For example:
MsgBox ("message text")
Recommended VBScript References
Microsoft Corporation. VBScript User’s Guide.
Available http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/htm-
l/vbstutor.asp.
Childs, M., Lomax, P., and Petrusha, R. VBScript in a Nutshell: A Desktop Quick Reference.
May 2002. O’Reilly & Associates. ISBN: 1-56592-720-6.
Sample HFSS Script
Following is an example of an Ansys Electronics Desktop script. It includes comment lines,
which are preceded by either an apostrophe ( ’) or the word REM, that offer explanations for
each preceding line or lines. VBScript keywords appear in bold font.
’ ----------------------------------------------
’ Script Recorded by Ansoft HFSS Version 10.0
’ 11:03 AM May 3, 2005
’ ----------------------------------------------
Dim oDesign
Dim oEditor
Dim oModule
REM Dim is used to declare variables. Dim means dimension. In VBScript you can use Dim,
REMPublic, or Private to declare variables. As VBScript has no built-in data types (like
REMinteger, string, etc.), all variables are treated as variants, which can store any type of
REMinformation. In this example, the three variables will be used as objects. When
REMrecording scripts in HFSS, variants that will be used as objects always begin with o.
’ You can use Set to assign an object reference to a variable. A copy of the object is not
’ created for that variable. Here CreateObject is a function that takes a string as input
’ and returns an object. The object is assigned to the variable oAnsoftApp.
oDesktop.NewProject
’ In VBScript, a Sub procedure is a procedure that is called by name, can receive arguments,
’ and can perform a specific task with a group of statements. Here the Sub procedure
’ NewProject of the object oDesktop is called. This Sub does not take an input.
’ attributes. You can modify the italicized entries to create a different box. In VBScript,
’ Array is a function that returns a variant containing an array. The underscore
’ character ( _ ) here indicates that the statement continues to the next line. The
’ underscore character must be placed outside of string constants, or else VBScript will
’ recognize the character as part of the string constant rather than an indication that the
’ string continues on the next line. Following is an example of proper use of the underscore
’ character:
’ Msgbox("Please include units when creating variables " & _
’ "that require dimensions."
’ Following is an example of improper use of the underscore character:
’ Msgbox("Please include units when creating variables _
’ that require dimensions."
For additional Ansys Electronics Desktop script examples, see Example Scripts.
Sample Q3D Extractor Script
Following is an example Q3D Extractor script. It includes comment lines, preceded by either an
apostrophe or the word REM, that offer explanations for each preceding line or lines. VBScript
keywords appear in bold.
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
REM Dim is used to declare variables and means dimension. In VBScript you can use Dim,
REMPublic, or Private to declare variables. As VBScript has no built-in data types (like
REMinteger, string, etc.), all variables are treated as variants, which can store any type of REM
information. In this example, the three variables will be used as objects. When REM recording
scripts in Q3D Extractor, variants that will be used as objects always begin with o.
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
’ You can use Set to assign an object reference to a variable. A copy of the object is not ’ created
for that variable. Here CreateObject is a function that takes a string as input ’ and returns an
object. The object is assigned to the variable oAnsoftApp.
oDesktop.NewProject
’ In VBScript, a Sub procedure is a procedure that is called by name, can receive arguments, ’
and can perform a specific task with a group of statements. Here the Sub procedure ’ NewPro-
ject of the object oDesktop is called. This Sub does not take an input.
For additional Ansys Electronics Desktop script examples, see Example Scripts.
Introduction to IronPython
IronPython is an implementation of the Python programming language targeting the .NET
runtime. What this means in practical terms is that IronPython uses the Python programming lan-
guage syntax and standard python libraries and can additionally use .NET classes and objects
to give one the best of both worlds. This usage of .NET classes is fairly seamless in that a class
defined in a .NET assembly can be used as a base class of a python class.
Scope
Functioning as a tutorial on Python or IronPython is way out of the scope of this document.
There are several excellent resources online that do a very good job in that regard. This doc-
ument only attempts to provide a limited introduction to IronPython as used to script Ansys EM
products.
This document is also not a tutorial on the scripting of Ansys EM products. It complements the
existing scripting guide (available from a product's Help menu) and provides a pythonic inter-
pretation of that information. The reader might have to refer to either the scripting guide or recor-
ded samples of VBScript to follow some of the sections.
Python compatibility
The version of IronPython in use is 2.7 and built on the .NET framework version 4.0: this version
targets Python 2.7 language compatibility. While most python files will execute under
IronPython with no changes, python libraries that make use of extensions written in the C pro-
gramming language (NumPy or SciPy for instance), are not expected to work under IronPython.
In such cases, it might be possible to locate .NET implementation of such libraries or explore the
use of IronClad.
(http://code.google.com/p/ironclad/).
Advantages of IronPython
The advantages that IronPython use provides are significant:
l Python has a large eco-system with plenty of supporting libraries, Visual IDEs and debug-
gers. It is actively developed and enhanced.
l IronPython, in addition, has access to the entire .NET eco system. This allows us, for
instance, to create a modern GUI using the System.Windows.Forms assembly from
IronPython code and call any other .NET assembly for that matter.
l The use of IronPython's technologies enables the ability to interactively script Desktop
(feature in development). This allows better discovery of the scripting APIs as well as dir-
ectly programming to the scripting API in python, a language more tractable and platform
independent compared with VBScript.
l The Python syntax of dictionaries is somewhat easier to read and write when supplying
arguments to the scripting methods.
This document describes IronPython briefly and then goes on to describe the desktop provided
IronPython scripting console and scripting with IronPython. You can open an IronPython Com-
mand Window by clicking Tools > Open Command Window.
The document assumes that you know how desktop scripting works using VBScript or Javas-
cript.
Introduction to IronPython
IronPython Mini Cookbook
Translating Script Commands from VBScript to IronPython
Scripting Using Iron Python
Standalone IronPython and Desktop IronPython
IronPython Examples
Creating User Defined Primitives and User Defined Models in Python Scripts
IronPython Mini Cookbook
This topic presents simple counterparts between IronPython and VBScript. It does not provide a
full tutorial on IronPython syntax. Because IronPython is a Python implementation, you can
VBScript IronPython
Comments start with a single quote: Comments start with a hash:
' comment # comment
Assigning/Creating Variables
VBScript IronPython
Declare with a Dim: No Set syntax. Simply create and assign:
Dim doc doc = app.GetActiveProject()
Assignment then needs a Set instruction:
Set doc = app.GetActiveProject()
Create Lists/Arrays
VBScript IronPython
Declare as array of String with 11 indices, Declare an empty array:
from 0 through 10:
myEmptyArray = []
Dim myArray(0 to 10) as String
Declare an array and initialize it with 5 ints:
myArray(0) = "Hello"
myInitedArray = [ 1, 2, 3, 4, 5]
myArray(1) = "bye"
Python lists can have items of any type and
Declare an array with no size: there is no pre-declaration. Declare an array
and init with mixed types:
Dim array2() as String
mixed = ["hello", 1 ,2 ["nested"]]
Re-dimension an array once size is known:
Append to an array:
ReDim array2(0 to 2) as String
mixed.append( 3.5 )
array2(0) = "this"
array2(1) = "also"
Create Dictionaries/Maps
VBScript IronPython
Declare with a Dim: An IronPython dictionary is a collection of
name value pairs. Just like arrays, there is no
Dim dict restriction on the keys or the values. For pur-
Use the CreateObject function with ProgID poses of Ansys EM scripting, however, all
Scripting.Dictionary: keys must be strings
Boolean Values
VBScript IronPython
Boolean literals are in lower case: The first letter is capitalized:
true True
false False
VBScript IronPython
Use CInt, CDbl, CBool, CLng to convert the Use integer() or float() or double() functions to
string representation to the number rep- cast a string CONTAINING the string rep-
resentation. Use IsNumber to check before resentation of whatever you are casting to:
conversion:
strInt = "3"
Dim nStr = "100"
intVal = int(strVal)
Dim n = CInt(nStr)
floatVal = float(strVal)
Use CStr to convert a number to its string rep-
resentation: Invoke the str() function with the int/float values
as needed. You can alternately use the string
Dim v, vStr formatting method listed below:
v = 100 strVal = str(42)
vStr = CStr(v) strVal = str(42.345)
String Formatting/Concatenation
VBScript IronPython
String concatenation uses the & operator: If you have two strings, you can always con-
catenate them using the '+' operator:
Dim allStr, str1
str1 = "hello"
str1 = " how are you"
str2 = "world"
allStr = "Hello " & " There" & str1
str12 = str1 + " " + str2
There seems to be no direct string formatting
function in VBScript. Ssing string con- If you have different types (for instance a string
catenation or using Replace are the two built-in and an int), you must use the string formatting
options: commands. When formatting multiple argu-
ments, they must be entered as a tuple ( item1,
Dim fmt = "{1} climbs stalk {2}" item2, ):
Dim str = Replace(fmt, "{1}", "jack") num = 10
str = Replace(str, "{2"}, 10) str3 = "%s climbs stalk %d" % ("jack", num)
str4 = "%d stalks" % num
VBScript IronPython
Dim myArray(0 to 2) as String vals = [1, 3, 3.456]
myArray(0) = "alpha"
myArray(1) = "bravo" def process(val):
myArray(2) = "charlie" return 2*val
VBScript IronPython
To loop over a range, specify start, end, and for i in range(0, 10):
step:
print i
For i = 0 To 10 Step 1
Print i
Next
Related Topics:
Indentation in IronPython
Methods in IronPython
Introduction to IronPython
IronPython Samples
Indentation in IronPython
Python is a language where white space (spaces and tabs) is syntactically significant. You must
understand the basics of indentation before scripting in python.
Any statement that introduces a block of code should be written so that every line of the block
has the same indent (leading spaces or tabs) and the indent should be at least one more than
the indent of the introducing statement.
Note:
Indenting Functions
Each line that belongs to the body of this function should have an indent that is more than the
indent used by the if statement.
def multInt(a,b):
If a%2 == 0:
return (a * b) + 100
else:
return (a * b) + 1000
Methods in IronPython
Finding Methods
Once you know a function name, you can get more help on it using the built-in help method.
Related Topics
Introduction to IronPython
Translating Script commands from VBScript to IronPython
Scripting Using Iron Python: Putting it all Together
IronPython Samples
Translating Script Commands from VBScript to IronPython
This topic briefly describes scripting methods and arguments via VBScript samples. The dis-
tinctions made here are significant and useful when translating scripts written in VBScript to
IronPython.
Related Topics
Script Method Argument
VBscript Method Call Types
Converting VBScript Function calls to IronPython Syntax
Introduction to IronPython
IronPython Mini Cookbook
Scripting Using Iron Python
IronPython Samples
Script Method Argument
Script method calls in VBscript generally take the form:
objectName .methodName ( arg1, arg2, ...)
The function call syntax is a standard followed by several programming languages. However,
the argument types in VBScript objects used for product scripting are restricted to the following:
l Primitive Types
l Named Arrays
l Named Functions
Primitive Types
Primitive types are the standard bool, int, float, double, and string.
Named Arrays
Named arrays are a special construct used very commonly and can be found in many recorded
script samples.
A named array begins with Array("NAME:someName" followed by a collection of comma sep-
arated values which can be:
l Primitive values
l Arrays of primitive values
l Additional named arrays
l Keys, in the form "keyName:=" followed by a primitive value or function
Named Functions
Named functions are arrays which start with Array( and do not have a leading "NAME:name"
item. They are always introduced by a key and can contain comma separated values of the
following type:
l A primitive value
l A key (of the form "keyName:=") followed by
o A primitive value
o Another function (nested function)
Related Topics
Translating Script commands from VBScript to IronPython
VBScript Method Call Types
VBScript method calls fall into two categories and the distinction between the two results in syn-
tax differences. These syntax differences are significant when converting VBScript to
IronPython.
VBScript Functions
In VBScript terminology, functions return values. The syntax for this is one shared with prac-
tically all programming languages:
Set oDesktop = oAnsoftApp.GetAppDesktop()
Set oProject = oDesktop.NewProject
Note:
If there are arguments, the method name is always followed by an argument list
enclosed in parentheses. If the argument list is empty, as shown above for the NewPro-
ject call, the parentheses can be omitted.
VBScript Sub-Routines
VBScript subroutines are those that do not have any return value. VBScript allows these to be
written without any parentheses even if they have a non-empty argument list.
oModule.CreateReport "XY Plot1", "Standard", "XY Plot", "optimtee
: optimtee", _
Array("Domain:=", "Sweep"), Array("Freq:=", Array("All"), "off-
set:=",_
Array("0uin")), Array("X Component:=", "Freq", "Y Component:=", _
Array("dB20(S(1,1))", "dB20(S(1,2))", "dB20(S(1,3))", _
"dB20(S(2,1))", "dB20(S(2,2))", "dB20(S(2,3))", "dB20(S(3,1))",
"dB20(S(3,2))", "dB20(S(3,3))")), Array()
Related Topics
Translating Script commands from VBScript to IronPython
Converting VBScript Function calls to IronPython Syntax
When used for scripting, IronPython function names are always followed by parentheses.
So:
l If you see a VBScript snippet that looks like a VBScript subroutine, remember to add par-
entheses.
l If you see a VBScript function that has no arguments and no parentheses, remember to
add them around an empty argument list.
The parentheses change is the only one to keep in mind when converting VBScript function calls
syntax to IronPython.
Return Values
VBscript return values are sometimes assigned via the Set declaration. IronPython return values
are simple assignment (See: Iron Python Mini Cookbook).
Primitive Method Arguments
While it is generally not allowed to replace arrays and nested arrays with Python dictionaries, in
the case where the named array consists entirely of key value pairs, you can use a dictionary
and avoid typing the trailing := symbols after the keys. This further aids readability of the script.
l If all key value pairs
l Remove the trailing := after each key
l Replace the , after the key with a :
l If the named array is the top level argument, ensure that the NAME:name is present and is
split into NAME : name as a key value pair
l Enclose the converted array in a { } pair to declare the dictionary.
[ "NAME:name",
"key1:=" , 1,
"key2:=" , 2,
["NAME:name2", "R:=", 255]
]
Sample Script: Named array with nested named array in array syntax
The above named array with a nested named array (after conversion to IronPython as named
array) can be converted to a dictionary as well. The dictionary can take any of the following forms
{ "NAME" : "name",
"key1" : 1,
"key2" : 2,
"name2" : ["NAME:name2", "R:=", 255]
}
Sample Script: Named array with nested named array as mixed dictionary + array
{ "NAME" : "name",
"key1" : 1,
"key2" : 2,
"name2" : {"R" : 255}
}
Sample Script: Named array with nested named array in all dictionary syntax
{ "NAME" : "name",
"key1" : 1,
"key2" : 2,
"name2" : {
"NAME" : "name2",
"R" : 255
}
}
Function Blocks
Function blocks in VBScript argument syntax are represented as arrays without the "NAME:.."
field. However, functions are always introduced by a key in a parent structure. Function blocks
can therefore never exist as a top-level argument. They are only found as the value pairs inside
a named array or inside another function block.
Important:
Function blocks and their items cannot be converted to dictionaries even though they
might be composed entirely of key value pairs.
The reason for this is the need to main the user-entered order. Every item in a function block is
expect to be transmitted to the script method in exactly the same order as typed out and this is
impossible to achieve when a dictionary is used (as the keys get reordered according to the dic-
tionary's internal tree/key sorting scheme).
When you see a function block, simply replace the Array( ) delimiters with python array delim-
iters [ ]
Scripting Using Iron Python
If you have existing VBScript/Javascript scripts use existing scripts them as much as possible by
either embedding the test into the IronPython script or invoking them.
Translating a script in VBScript to IronPython
Read the chapter on translation and study the samples in that chapter as well as those in the
appendix. For python syntax and the differences, the mini-cookbook chapter will also be useful.
Writing an IronPython script from scratch
Read through the scripting guide available from the product's help menu and translate the
VBScript methods described to IronPython using the information provided in the chapter on
translation. Studying the samples in the document will also prove helpful.
For python syntax and the differences, the mini-cookbook chapter will also be useful.
IronPython Script Execution Environment
Scripting using Embedded VBScript or JavaScript
Scripting with IronPython
Related Topics
Introduction to IronPython
IronPython Mini-cookbook
Translating Script commands from VBScript to IronPython
Appendix: IronPython Samples
IronPython Script Execution Environment
Scripts written in IronPython are executed by desktop in four different ways:
l Tools > Open Command Window, to open the IronPython Command Window:
l Tools > Run Script menu item, select "IronPython" from the file type drop-down list.
l Launch the product with a script argument.
o HFSS -runscript someScript.py to keep HFSS GUI open after completing script exe-
cution.
o HFSS -features=beta -ng -runscriptandexit someScript.py to run HFSS in a non-
graphical mode and exit after script completion. Note that this is a beta feature sup-
ported for the HFSS and 3D Layout design types.
l Register an IronPython script as an external tool using the Tools > External Tools menu
item.
When desktop executes a script, it does so in an execution environment setup with predefined
variables and functions. These predefined variables and functions are how the script com-
municates with the desktop, and they come in four flavors addressed in the following subtopics:
Script Argument for IronPython
Script Argument for IronPython
When scripts are launched using the Tools > Run Script menu item, the dialog that pops up
allows the user to specify arguments.
Related Topics
IronPython Script Execution Environment
Scripting using Embedded VBScript or JavaScript
Since script recording is still done in VBScript and users are expected to have a significant col-
lection of VBScript or JavaScript assets, it is useful to continue to use existing script files and
snippets even when scripting in IronPython. The various Run<*>Command methods have been
designed for this purpose.
For instance: one can create a parameterized cone in HFSS by executing the following
IronPython script from the Tools > Run Script menu.
# assign the VBScript snippet obtained from a script recording from
HFSS to
# coneScript and replace the BottomRadius recorded value with botRa-
dius
coneScript = """Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.GetActiveProject()
oProject.InsertDesign "HFSS", "HFSSPyTestDesign", "DrivenModal", ""
Set oDesign = oProject.SetActiveDesign("HFSSPyTestDesign")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateCone Array("NAME:ConeParameters", _
"XCenter:=", "0mm", "YCenter:=", "0mm", "ZCenter:=", "0mm",_
"WhichAxis:=", "Z", "Height:=", "2mm", _
"BottomRadius:=", "3mm", _
"TopRadius:=", "0mm"), Array("NAME:Attributes", "Name:=", _
"Cone1", "Flags:=", "", "Color:=", "(132 132 193)", "Trans-
parency:=", 0, _
"PartCoordinateSystem:=", "Global", "UDMId:=", "", "Mater-
ialValue:=", _
"" & Chr(34) & "vacuum" & Chr(34) & "", "SolveInside:=", _
true)
"""
SetScriptingLanguageToVBScript()
RunScriptCommand(coneScript)
Sample Script 11: Hybrid VBScript + IronPython scripting: parameterized Cone Creation
Even though recorded VBScript is used for scripting, the incremental functionality that is
provided using IronPython is the ability to write a GUI using IronPython/.NET, collect information
from the user and then modify or generate the VBScript commands to actually script the Ansys
EM desktop. This GUI functionality is cross platform and a significant positive. The following
example demonstrates a contrived use of a .NET window form to display the argument supplied
to the IronPython script (via the ScriptArgument variable).
clr.AddReference("System.Windows.Forms")
_button = Button()
_button.Text = "Close"
_button.Dock = DockStyle.Bottom
_button.Click += self._buttonPressed
self.Controls.Add(self._label)
self.Controls.Add(_button)
def _buttonPressed(self,sender,args):
self.Close()
#----------------------------------------------------
# Main script code
#----------------------------------------------------
#display the ScriptArgument variable as the text label
# in the form.
gui = ShowPropertiesForm("Sample Form", ScriptArgument)
Related Topics
IronPython Script Execution Environment
Scripting with IronPython
While this section talks about directly interacting with the script objects, note that you can
execute VBScript or Javascript at any point using any of the available Run*Command functions.
using your existing script assets in this fashion and mixing with IronPython code for new func-
tionality as needed is a viable and option.
Access to the application scripting objects is provided via the predefined oDesktop object (as lis-
ted in Script Objects). Interacting with the script objects is very natural, method calls are made
just like in VBScript except that the argument syntax is somewhat simplified to follow natural
Python syntax. All primitive types (string, integer, double) map to the natural primitive types in
python. The only differences from the VBScript syntax are seen when specifying array type argu-
ments. The differences are described in earlier chapters.
Note:
The typical VBScript calls to obtain the registered COM scripting interface via
CreateObject calls and then obtain the oDesktop object from it using the GetAp-
pDesktop() is not needed (or even supported on all platforms). Since all scripting
occurs in the context of a running workbench, the available Desktop object is always
provided and expected to be used directly.
Scripting using the IronPython scripting API is very much like scripting with VBScript except that
l Any argument is supplied via the built in ScriptArgument variable
l The oDesktop object is always available
l The scripting method names are identical to the ones used with VBScript
l Method calls, while the name is the same have to adhere to the rule of ensuring trailing
parentheses irrespective of whether the function returns anything or has any arguments.
l Any compound/block arguments should be translated to the appropriate IronPython array
or dictionary syntax.
The samples section lists a collection of pure IronPython snippets: these, along with the various
script snippets listed in this document should serve as a guide and reference.
Related Topics
IronPython Script Execution Environment
Standalone IronPython and Desktop IronPython
Standalone IronPython
In general, it is easier to run a script directly from Electronics Desktop. Standalone IronPython
does not implement all the functionality available when a script is run from Electronics Desktop.
It only implements full support for COM functions.
Running Standalone IronPython
Standalone IronPython uses COM to get the handle to the AnsysEDT app. To run standalone
IronPython, you’ll need to call the IronPython interpreter ipy64.exe.
It is located in:
\\<AnsysEDTInstallationPath>\common\IronPython\ipy64.exe
For example, to run myScript.py, type the following in the command line:
"C:\Program Files\AnsysEM\v231\Win64\common\IronPython\ipy64.exe"
"<filePath>\myScript.py"
You can set the interpreter to be the default program when double-clicking the .py script. You
can use any recorded script as the basis for a standalone script and simply add an installation-
internal path to the python module search path (as shown below) and end the script with a new
shutdown call.
Using a Recorded Script
A python script recorded in AnsysEDT already has the required lines to be run as a standalone,
except for the first two lines (path settings) and the final Shutdown() call. See the example
script below.
Creating an External Script
When creating a script outside of Electronics Desktop, the following lines should be included at
the beginning of your script:
l import sys
l sys.path.append("<InstallationPath>")
# Adds the Electronics Desktop installation path to the list of directories Python searches
for modules and files.
l sys.path.append("<InstallationPath>/PythonFiles/DesktopPlugin")
l import ScriptEnv
# This imports ScriptEnv.py from the installation path specified above. ScriptEnv.py per-
forms an operating system check and defines functions used in Electronics Desktop
scripts. See the annotations in the ScriptEnv.py file for more information.
l ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
or ScriptEnv.InitializeNew(NonGraphical=True)
# Initialize and InitializeNew are functions within ScriptEnv.py. The first option
launches Electronics Desktop. The second allows you to run a script without launching
Electronics Desktop. See the annotations in the ScriptEnv.py file for more information.
l ScriptEnv.Shutdown()
# This stops ScriptEnv.py. If you are running multiple scripts, include this only at the end of
the last script.
Example Script
import sys
sys.path.append(r"C:\Program Files\AnsysEM\v231\Win64")
sys.path.append(r"C:\Program Files\An-
sysEM\v231\Win64\PythonFiles\DesktopPlugin")
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oProject = oDesktop.NewProject()
oProject.InsertDesign("HFSS", "HFSSDesign1", "DrivenModal", "")
oDesign = oProject.SetActiveDesign("HFSSDesign1")
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateRectangle(
[
"NAME:RectangleParameters",
"IsCovered:= ", True,
"XStart:= ", "-0.2mm",
"YStart:= ", "-3mm",
"ZStart:= ", "0mm",
"Width:= ", "0.8mm",
"Height:= ", "1.2mm",
"WhichAxis:= ", "Z"
],
[
"NAME:Attributes",
"Name:= ", "Rectangle1",
Change property
The following snippets show how a change property command (in this case, to change the color
of a cone) looks in VBScript and its two possible IronPython variants.
oEditor.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geo-
metry3DAttributeTab",_
Array("NAME:PropServers", "Cone1"), _
Array("NAME:ChangedProps", _
Array("NAME:Color", "R:=", 255, "G:=", 255, "B:=", 0))))
Sample Script 13: ChangeProperty command to change color of a cone in VBScript
oEditor.ChangeProperty(
["NAME:AllTabs",
["NAME:Geometry3DAttributeTab",
["NAME:PropServers", "Cone1"],
["NAME:ChangedProps",
["NAME:Color", "R:=", 0, "G:=", 0, "B:=", 64]
]
]
])
Sample Script 14: ChangeProperty command to change color of cone using Python
arrays
Any time there are named arrays composed purely of key-value pairs, they can always be rep-
resented using a Python dictionary, irrespective of the nesting of said named array.
oEditor.ChangeProperty(
["NAME:AllTabs",
["NAME:Geometry3DAttributeTab",
["NAME:PropServers", "Cone1"],
["NAME:ChangedProps",
{
"NAME":"Color",
"R" : 0,
"G" : 64,
"B" : 0
}]]
])
Sample Script 15: ChangeProperty command to change the color of a cone using
Python arrays and dictionaries
Most scripting tasks using IronPython are expected to be formatted as the following example.
One starts with the predefined oDesktop object and drills down to the design, editors, modules
etc and issues any required commands on the object while formatting the script command argu-
ments in natural python syntax.
oProject = oDesktop.GetActiveProject()
oDesign = oProject.InsertDesign("HFSS","Random","DrivenModal","")
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateCone(
{
"NAME" : "ConeParameters",
"XCenter" : "0mm",
"YCenter" : "0mm",
"ZCenter" : "0mm",
"WhichAxis" : "Z",
"Height" : "2mm",
"BottomRadius" : "1.56204993518133mm",
"TopRadius" : "0mm"
},
{
"NAME" : "Attributes",
"Name" : "Cone1",
"Flags" : "",
"Color" : "(132 132 193)",
"Transparency" : 0,
"PartCoordinateSystem": "Global",
"UDMId" : "",
"MaterialValue" : "\"vacuum\"",
"SolveInside" : True
}
)
Sample Script 16: IronPython script to create a cone
Create geometry and then create a grid from it using copy/paste/move
The following script demonstrates slightly more advanced use of scripting and the use of return
values from script methods. It creates a 5x5 grid of cones and also demonstrates the adding of
information messages to the application's message window.
oProject = oDesktop.GetActiveProject()
oDesign = oProject.InsertDesign("HFSS","Hersheys Kis-
ses","DrivenModal","")
oEditor = oDesign.SetActiveEditor("3D Modeler")
coneBotRad = "1.5mm"
oEditor.CreateCone(
{
"NAME" : "ConeParameters",
"XCenter" : "0mm",
"YCenter" : "0mm",
"ZCenter" : "0mm",
"WhichAxis" : "Z",
"Height" : "2mm",
"BottomRadius": coneBotRad,
"TopRadius" : "0mm"
},
{
"NAME" : "Attributes",
"Name" : firstConeName,
"Flags" : "",
"Color" : "(132 132 193)",
"Transparency" : 0,
"PartCoordinateSystem": "Global",
"UDMId" : "",
"MaterialValue" : "\"vacuum\"",
"SolveInside" : True
}
)
# position
if x == 0 and y == 0:
continue
# copy first
oEditor.Copy(
{
"NAME" : "Selections",
"Selections" : firstConeName
}
)
Related Topics
Introduction to IronPython
IronPython Mini-cookbook
Translating Script commands from VBScript to IronPython
Scripting Using Iron Python: Putting it all Together
Creating User Defined Primitives and User Defined Models in Python
Scripts
You can create User Defined Primitives and User Defined Models in Python scripts (based on
the IronPython implementation).
Advantages Compared to C++
l No need to create and build project; all you need to do is create a Python script
l Python script is platform independent
l Scripts can inherit functionality from existing scripts
l Garbage collector - no need to free memory
l Easy debugging
Changes compared to C
Though methods, constants and structures are kept as close to the C implementation as pos-
sible, some changes had to be made to make code Python-compatible.
Structures
l Structure instances are created using the supplied constructors and members are
accessed using the provided access methods.
For a complete list of structures and examples please see UDP/UDM Structures.
Return Values for UDM and UDP Functions
For information on return values for each UDM and UDP function, see the Return Values sec-
tion.
Constants
Enumeration/Enum constants have almost the same names as in C but the enum must be qual-
ified by the type. Additionally, redundant "UDP", "UDM" or type prefixes have been removed.
This allows for better human-readability.
# Example of specifying the LengthUnit enum by qualifying it
# with the type of the enum: UnitType
unitType = UnitType.LengthUnit
For a complete list of enum constants please see UDP/UDM Constants.
Methods
l If there is more than one out variable, the function will return a Python tuple with all output
parameters in the specified order. If function has a return value, it must always be the first
in the tuple.
# one output parameter; return value is ignored
udmDefinition = udmFunctionLibrary.GetDefinition()
C Python
bool getDefinition(UDMDefinition* udmDefinition = udmFunctionLibrary.GetDefinition()
udmDefinition,
void* callbackData );
(Note: callbackData is omitted in py interface)
l If function has input 'List' parameter and input 'list size' parameter, 'list size' parameter will
be omitted.
l If function has output 'List' parameter and output 'list size' parameter, 'list size' parameter
will be omitted.
l If function has output 'List' parameter and input 'list size' parameter, 'list size' parameter
won't be omitted as it's needed for memory allocation in the corresponding C++ function
from the UDP/UDM function library.
Example:
# input list, input list size
lret = udpFunctionLibrary.Unite(objectIds)
C Python
bool getAllFaces( long partId, faceIds = udmFunc-
tionLibrary.GetAllFaces(partId)
long* numFaces,
long** faceIds,
void* callbackData);
(ignore numFaces as redundant: fol-
ded into faceIds,
where numFaces and faceIds are output parameters return value is omitted: folded into the
and numFaces is the size of faceId. faceIds is None check
callbackData is omitted)
long unite( long numObjects, lret = udpFunctionLibrary.Unite
(objectIds)
long* objectIds,
void* callbackData);
C Python
and numObjects is the size of objectIds. callbackData is omitted)
long detachFaces( long nSize, (lret, partIdList) = udpFunc-
tionLibrary.DetachFaces(nSize,
long* faceIds, faceIds)
long* partIds,
void* callbackData);
Added Parameters
C Python
long duplicateAlongLine( (lret, cloneIds) = udmFunctionLibrary.DuplicateAlongLine(partId,
long partId, transVec, nClones, cloneIdsSize)
UDPVector transVector,
int nClones,
long* nClones, (callbackData is omitted
void* callbackData); cloneIdsSize is a new parameter)
long duplicateAroundAxis( (lret, cloneIds) = udmFunctionLibrary.DuplicateAroundAxis
(partId, axis, angle, nClones, cloneIdsSize)
long partId,
UDPCoordinateSystemAxis
axis,
C Python
double angle, (callbackData is omitted
int nClones, cloneIdsSize is a new parameter)
long* nClones,
void* callbackData);
Developing a UDM/UDP
Creation
To create a User Defined Primitive in Python you write a Python script that implements UDPEx-
tension class. To create a User Defined Model in Python you write a Python script that imple-
ments UDMExtension class (see links for full description).
Location
The scripts are located the same way the C based UDM/UDP are. They are expected to be
under the UserDefinedParts or UserDefinedModels sub-directories of one of the library folders
(SysLib, UserLib or PersonalLib). They will then appear under the appropriate menu items:
Draw > User Defined Primitives for UDP or Draw > User Defined Model for UDM.
The sub-directories structure created in one of the specified directory will be displayed in the
UDP/UDM menu.
Keep in mind that there is no difference between the menu display for C and Python imple-
mentations of UDM or UDP - only the file names without extensions are displayed
Organize
"Lib" sub-directory is a special directory. The contents of this directory is not shown in the menu.
In the "Lib" directory you can create Python scripts with base classes and utilities to be used in
UDP/UDM Python scripts. All the Lib directories upstream of a script (till the UserDefinedModels
or UserDefinedPrimitives) are included in the Python search path and this allows for easy import
of helper modules in such directories.
To use UDM data structures, constants, and/or classes in your Lib sub-directory scripts you
have to add import statement to the scripts:
For UDM:extension:
from UDM import *
For UDP:extension:
from UDP import *
Edit/Reload
Python is a scripting language, so if you have errors in your script, you will see them at the time
you try to run the script. The errors will be displayed in the Message Manager Window. If you
need more information, you might be able to get it from log files. See: Debug Logging.
You can always change your script, call Update Menu command from Draw > User Defined
Model > menu or Draw > User Defined Primitives > menu and run the script again. If you
delete script you might want to restart the application instead of calling Update Menu.
UDPExtension
Import
You do not have to add import statements for the predefined classes, structures, and constants -
it is done for you and all data types described in this document can be used in your Python script.
However you have to add import statements to your helper scripts in your Lib sub-directory.
from UDP import *
You must write a class derived from IUDPExtension with a mandatory name UDPExtension:
class UDPExtension(IUDPExtension):
The class should implement IUDPextension methods described below.
IUDPExtension methods
All methods are same as the methods in the C UDP implementation. The changes to the meth-
ods signatures are just to conform to the Python style.
Mandatory methods.
These methods must be implemented in the UDP Python script as methods of UDPExtension
class.
GetLengthParameterUnits()
l returns string.
GetPrimitiveTypeInfo()
l returns UDPPrimitiveTypeInfo.
GetPrimitiveParametersDefinition2()
AreParameterValuesValid2(errorMsg, udpParams)
CreatePrimitive2(funcLib, udpParams)
Optional methods
GetPrimitiveParameters()
GetRegisteredFaceNames()
GetRegisteredEdgeNames()
GetRegisteredVertexNames()
ProjectParametersOnToValidPlane2(currentUDPParams, projectedUDPParams)
l currentUDPParams is a list of UDPParam
l projectedUDPParams is a list of UDPParam
l returns True on success, False on failure.
MapParametersDefinitionVersions2(oldVersion, oldUDPParams)
l oldVersion is a string
l oldUDPParamsis a list of UDPParam
l returns Python list of UDPParam or NULL
GetOldPrimitiveParametersDefinition2(version )
l version is a string
l returns a list of UDPPrimitiveParameterDefinition2 or None on failure.
Example UDP
import sys
class UDPExtension(IUDPExtension):
def GetLengthParameterUnits(self):
return "mm"
def GetPrimitiveTypeInfo(self)
typeInfo = UDPPrimitiveTypeInfo(
name = "SampleUDP",
purpose = "example",
company="Ansys",
date="12.21.12",
version = "1.0")
return typeInfo
...
...
UDMExtension
Import
You do not have to add import statements for the predefined classes and structures - it is done
for you, and all data types described in this document can be used in your Python script.
However you have to add import statements to your helper scripts in your Lib sun-directory.
You must write a class derived from IUDMExtension with a mandatory name UDMExtension:
class UDMExtension(IUDMExtension):
The class should implement IUDMExtension methods described below.
IUDMExtension methods
All methods are the same as the methods in the C UDM implementation. The changes to the
methods signatures are just to conform to the Python style.
Mandatory methods.
These methods must be implemented in the UDM Python script as methods of UDMExtension
class.
GetInfo()
IsAttachedToExternalEditor()
CreateInstance(funcLib)
l funcLib is UDMFunctionLibrary
l returns UDMParameters.
GetUnits(instanceId)
l instanceId is a long
l returns string containing units for the instance.
l updatedParams: UDM script can change the UDM parameters it receives. Updated para-
meters need to be sent back to desktop. If the UDM script is not going to change any of
the parameters that it received, it needs to copy udmInParams to updatedParams.
l refreshModifiedPartsOnly is a boolean
Supporting this flag is optional. For UDMs where the refresh performance is not an issue,
it is recommended to ignore this flag and update all parts every time.
This flag can be used to optimize performance of Refresh method when the model created
by UDM is large. If the UDM consists of multiple parts, and new parameters change only a
few parts amongst them, UDM script can only modify parts that are changed by the new
parameters.
l nonEditedPartRefIds: If RefreshModifiedPartsOnly is true and the UDM script supports
partial update, Refresh method needs to return ids of parts that are unchanged.
ReleaseInstance(instanceId)
l instanceId is a long
l This should release any resources assigned to this particular instance of UDM.
l returns True on success, False on failure.
GetAttribNameForEntityId()
l Returns string that acts as a the name of the attribute containing entity IDs.
l For example, it can return a unique string such as "ATTRIB_XACIS_ID"
l Python UDMs should implement this method.
GetAttribNameForPartId()
l Returns string that acts as a the name of the attribute containing entity IDs.
l For example, it can return a unique string such as "ATTRIB_XACIS_ID" (Can be same as
GetAttribNameForEntityId())
l Python UDMs should implement this method.
Optional methods
These methods have default implementations (default is to return NULL or FALSE depending on
the return type) but can be overridden by the user as needed as methods of UDMExtension
class.
DialogForDefinitionOptionsAndParams(self, defData, optData, params):
l instanceId is a long
l returns string containing source information of UDM instance. It is used to create initial
name for UDM instance.
ShouldAttachDefinitionFilesToProject()
class UDMExtension(IUDMExtension):
def IsAttachedToExternalEditor(self):
return False
def GetInfo(self)
udmInfo = UDMInfo(
name = "SampleUDM",
purpose = "udm example",
company="Ansys",
date="12.21.12",
version = "1.0")
return udmInfo
...
...
UDMFunctionLibrary
UDMFunctionLibrary implements IUDMFunctionLib interface. The IUDMFunctionLib object is
passed as a parameter to Python script in the following functions
l CreateInstance
l Refresh
You can call any of the functions from the functions list (shown below).
partRefId = udmFunctionLib.GetPartRefId(partId)
For example sample code that calls GetBoundingBox in Python script can look like this:
partId = 10
exact = True
udpPosition = UDPPosition(0,0,0)
if bret:
udpPosition.X = udpPositionLow.X
As you can see udpPositionLow and udpPositionHigh output parameters are defined in the call
to GetBoundingBox function. There is no need to define them before the function call.
Functions list:
In addition to the above functions all functions defined in the UDPFunctionLib are available in the
IUDMFunctionLib and can be called directly exactly the same way as the IUDMFunctionLib func-
tions.
Example:
udmFunctionLib.CreateCircle(center,radius,ratio,isCovered)
UDM/UDP Functions
Return Values for Each UDM and UDP Function
ID – ID of created Object
SI – Success Indicator. Identifies whether or not operation was successful.
Functions list:
UDP/UDM Structures
Instead of containing arrays of data, the structures contain single fields where each field
corresponds to an item in a different array from the original C API. The structure objects
thus constructed are added to the Python list. Alternately the Python list can be initialized
using the structure objects.
udmParamList = [
UDMParameter(
"cubeSizeName", UnitType.LengthUnit,
UDPParam(ParamDataType.Double, cubeSize),
ParamPropType.Value,
ParamPropFlag.MustBeReal),
UDMParameter(
"cubeDistanceName", UnitType.LengthUnit,
UDPParam(ParamDataType.Double, cubeDistance),
ParamPropType.Value,
ParamPropFlag.MustBeReal),
UDMParameter("numCubesName", UnitType.LengthUnit,
UDPParam(ParamDataType.Int, numCubes),
ParamPropType.Number,
ParamPropFlag.MustBeInt]
l UDPParam
l UDPParamData
Data field in UDPParam is now an object - the same for all types of data used - as Python
can work with any type of data.
UDPParamData is obsolete, thus not implemented. Be sure to set proper data type to
UDPParam.DataType when setting UDPParam.Data.
Example:
nCubes = nCubesParam.Data
distanceParam = UDPParam()
distanceParam.setDouble(10.5)
doubleDistance = distanceParam.Data * 2
l UDP3x3Matrix
The structure is not implemented. Use size 9 Python List of doubles instead.
Example:
List of structures
You can use constructors to create a structure. You can also modify fields - directly or by
provided methods.
Example:
pos1 = UDPPosition(1,2,3)
pos2 = UDPPosition(x=1,y=10,z=0)
pos2.Z = pos1.Z
udpParam = UDPParam(ParamDataType.Double,1)
value = udpParam.Data
methods:
setInt(int val)
setBool(bool val)
setString(string val)
setDouble(double val)
UDP/UDM Constants
##############################################################
# Class Implementation
##############################################################
class UDPExtension(IUDPExtension):
def CreatePrimitive2(self, func_lib, param_values):
"""
Inbuilt function that is called to generate a UDP after suc-
cessful validation
:param func_lib: drawing inbuilt class, see in Help: UDMFunc-
tionLibrary
:param param_values: list of udp parameter values (user
input) generated by UDP Core
:return: None
"""
param_dict = self.get_param_dict(param_values)
start_point = UDPPosition(0, 0, 0)
box = func_lib.CreateBox(start_point, [
param_dict["x_size"],
param_dict["y_size"],
param_dict["z_size"]
])
edges = [func_lib.GetEdgeIDFromPosition(UDPPosition(point
[0], point[1], point[2])) for point in points]
def GetPrimitiveTypeInfo(self):
return primitive_info
def GetLengthParameterUnits(self):
return length_units
def GetPrimitiveParametersDefinition2(self):
return primitive_param_definitions
# Custom Functions
def get_param_value_by_name(self, param_values, param_name):
"""
Function to get a value of a single parameter accessing it
by name
:param param_values: list of udp parameter values (user
input) generated by UDP Core
:param param_name: name of the parameter as specified in
definition list
:return: Value of the parameter or None if parameter does
not exist
"""
param_dict = self.get_param_dict(param_values)
value = param_dict.get(param_name, None)
return value
"""
udm_param_def = self.GetPrimitiveParametersDefinition2()
param_dict = {}
for i, param in enumerate(udm_param_def):
param_value = param_values[i].Data
if str(param.PropType) != "Menu":
param_dict[param.Name] = param_value
else:
param_dict[param.Name] = param_value.replace('"',
'').split(",")[0]
return param_dict
One advantage of CPython is the large set of libraries and tools that are available. See below for
instructions on modifying a script so that it can be launched with CPython interpreters.
Important:
Important:
CPython client scripting is not yet supported on Linux, though ansysedt -grpcsrv can be
used to launch an Electronics Desktop instance on Linux, which can be connected to or
from a Windows machine via Initialize().
import sys
# Imports the sys module containing system-specific func-
tions native to Python.
sys.path.append(r"<InstallationPath>/PythonFiles/DesktopPlugin")
# Adds the PythonFiles/DesktopPlugin subfolder to the list
of directories Python searches for modules and files.
Those lines are followed by:
import ScriptEnv
# This imports ScriptEnv.py from the installation path spe-
cified above.
Follow that with:
l Either InitializeNew() or Initialize(), as described below.
l Any desired Electronics Desktop scripting commands.
l Closing command, as described below.
Note:
InitializeNew() will always launch a new instance of Electronics Desktop. Please use Ini-
tialize() to connect to an existing instance. See below.
Related Topics:
1-75
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oAnsoftApp
The oAnsoftApp object provides a handle for Iron Python or VBscript to access the
Ansoft.ElectronicsDesktop product.
In Iron Python, for example:
oAnsoftApp = CreateObject('Ansoft.ElectronicsDesktop')
In VBscript, for example:
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
oDesktop
The oDesktop object is used to perform desktop-level operations, including project man-
agement.
In Iron Python, for example:
oDesktop = oAnsoftApp.GetAppDesktop()
In VBscript, for example:
Set oDesktop = oAnsoftApp.GetAppDesktop()
For script commands recognized by the oDesktop object, consult: Desktop Object Script Com-
mands.
oProject
The oProject object corresponds to one project open in Electronics Desktop. It is used to
manipulate the project and its data. Its data includes variables, material definitions, and one or
more designs.
In Iron Python, for example:
oProject = oDesktop.GetActiveProject()
In VBscript, for example:
Set oProject = oDesktop.GetActiveProject()
Consult the following for details about script commands recognized by oProject:
l Project Object Script Commands
l Property Script Commands
l Dataset Script Commands
oDesign
The oDesign object corresponds to a design in the project. This object is used to manipulate
the design and its data, including variables, modules, and editors.
In Iron Python, for example:
oDesign = oProject.GetActiveDesign()
In VBscript, for example:
Set oDesign = oProject.GetActiveDesign()
Consult the following for details about script commands recognized by oDesign:
l Design Object Script Commands
l Output Variable Script Commands
l Reporter Editor Script Commands
oEditor
The oEditor object corresponds to an editor, such as the 3D Modeler, Layout, or Schematic
editor. This object is used to add and modify data in the editor.
In Iron Python, for example:
oEditor = oDesign.SetActiveEditor('3D Modeler')
In VBscript, for example:
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
Consult the following for details about script commands recognized by oEditor:
l 3D Modeler Editor Script Commands
l Schematic Editor Script Commands
Important:
There is no Reporter Editor object for oEditor. Reporter Editor commands are
executed by oDesign.
oModule
The oModule object corresponds to a module in the design. Modules are used to handle a set of
related functionalities.
In IronPython, for example:
oModule = oDesign.GetModule('BoundarySetup')
In VBscript, for example:
Set oModule = oDesign.GetModule("BoundarySetup")
Consult the following for details about script commands recognized by oModule:
1. Click Tools > Run Script, or select the Automation tab and click the Run Script icon:
2. Use the file browser to locate the script file (*.vbs, *.py, or *.js).
3. If desired, type script arguments in the Script Arguments field:
You can access script arguments using the AnsoftScriptHost.arguments collection from
VBScript. This is a standard COM collection.
4. Click Open.
While script execution is in progress, the Run Script button transforms into a Stop Script
button. Click Stop Script to stop the script execution.
To temporarily pause a running script, click Pause Script. This button transforms into a
Resume Script button, which you can click to resume script execution.
End if
on error goto 0
// At this point, args has the arguments regardless of col-
lection
msgbox "Count is " & args.Count
for i = 0 to args.Count - 1
msgbox args(i)
next
Recording a Script
Electronics Desktop can record a script based on UI actions and save this script in either
IronPython (*.py) or VBscript (*.vbs) format.
Scripts can be saved to an external file, or to the project.
Important:
When you record a script, every subsequent action you take is recorded. You must
manually stop recording.
1. Click Tools > Record Script to File, or select the Automation tab and click the Record
Script icon:
5. Click Save.
The Record Script button transforms into a Stop Recording button, and Electronics
Desktop begins recording your actions.
1. Click Tools > Record Script to Project, or select the Automation tab and use the
Record Script drop-down menu to select Record Script to Project.
2. Enter a name for the script in the text box, then click OK.
3. Perform the steps you want to record.
4. When you have finished, click Stop Recording, or select Tools > Stop Script Record-
ing.
The recorded script is saved to scriptname.vbs in the Scripts library and can be accessed
from the Project Manager. See: Working with Project Scripts.
Individual scripts appear in this folder. Right-click a script to edit or run it:
You can also run project scripts from the Automation tab by selecting Run Script > Project
Scripts > [Script Name].
Note:
Project scripts are stored in the project scripts library. Refer to the topic "Managing
Library Contents" for information on working with libraries.
Each of the library directories can be specified in Electronics Desktop under Tools > Options
> General Options, on the Project Options tab.
Electronics Desktop Scripting Conventions
A number of scripting conventions exist for Electronics Desktop regarding syntax, arguments,
and numerical values.
Consult the following topics:
l Named Arguments
l Setting Numerical Values
Named Arguments
Many Electronics Desktop script commands use named arguments. The names can appear in
three ways:
For example:
For example:
For example:
..., Array("NAME:Attributes",...),...
In the first and second examples, the name is formatted as "<Name>:=". This signals to Elec-
tronics Desktop that this is a name for the next argument in the script command. In the third
example, the name is formatted as "NAME:<name>" and is the first element of the array.
The names are used both to identify what the data means to you and to inform Electronics
Desktop which data is being given. The names must be included or the script will not play back
correctly. However, if you are writing a script, you do not need to pass in every piece of data that
the command can take. For example, if you are modifying a boundary, the script will be recorded
to include every piece of data needed for the boundary, whether or not it was modified. If you are
writing a script by hand, you can add only the data that changed and omit anything that you do
not want to change. Electronics Desktop will use the names to determine which data you
provided.
VBscript Example
For example, when editing an impedance boundary, Electronics Desktop records the EditIm-
pedance command as follows in VBscript:
oModule.EditImpedance "Imped1", Array("NAME:Imped1",
"Resistance:=", "100", "Reactance:=", "50",
"InfGroundPlane:=", false)
If you only wish to change the resistance, you can leave out the other data arguments when
manually writing a script:
oModule.EditImpedance "Imped1", Array("NAME:Imped1",
"Resistance:=", "100")
IronPython Example
When editing a port excitation, Electronics Desktop records the Edit command as follows
in IronPython:
oModule.Edit("Port1",
["NAME:Port1",
["NAME:Properties",
"PortSolver:=", "true",
"Phase:=", "0deg",
"Magnitude:=", "2mA",
"Impedance:=", "50Ohm",
"Theta:=", "0deg",
"Phi:=", "0deg",
"PostProcess:=", "false",
"Renormalize:=", "50Ohm + 0i Ohm",
"Deembed:=", "0mm",
"RefToGround:=", "false"
],
"Type:=", "EdgePort",
"IsGapSource:=", true,
"UpperProbe:=", false,
"LayoutObject:=", "Port1",
"Pin:=", "",
"ReferencePort:=", ""
]
)
If you only wish to change the magnitude, you can leave out the other data arguments when
manually writing a script:
oModule.Edit("Port1",
["NAME:Port1",
["Magnitude:=", "1mA"]
]
)
Setting Numerical Values
For script arguments that expect a number, the following options are possible:
l Pass in the number directly.
In IronPython:
oModule.EditVoltage('Voltage1', ['NAME:Voltage1',
'Voltage:=', 3.5])
In VBscript:
In IronPython:
oModule.EditVoltage('Voltage1', ['NAME:Voltage1',
'Voltage:=', '3.5V'])
In VBscript:
In IronPython:
var = 3.5
oModule.EditVoltage('Voltage1', ['NAME:Voltage1',
'Voltage:=', var]
In VBscript:
dim var
var = "3.5V"
Scripts Vis-
Callback ible from the Functions Callable
Event Event Call- from the Visible Script
back Script
Place Com- CompInstance CompInstance.GetParentDesign() — Returns a oDesign item
ponent that can be used to call Design functions.
1-91
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
The following deprecated commands are no longer supported and produce an error if used.
l GetDesiredRamMBLimit (deprecated)
l GetHPCLicenseType (deprecated)
l GetMaximumRamMBLimit (deprecated)
l GetMPISpawnCmd(deprecated)
l GetMPIVendor (deprecated)
l GetNumberOfProcessors (deprecated)
l GetUseHPCForMP (deprecated)
l SetDesiredRamMBLimit (deprecated)
l SetHPCLicenseType (deprecated)
l SetMaximumRamMBLimit (deprecated)
l SetMPISpawnCmd (deprecated)
l SetMPIVendor (deprecated)
l SetNumberOfProcessors (deprecated)
l SetUseHPCForMP (deprecated)
GetAppDesktop
GetAppDesktop is a function of oAnsoftApp. This function does not take an input and it returns an object. The object is assigned to the
variable oDesktop.
UI Access NA
VB Syntax GetAppDesktop()
VB Example Set oDesktop = oAnsoftApp.GetAppDesktop()
GetCustomMenuSet
GetDefaultUnit
GetDesktopConfiguration
GetDistributedAnalysisMachines
GetDistributedAnalysisMachinesForDesignType
GetExeDir
GetGDIObjectCount
GetLibraryDirectory
GetLocalizationHelper
GetMessages
GetPersonalLibDirectory
GetPPELicensingEnabled
GetProcessID
GetProjectDirectory
GetProjectList
GetProjects
GetRegistryInt
GetRegistryString
GetRunningInstancesMgr
GetSchematicEnvironment
GetScriptingToolsHelper
GetSysLibDirectory
GetTempDirectory
GetUserLibDirectory
GetVersion
IsFeatureEnabled
KeepDesktopResponsive
LaunchJobMonitor
NewProject
OpenAndConvertProject
OpenMultipleProjects
OpenProject
OpenProjectWithConversion
PauseRecording
PauseScript
Print
QuitApplication
RefreshJobMonitor
ResetLogging
RestoreProjectArchive
RestoreWindow
ResumeRecording
RunACTWizardScript
RunProgram
RunScript
RunScriptWithArguments
SelectScheduler
SetActiveProject
SetActiveProjectByPath
SetCustomMenuSet
SetDesktopConfiguration
SetLibraryDirectory
SetProjectDirectory
SetRegistryFromFile
SetRegistryInt
SetRegistryString
SetSchematicEnvironment
SetTempDirectory
ShowDockingWindow
Sleep
SubmitJob
Tile Windows
Related Topics:
AddMessage
Add a message with severity and context to message window.
UI Access N/A
ClearMessages
Clears messages, optionally specifying severity and design.
UI Access In Message Manager, right-click the project name and click Clear messages for Project#
CloseAllWindows
Closes all MDI child windows on the desktop.
VB Syntax CloseAllWindows
VB Example oDesktop.CloseAllWindows
CloseProject
Closes a specified project. Changes to the project are not saved. Save the project using the Project command Save or Save As
before closing to save changes.
CloseProjectNoForce
Use: Close a named project currently open in the Desktop, unless a simulation is running. Changes to the project will not be saved.
Save the project using the Project command Save or Save As before closing to save changes. To determine if the project has been
closed, use GetProjectList and see if the named project is present.
Count
Gets the total number of queried projects or designs obtained by GetProjects() and GetDesigns() commands.
UI Access N/A
Parameters None.
Return Value Integer
VB Syntax Count
VB Example Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Dim oProjects
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
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 - 1
msgbox designs(j).GetName()
next
next
DeleteProject
Deletes a project from disk.
DownloadJobResults
This command is for downloading results from Ansys Cloud. Before using this script command, the command SelectScheduler() must
be used first to select “ansys cloud” scheduler. This makes sure that current scheduler is Ansys Cloud, and user is logged in. Then,
either a valid .q file or .q.completed file must be in the project folder, or, a valid job ID and a “batchinfo” folder containing the cor-
responding .jobid file are required in the project folder. When the download requirements are met, the command downloads results
from Ansys Cloud using the specified filters to the given folder.
rent .q (or .q.completed) file, or inside the “batchinfo” folder in projectPath. If the
job ID is empty, the job ID in current .q (or .q.completed) file will be used.
<projectPath> String A string of path to locate the project folder. The project file may be not neces-
sary, but .q (or .q.completed) file or “batchinfo” folder with valid .jobid files are
required.
<resultPath> String A string giving the folder path for the download to save to.
<Filters> (optional) String A string containing filters to download. The delimiter of file types is “;”. If no filter
specified, the default filter “*” will be applied, which requests all files for down-
load.
DeleteRegistryEntry
Deletes a registry entry from a registry key. Returns true if deletion succeeded.
UI Access N/A
Boolean:
Return Value l True – Key has been deleted.
l False – Key does not exist.
DoesRegistryValueExist
Determines whether a registry value exists.
UI Access N/A
Boolean:
Return Value l True – Key exists.
l False – Key does not exist.
VB Syntax DoesRegistryValueExist(<KeyName>)
VB Example bExist = oDesktop.DoesRegistryValueExist("Desktop/ActiveDSOConfigurations/HFSS")
EnableAutoSave
Enable or disable autosave feature.
UI Access N/A
ExportOptionsFiles
Copies the options config files to the DestinationDirectory.
GetActiveProject
Obtains the project currently active in the Desktop, as an object.
Note:
UI Access N/A
Parameters None.
Return Value Object: the project that is currently active in the desktop.
VB Syntax GetActiveProject
VB Example Set oProject = oDesktop.GetActiveProject
GetActiveScheduler
Obtains the name of the scheduler active in the Desktop.
Note:
UI Access N/A
Parameters None.
Name of the scheduler that is currently active in the desktop. Gets results such as "RSM", "Remote RSM",
Return Value
"Ansys Cloud", "SLURM", "LSF", "PBS", "SGE", "Windows HPC", etc. (User-friendly scheduler names.)
VB Syntax GetActiveScheduler
VB Example Set oSchedulerName = oDesktop.GetActiveScheduler
GetActiveSchedulerInfo
Obtains info for the scheduler active in the Desktop.
Note:
UI Access N/A
Parameters None.
Info for the scheduler that is currently active in the desktop or a remote scheduler. Gets results such as "RSM",
"Remote RSM", "Ansys Cloud", "SLURM", "LSF", "PBS", "SGE", "Windows HPC", as well as server info used to
Return Value select a server. For a local scheduler, the return format resembles '{"Selected Scheduler":"RSM","Scheduler
Name":"RSM","Server":""}'. For a remote scheduler, the return format resembles '{"Selected Sched-
uler":"Remote RSM","Scheduler Name":"SLURM","Server":"<server>"}'
VB Syntax GetActiveScheduler
VB Example Set oSchedulerInfo = oDesktop.GetActiveSchedulerInfo
GetAutoSaveEnabled
Checks whether the autosave feature is enabled.
UI Access N/A
Parameters None.
Integer:
Return Value l 1 – Autosave is enabled.
l 0 – Autosave is not enabled.
VB Syntax GetAutoSaveEnabled
VB Example Enabled = oDesktop.GetAutoSaveEnabled()
GetBuildDateTimeString
Returns a string representing the build date and time of the product;
UI Access N/A
Parameters None.
String build date and time, in the format: year-month-day hour:minute:second.
Return Value
Example: 2019-01-18 21:59:33
VB Syntax GetBuildDateTimeString
GetCustomMenuSet
Returns the name of the current selected menu set in Tools > Options > General Options > General > Desktop Configuration.
UI Access N/A
Parameters None.
Return Value String containing current menu set. For example, 'Default', 'EM', ‘Twin Builder’.
VB Syntax GetCustomMenuSet
VB Example Set oProject = oDesktop.GetCustomMenuSet
GetDefaultUnit
Returns the default unit for a physical quantity.
Tools > Options > General Options > Default Units. Note that this menu only displays units that can be
UI Access
changed, while the script can be used to view additional default units.
l "MomentInertia"
l "Power"
l "Pressure"
l "PressureCoefficient"
l "Resistance"
l "SaturateMagnetization" (Magnetic Inductance)
l "Speed"
l "Temperature"
l "Time"
l "Torque"
l "Voltage"
l "VoltageChangeRate"
l "Volume"
l "VolumeFlowPerPressureRoot"
l "VolumeFlowRate"
Return Value String containing the default unit (for example, "mm").
VB Example oDesktop.GetDefaultUnit("Length")
GetDesktopConfiguration
Returns the name of the current selected configuration in Tools > Options > General Options > General > Desktop Configuration.
UI Access N/A
Parameters None.
Return Value String containing current Desktop configuration. For example, 'All', ‘Twin Builder’.
VB Syntax GetDesktopConfiguration
VB Example Set oProject = oDesktop.GetDesktopConfiguration
GetDistributedAnalysisMachines
Gets a list of machines used for distributed analysis. You can iterate through the list using standard VBScript methods.
UI Access N/A
Parameters None.
Return Value Returns a collection of names of machines used for distributed analysis.
VB Syntax GetDistributedAnalysisMachines
VB Example oDesktop.GetDistributedAnalysisMachines()
GetDistributedAnalysisMachinesForDesignType
To obtain a list of the machines set up for analysis of the specified design type.
UI Access NA
("HFSS")
GetExeDir
Returns the path where the executable is located.
UI Access N/A
Parameters None.
String path where executable is located.
Return Value
Example: 'C:/Program Files/AnsysEM/v231/Win64/'
VB Syntax GetExeDir
VB Example oDesktop.GetExeDir
GetGDIObjectCount
Note:
This command is for internal Ansys use only.
VB Syntax GetGDIObjectCount()
VB Example oDesktop.GetGDIObjectCount()
GetLibraryDirectory
Get the path to the SysLib directory.
UI Access NA
String
Return Value
The path to the SysLib directory.
VB Syntax GetLibraryDirectory
VB Example MsgBox oDesktop.GetLibraryDirectory
VB Example:
------------------------------------------------------
message box returns the path in this example
------------------------------------------------------
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
libdir = oDesktop.GetLibraryDirectory
msgbox(oDesktop.GetLibraryDirectory())
GetLocalizationHelper
Note:
This command is for internal Ansys use only.
UI Access NA
Object
Return Value
Localization helper object, such as "IDispatch(ILocalizationHelper)"
VB Syntax GetLocalizationHelper
VB Example oDesktop.GetLocalizationHelper()
GetMessages
Get the messages from a specified project and design.
UI Access NA
GetPersonalLibDirectory
Get the path to the PersonalLib directory.
UI Access N/A
Parameters None.
Return Value String path to the PersonalLib directory.
VB Syntax GetPersonalLibDirectory
VB Example oDesktop.GetPersonalLibDirectory
GetPPELicensingEnabled
Returns whether the PPE licensing is enabled.
UI Access N/A
Parameters None.
Boolean:
Return Value
l True – PPE licensing is enabled.
VB Syntax GetPPELicensingEnabled
VB Example oDesktop.GetPPELicensingEnabled
GetProcessID
Returns the process ID of ansysedt.exe.
UI Access N/A
Parameters None.
Return Value Integer process ID of ansysedt.exe. For example, 12716.
VB Syntax GetProcessID
VB Example oDesktop.GetProcessID
GetProjectDirectory
Gets the path to the Project directory.
UI Access N/A
Parameters None.
Return Value String path to the Project directory.
VB Syntax GetProjectDirectory
VB Example oDesktop.GetProjectDirectory
GetProjectList
Returns a list of all projects that are open in Electronics Desktop.
UI Access N/A
Parameters None.
Return Value Array of strings containing the names of all open projects in Electronics Desktop.
VB Syntax GetProjectList
VB Example list_of_projects = oDesktop.GetProjectList
GetProjects
Returns a list of all the projects that are currently open in Electronics Desktop. Once you have the projects, you can iterate through
them using standard VBScript methods.
UI Access N/A
Parameters None.
Return Value Returns a collection containing objects for all open projects in Electronics Desktop.
VB Syntax GetProjects
VB Example oDesktop.GetProjects
GetRegistryInt
Obtains registry key integer value.
UI Access N/A
Integer if the integer value is found. Return as Bad-Argument-Value if registry key does not exist or it is not an
Return Value
integer value.
Python GetRegistryInt(<KeyName>)
Syntax
num = oDesktop.GetRegistryInt('Desktop/Settings/ProjectOptions/HFSS/Up-
Python
dateReportsDynamicallyOnEdits')
Example
VB Syn- GetRegistryInt(<KeyName>)
tax
VB num = oDesktop.GetRegistryInt("Desktop/Settings/ProjectOptions/HFSS/Up-
Example dateReportsDynamicallyOnEdits")
GetRegistryString
Obtains registry key string value.
UI Access N/A
String if the string value is found. Return as Bad-Argument-Value if registry key does not exist or it is not a string
Return Value
value.
VB Syntax GetRegistryString(<KeyName>)
VB Example activeDSO = oDesktop.GetRegistryString("Desktop/ActiveDSOConfigurations/HFSS")
GetRunningInstancesMgr
Returns the object of the Running Instances Manager.
UI Access N/A
None
Object
Return Value
Running instances manager object
VB Syntax GetRunningInstancesMgr()
VB Example Set oRunningInstances = oDesktop.GetRunningInstancesMgr()
GetSchematicEnvironment
Returns the name of the current schematic environment set in Tools > Options > General Options > General > Desktop Con-
figuration.
UI Access N/A
Parameters None.
Integer representing a schematic environment:
l 0 = Circuit
Return Value
l 1 = Twin Builder
l 2 = Maxwell Circuit
VB Syntax GetSchematicEnvironment
VB Example Set oProject = oDesktop.GetSchematicEnvironment
GetScriptingToolsHelper
Note:
This command is for internal Ansys use only.
UI Access NA
Object
Return Value
ScriptingTools helper object
VB Syntax GetScriptingToolsHelper
VB Example oDesktop.GetScriptingToolsHelper()
GetSysLibDirectory
Get the path to the SysLib directory.
UI Access N/A
Parameters None.
Return Value String path to the SysLib directory.
VB Syntax GetSysLibDirectory
VB Example oDesktop.GetSysLibDirectory
GetTempDirectory
Gets the path to the Temp directory.
UI Access N/A
Parameters None.
Return Value String path to the Temp directory.
VB Syntax GetTempDirectory
VB Example oDesktop.GetTempDirectory
GetUserLibDirectory
Gets the path to the UserLib directory.
UI Access N/A
Parameters None.
Return Value Stringpath to the UserLib directory.
oDesktop.GetUserLibDirectory()
Python Example
VB Syntax GetUserLibDirectory
VB Example oDesktop.GetUserLibDirectory
GetVersion
Returns a string representing the version.
UI Access N/A
Parameters None.
Return Value String containing version of the product.
VB Syntax GetVersion()
VB Example oDesktop.GetVersion
IsFeatureEnabled
Returns a Boolean for whether a queried feature is enabled.
UI Access N/A
Parameters <FeatureID>.
Return Value Boolean for named feature.
Pytho- IsFeatureEnabled()
n Syn-
tax
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
feature_strs = ["SF3519", "F195709_EXPORT_TO_EMIT", "F362235_EMIT_RESULTS_WINDOW_
IMPROVEMENTS",_
"F136736_SBR_Rough_Surface", "F353006_VOLUMETRIC_SBR", "F359673_SBR_MULTISTATE_ARRAY",
Pytho- "F393115_SWE_ANTENNA",_
n
"S196592_SBR_Directivity", "F432541_VSBR_IMPROVEMENTS", "F353007_VRT_FILTERS_ENHANCE",
Exam-
ple
"S540337_SBR_REGION_LOSS_DIRECTIVITY",_
"F11941_VRT_CURRENT_DENSITY", "S544593_SBR_3D_COMPONENT_ARRAY", "F539850_SBR_GO_
BLOCKAGE", "F540275_SBR_RAYSTATS"]
results = [oDesktop.IsFeatureEnabled(str) for str in feature_strs]
result_txt = open("C:/Users/MyResults/Downloads/results.txt", "w")
for i in range(len(feature_strs)):
result_txt.write('%s : %s\n' % (feature_strs[i], results[i]))
result_txt.close()
VB Syntax GetVersion()
VB Example results = oDesktop.IsFeatureEnabled(SF3519)
KeepDesktopResponsive
Specifies the minimum number of milliseconds to keep the desktop from showing hung.
UI Access N/A
Return Value Boolean True for success and to keep running; False to indicate that the calling script should shut down.
LaunchJobMonitor
Use: For use in starting job monitoring. This brings up the Monitor Job dialog box.
VB Syntax LaunchJobMonitor()
VB Example oDesktop.LaunchJobMonitor("C:\\projects\\basic.aedt")
NewProject
Creates a new project. The new project becomes the active project.
oProject = oDesktop.NewProject()
Python Example
VB Syntax NewProject
VB Example Set oProject = oDesktop.NewProject
OpenAndConvertProject
Opens a legacy project and converts or copies it to .aedt format.
Return Value An object reference to the newly opened project which has the .aedt extension
Warning: If project file/results with the same name and .aedt extension already exist in the same directory, they will be overwritten.
OpenMultipleProjects
Opens all files of a specified type in a specified directory.
UI Access N/A
OpenProject
Opens a specified project.
OpenProjectWithConversion
Note:
This command is for internal Ansys use only.
PauseRecording
Temporarily stop script recording.
UI Access NA
VB Syntax PauseRecording
VB Example oDesktop.PauseRecording
PauseScript
Pause the execution of the script and pop up a message to the user. The script execution will not resume until the user chooses.
Print
Prints the contents of the active view window.
VB Syntax Print
VB Example oDesktop.Print
QuitApplication
Exits the desktop.
VB Syntax QuitApplication
VB Example oDesktop.QuitApplication
RefreshJobMonitor
For use in monitoring a job.
VB Syntax RefreshJobMonitor
VB Example oDesktop.RefreshJobMonitor
ResetLogging
Redirects simulation log file to a specified directory and log level.
UI Access N/A
RestoreProjectArchive
Restores a previously archived project to a specified path.
RestoreWindow
Restores a minimized Desktop window.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax RestoreWindow
VB Example oDesktop.RestoreWindow
ResumeRecording
Resume recording a script.
UI Access N/A
Parameters None.
Return Value None
VB Syntax ResumeRecording
VB Example oDesktop.ResumeRecording
RunACTWizardScript
Note:
This command is for internal Ansys use only.
RunProgram
Runs an external program.
UI Access NA
RunScript
Launches another script from within the script currently being executed.
This is the PersonalLib subdirectory in the project directory. The project dir-
ectory can be specified in the General Options dialog box (click Tools>Op-
tions>General Options to open this dialog box) under the Project Options
tab.
This is the userlib subdirectory in the library directory. The library directory can
be spec-ified in the General Options dialog box (click Tools>Op-
tions>General Options to open this dialog box) under the Project Options
tab.
This is the syslib subdirectory in the library directory. The library directory can
be speci-fied in the General Options dialog box (click Tools>Op-
tions>General Options to open this dialog box) under the Project Options
tab.
Long
Return Value
the return code for the script method.
RunScriptWithArguments
Similar to RunScript, launch another script from within the currently executing script, but with arguments.
UI Access NA
Long
Return Value
the return code for the script method.
oDesktop.RunScriptWithArguments
Python Example
("C:/Project/test2.py", "foo")
SelectScheduler
Selects the scheduler used for batch job submission. It tries non-graphical selection of the scheduler, attempting to get version inform-
ation from the scheduler in order to check for successful selection. If unable to get the information, it displays the Select Scheduler
window and waits for the user to complete the settings.
The selected scheduler (if selection was successful, this string should match the input option string, although it
Return Value
could differ in upper/lowercase).
SetActiveProject
Specifies the name of the project that should become active in the desktop. Returns that project.
UI Access N/A
SetActiveProjectByPath
Specifies the name of the project that should become active in the desktop. Returns that project. 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 unam-
biguous specification of the active project.
UI Access N/A
SetCustomMenuSet
Sets the custom menu set for Electronics Desktop.
Navigate to Tools > Options > General Options > General > Desktop Configuration. Select a configuration
UI Access
using the Custom Menu Set drop-down menu.
Parameters
l 'RF'
l 'RF.0'
l 'SI'
l 'SI1.0'
l 'SI2.0'
l 'Twin Builder'
VB Syntax SetCustomMenuSet(<customMenuSet>)
VB Example Set oProject = oDesktop.SetCustomMenuSet "EM"
SetDesktopConfiguration
Sets the desktop configuration.
Navigate to Tools > Options > General Options > General > Desktop Configuration. Select a configuration
UI Access
using the Set targeted configuration drop-down menu.
l 'SI'
l 'Twin Builder'
VB Syntax SetDesktopConfiguration(<configName>)
VB Example Set oProject = oDesktop.SetDesktopConfiguration "SI"
SetLibraryDirectory
Sets the library directory path. The specified directory must already exist and contain a syslib folder.
UI Access NA
SetProjectDirectory
Sets the project directory path.
UI Access N/A
SetRegistryFromFile
Configures registry by specifying an Analysis Configuration file which must have been exported from the HPC and Analysis panel.
UI Access N/A
Success if configuration is imported. Bad argument value if the file is not found or does not contain valid analysis
Return Value
configuration data.
SetRegistryInt
Sets registry key to an integer value.
UI Access N/A
Success if the key is defined as an integer. Bad argument value if a key is not defined, or if the value is a text
Return Value
string.
Python oDesktop.SetRegistryInt('Desktop/Settings/ProjectOptions/HFSS/Up-
Example dateReportsDynamicallyOnEdits', 0)
VB oDesktop.SetRegistryInt "Desktop/Settings/ProjectOptions/HFSS/Up-
Example dateReportsDynamicallyOnEdits", 0
SetRegistryString
Sets registry key to a string value.
UI Access N/A
Success if the key is defined as a text string. Bad argument value if the key is not defined or requires an integer
Return Value
value.
SetSchematicEnvironment
Sets the schematic environment for Electronics Desktop.
Navigate to Tools > Options > General Options > General > Desktop Configuration. Select a schematic
UI Access
environment using the Custom Menu Set drop-down menu.
VB Syntax SetSchematicEnvironment(<schEnv>)
VB Example Set oProject = oDesktop.SetSchematicEnvironment 2
SetTempDirectory
Sets the temp directory path. The directory will be automatically created if it does not already exist.
UI Access N/A
ShowDockingWindow
Shows or hides a docking window.
Sleep
Suspends execution of HFSS for the specified number of milliseconds, up to 60,000 milliseconds (1 minute).
UI Access NA
SubmitJob
Submits a batch job to a scheduler. When submitting the same project file multiple times, you should have the script wait for each job
(or jobs for multi-step) to finish, which can be done via the monitoring functions LaunchJobMonitor() and RefreshJobMonitor(), check-
ing the result of RefreshJobMonitor() in a loop until it returns completed ("Monitor Not Visible") status.
TileWindows
Arrange all open windows in a tiled format.
UI Access From main menu, Window >Tile Horizontally or Window >Tile Vertically.
l 1 – Tile horizontally.
1. Start HFSS.
2. Go to the DSO and HPC options and create a setup named "test".
3. Export the setup to a file (for example, c:\temp\test.acf).
4. Copy the exported file to a target PC (for example, f:\temp\test.acf).
5. Run the following script:
oDesktop.SetRegistryFromFile("f:\\temp\\test.acf")
oDesktop.SetRegistryString("Desktop/ActiveDSOConfigurations/HFSS", "test")
UI Access N/A
Boolean:
Return Value l True – Key has been deleted.
l False – Key does not exist.
DoesRegistryValueExist
Determines whether a registry value exists.
UI Access N/A
Boolean:
Return Value l True – Key exists.
l False – Key does not exist.
VB Syntax DoesRegistryValueExist(<KeyName>)
GetRegistryInt
Obtains registry key integer value.
UI Access N/A
Integer if the integer value is found. Return as Bad-Argument-Value if registry key does not exist or it is not an
Return Value
integer value.
Python GetRegistryInt(<KeyName>)
Syntax
num = oDesktop.GetRegistryInt('Desktop/Settings/ProjectOptions/HFSS/Up-
Python
dateReportsDynamicallyOnEdits')
Example
VB Syn- GetRegistryInt(<KeyName>)
tax
VB num = oDesktop.GetRegistryInt("Desktop/Settings/ProjectOptions/HFSS/Up-
Example dateReportsDynamicallyOnEdits")
GetRegistryString
Obtains registry key string value.
UI Access N/A
String if the string value is found. Return as Bad-Argument-Value if registry key does not exist or it is not a string
Return Value
value.
VB Syntax GetRegistryString(<KeyName>)
VB Example activeDSO = oDesktop.GetRegistryString("Desktop/ActiveDSOConfigurations/HFSS")
SetRegistryFromFile
Configures registry by specifying an Analysis Configuration file which must have been exported from the HPC and Analysis panel.
UI Access N/A
Success if configuration is imported. Bad argument value if the file is not found or does not contain valid analysis
Return Value
configuration data.
SetRegistryInt
Sets registry key to an integer value.
UI Access N/A
Success if the key is defined as an integer. Bad argument value if a key is not defined, or if the value is a text
Return Value
string.
Python oDesktop.SetRegistryInt('Desktop/Settings/ProjectOptions/HFSS/Up-
Example dateReportsDynamicallyOnEdits', 0)
VB oDesktop.SetRegistryInt "Desktop/Settings/ProjectOptions/HFSS/Up-
Example dateReportsDynamicallyOnEdits", 0
SetRegistryString
Sets registry key to a string value.
UI Access N/A
Success if the key is defined as a text string. Bad argument value if the key is not defined or requires an integer
Return Value
value.
ImportANFv2
Imports an ANFv2 file into a new project. For newer ANF files, use ImportANF.
ImportAutoCAD
Imports an AutoCAD file into a new project.
ImportAWRMicrowaveOffice
Imports an AWRMicrowaveOffice file into a new project.
oDesktop.RestoreWindow()
Set oTool = oDesktop.GetTool('ImportExport')
Python
Example oTool.ImportAWRMicrowaveOffice('C:/MyFiles/package4.xml', 'C:/MyFiles/package4.aedb',
'C:/MyFiles/package4.log')
Dim oAnsoftApp
VB Dim oDesktop
Example Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Dim oProjects
Dim omachine
Dim oTool
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oTool = oDesktop.GetTool("ImportExport")
oTool.ImportAWRMicrowaveOffice "C:/MyFiles/package4.xml", "C:/MyFiles/package4.aedb",
_
"C:/MyFiles/package4.log"
ImportEDB
Imports an EDB file into a new project.
oDesktop.RestoreWindow()
Python Example Set oTool = oDesktop.GetTool('ImportExport')
oTool.ImportEDB('C:/MyFiles/projectforimport.aedb/edb.def')
ImportExtracta
Imports a Cadence Extracta file into a new project.
Note:
In order for this script to work, you must have the Cadence-supplied executable Extracta.exe installed on your machine.
oDesktop.RestoreWindow()
Python
Set oTool = oDesktop.GetTool('ImportExport')
Example
oTool.ImportExtracta('C:/MyFiles/projectforimport.brd', 'C:/MyFiles/project.edb', '')
VB
Set oTool = oDesktop.GetTool("ImportExport")
Example oTool.ImportExtracta "C:/MyFiles/projectforimport.brd", "C:/MyFiles/project.edb", "")
ImportGDSII
Imports a GDSII file into a new project.
ImportGerber
Imports a GERBER file into a new project.
ImportIDF
Imports an IDF file into a new project. To merge with an existing design, use ImportIDFandMerge.
UI Access placeholder
oDesign.ImportIDF(
[
"NAME:Settings",
"Board:=" , "C:\\Users\\Model Files\\brd_board.emn",
"Library:=" , "C:\\Users\\Model Files\\brd_board.emp",
"Control:=" , "C:\\Users\\Model Files\\brd_board.xml",
"Filters:=" , ["HeightExclude2D"],
"CreateFilteredAsNonModel:=", False,
[
"NAME:definitionOverridesMap"
],
[
"NAME:instanceOverridesMap"
],
"HighSurfThickness:=" , "0.07mm",
Python Example
"LowSurfThickness:=" , "0.07mm",
"InternalLayerThickness:=", "0.07mm",
"NumInternalLayer:=" , 2,
"HighSurfaceCopper:=" , 30,
"LowSurfaceCopper:=" , 30,
"InternalLayerCopper:=" , 30,
"TraceMaterial:=" , "Cu-Pure",
"SubstrateMaterial:=" , "FR-4",
"CreateBoard:=" , True,
"ModelBoardAsRect:=" , True,
"ModelDeviceAsRect:=" , False,
"Cutoff:=" , False,
"IncludeDrilledHoles:=" , True,
"ReplaceDevices:=" , False
])
ImportIDFandMerge
Imports an IDF file into a new project. To import without merging, use ImportIDF.
UI Access File > Import > IDF. Enable Merge with existing and select a project/design.
ImportIDX
Imports and IDX model into a new Icepak project.
ImportIPC
Imports an IPC2581 file into a new project.
ImportODB
Imports an ODB++ file into a new project.
ImportXFL
Imports an XFL file into a new project.
3-102
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetAllRunningInstances
Returns a list of running instances of Ansys Electronics Desktop.
UI Access N/A
Parameters None.
Return Value Array containing list of Ansys Electronics Desktop instances.
VB Syntax GetAllRunningInstances
VB Example set obj = oRunningInstances.GetAllRunningInstances()
GetRunningInstanceByProcessID
Returns the instance of Ansys Electronics Desktop that is running a specified process.
UI Access N/A
GetRunningInstancesMgr
Returns the object of the Running Instances Manager.
UI Access N/A
Object
Return Value
Running instances manager object
VB Syntax GetRunningInstancesMgr()
VB Example Set oRunningInstances = oDesktop.GetRunningInstancesMgr()
4-4
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetEDBHandle
GetLegacyName
GetName [Project]
GetObjPath [Project]
GetPath
GetPropEvaluatedValue
GetPropNames [Project]
GetPropSIValue
GetPropValue [Project]
GetProperties
GetPropertyValue
GetTopDesignList
InsertDesign
InsertDesignWithWorkflow
InsertToolObject
Paste [Project Object]
Redo [Project Level]
Rename
RunToolkit
Save
SaveAs
SaveAsStandAloneProject
SaveProjectArchive
SetActiveDefinitionEditor
SetActiveDesign
SetPropValue [Project]
SimulateAll
Undo [Project]
UpdateDefinitions
AddDataset
Adds a dataset. This can be executed by the oProject, or oDesign variables.
[
"NAME:$ds1",
[
"NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 2,
"Y:=", 4
],
[
"NAME:Coordinate",
"X:=", 6,
"Y:=", 8
]
]
]
)
AddMaterial
Adds a local material.
<MaterialParams> Array [
Parameters
"NAME: <name of the material to be added>",
<MatProperty>, <MatProperty>, ...
]
<PropertyName> String Should be one of the following (depending on the material, design, and solution
types):
Electromagnetic (Maxwell-exclusive material properties omitted, see Max-
well Scripting help):
"permittivity", "permeability", "conductivity", "dielectric_loss_tan-
gent",
"magnetic_loss_tangent", "electric_coercivity", "magnetic_coer-
civity",
"saturation_mag", "lande_g_factor", "delta_H", "delta_h_freq",
"mass_density"
Thermal (including solids, Icepak fluid flow, and Mechanical rotating fluid
modeling):
"thermal_conductivity", "mass_density", "specific_heat",
"thermal_expansion_coefficient", "thermal_material_type", "vis-
cosity",
"diffusivity", "molecular_mass", "clarity_type"
Structural:
"mass_density", "youngs_modulus", "poissons_ratio",
"thermal_expansion_coefficient"
<Unit> String Possible values (Maxwell-exclusive properties omitted, see Maxwell Scripting
Help; other missing entries are unitless):
conductivity: "siemens/m"
saturation_mag: "uTesla", "mTesla", "tesla", "kTesla", "uGauss",
"mGauss", "gauss", "kGauss"
delta_H: "A_per_meter", "kA_per_meter", "Oe", "kOe"
delta_h_frequency: "Hz", "kHz", "MHz", "GHz", "THz", "rps", "per_sec"
mass_density: "kg/m^3"
thermal_conductivity: "W/m-C"
specific_heat: "J/kg-C"
youngs_modulus: "N/m^2"
thermal_expansion_coefficient: "1/C"
AddMaterial (["NAME:<MaterialName>",
Python Syntax
<MatProperty>, <MatProperty>, ...])
oDefinitionManager.AddMaterial(
["permittivity:=", "2.2", "0.002"])
oDefinitionManager.AddMaterial [("NAME:Material2",_
"dielectric_loss_tangent:=", "44",
Array("NAME:saturation_mag",_
Python Example
"property_type:=", "AnisoProperty",_
"unit:=", "Gauss",_
"component1:=", "11", _
"component2:=", "22", _
"component3:=", "33"), _
"delta_H:=", "44Oe")]
AddMaterial Array("NAME:<MaterialName>",
VB Syntax
<MatProperty>, <MatProperty>, ...)
oDefinitionManager.AddMaterial Array(
"permittivity:=", "2.2", "0.002")
oDefinitionManager.AddMaterial Array("NAME:Material2",_
"dielectric_loss_tangent:=", "44", Array("NAME:saturation_mag",_
VB Example
"property_type:=", "AnisoProperty",_
"unit:=", "Gauss",_
"component1:=", "11", _
"component2:=", "22", _
"component3:=", "33"), _
"delta_H:=", "44Oe")
AnalyzeAll [project]
Runs the project-level script command from the script, which simulates all solution setups and Optimetrics setups for all design
instances in the project. The UI waits until simulation is finished before continuing with the script.
VB Syntax AnalyzeAll
VB Example oProject.AnalyzeAll
]
])
oEditor.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Visualization",
[
"NAME:PropServers",
"LC1_1"
],
[
"NAME:ChangedProps",
[
"NAME:Object Attributes",
"ShowDielectric:=" , False,
"DisplayMode:=" , 0,
[
"NAME:ObjectAttributesInLayerMode",
"GND_1_L2:=" , [True,True,0],
"GND_2_L4:=" , [True,True,0],
"GND_3_L6:=" , [True,True,0],
"GND_4_L9:=" , [True,True,0],
"GND_5_L11:=" , [True,True,0],
"Inner_Layer_3_L10:=" , [True,True,0],
"Top_L1:=" , [True,True,0],
"VCC1_L7:=" , [True,True,0],
"VCC2_L8:=" , [True,True,0]
],
[
"NAME:ObjectAttributesInNetMode",
"GND:=" , [True,True,52],
"VCC:=" , [True,True,52],
"neg:=" , [True,True,52],
"pos:=" , [True,True,52]
],
[
"NAME:ObjectAttributesInObjectMode",
"line_1:=" , [True,True,20],
"line_2:=" , [True,True,20],
"line_3:=" , [True,True,20],
"line_4:=" , [True,True,53],
"rect_6:=" , [True,False,30],
"rect_17:=" , [True,True,53],
"rect_18:=" , [True,True,53],
"rect_19:=" , [True,False,53],
"rect_20:=" , [True,False,53],
"rect_21:=" , [True,False,30],
"rect_22:=" , [True,False,30],
"via_0:=" , [False,False,30],
"via_1:=" , [False,False,30],
"via_2:=" , [False,False,30],
"via_3:=" , [False,False,30]
]
]
]
]
])
The command can be used to create, edit, and/or remove properties. In Circuit, only Variable and Separator properties can be
deleted.
Command: None
Syntax: ChangeProperty Array("Name:AllTabs", <PropTabArray>, <PropTabArray>, ...)
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>, ...)
OR (for PropDisplay deletions only)
Array("Name:DeletedProps",<PropDataArray>,
<PropDataArray>, ...)
<PropDataArray>
Array("NAME:<PropName>",
"PropType:=", <PropType>,
"NewName:=", <string>,
"Description:=", <string>,
"Callback:=", <string>,
"NewRowPosition:=", <int>,
"ReadOnly:=", <bool>,
"Hidden:=", <bool>,
<PropTypeSpecificArgs>)OR (for PropDisplays only)
Array("Name:<PropName>",<PropDisplayData>)
<PropDisplayData>
for adding, changing, deleting PropDisplays
<PropDisplayAttributes>
for changing PropDisplays only
<PropDisplayNewAttributes>
<PropDisplayAttributes>
Layer & Location only used for PropDisplays in layout
For adding PropDisplays, this will add a single PropDisplay with attributes as shown; if an attribute is missing, a default
value will be assigned. Adding PropDisplay to schematic with attributes that are identical to one already existing there will
fail without an error message.
For deleting PropDisplays, these attributes are used to identify an existing PropDisplay to delete. If there doesn't exist a
PropDisplay that matches the given attributes, then nothing will be deleted. If multiple PropDisplays match the given attrib-
utes, then all of them will be deleted. If an attribute is missing, then all PropDisplays match that missing attribute. For
example, if Layer is missing, then PropDisplays on all layers that match the remaining given attributes will be deleted.
For changing PropDisplays, these attributes are used to identify an existing PropDisplay to change. If no PropDisplay match-
ing the attributes is found, no changes will be made. If multiple PropDisplays match the attributes, all of them will be
changed. If an attribute is missing, it matches all PropDisplays. For example, to change the format of PropDisplays that are
on the bottom, but have any layer, style or format to show the name only, this command should have Location set to "Bot-
tom" and all other attributes omitted.
"Format:=", <PropDisplayType>,
"Location:=", <PropDisplayLocation>,
"Layer:=", <string>,
"Style:=", <string>
<PropDisplayNewAttributes>
<PropDisplayType>
Type: string
Identifies the format of PropDisplay.
"Name"
"Value"
"NameAndValue"
"EvaluatedValue"
"NameAndEvaluatedValue"
<PropDisplayLocation>
Type: string
Identifies where PropDisplay is located with respect to object
"Left"
"Top"
"Right"
"Bottom"
"Custom"
<PropType>
Type: string
Identifies the type of property when a new property is added. In Circuit, only separator properties and variable properties
can be added.
"SeparatorProp"
"VariableProp"
"TextProp"
"NumberProp"
"ValueProp"
"CheckboxProp"
"MenuProp"
"PointProp"
"VPointProp"
"ButtonProp"
NewName
Specify the new name of a property if the property’s name is being edited. In Circuit, the name can only be changed for sep-
arators and variables.
Description
Specify a description of the property. In Circuit, the description can only be changed for separators and variables.
Callback
Specify the name of the script callback to be run when the property value is changed.
NewRowPosition
Used to reorder rows in the Property dialog box. In Circuit, this only applies to the Project>Project Variables panel and
the Designer>DesignProperties 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 Circuit, this flag can only be set for variables and sep-
arators.
Hidden
Used to hide a property so it can not be viewed outside of the Property dialog box. In Circuit, this flag can only be set for vari-
ables 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>
Material Button: "Material:=", <string>
Color Button: "R:=",<int>,"G:=",<int>,"B:=",<int>
Transparency Button: "Value:=", <double>
Parameters:
<OptimizationFlagsArray>
Array("NAME:Optimization",
"Included:=", <bool>,
"Min:=", <value>,
"Max:=", <value>)
<TuningFlagsArray>
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.
Max
High cut-off for the distribution.
Tol
Tolerance for uniform distributions. Format is "<int>%".
Example: "20%".
VB Example:
Adding a new project level variable "$width":
oProject.ChangeProperty Array("NAME:AllTabs",_
Array("NAME:ProjectVariableTab",_
Array("NAME:PropServers", "ProjectVariables"),_
Array("NAME:NewProps",_
Array("NAME:$width",_
"PropType:=", "VariableProp",_
"Value:=", "3mm",_
"Description:=", "my new variable"))))
Changing a property’s value. If the following command were executed, then the value of the prop-
erty "XSize" of the PropServer
"Box1:CreateBox:1" on the "Geometry3DCmdTab" tab would be changed. (oEditor is the Geometry3D
editor in Circuit.)
oEditor.ChangeProperty Array("NAME:AllTabs",_
Array("NAME:Geometry3DCmdTab",_
Array("NAME:PropServers","Box1:CreateBox:1"),_
Array("NAME:ChangedProps",_
Array("NAME:XSize", "Value:=", "1.4mil"))))
VB Example: Changing a property’s value. If the following command were executed, then the values
of Callback and L on the PassedParameterTab would be changed.
oEditor.ChangeProperty Array("NAME:AllTabs", _
Array("NAME:PassedParameterTab", _
Array("NAME:PropServers", "CHOKE2"), _
Array("NAME:ChangedProps", _
Array("NAME:L", "Callback:=", "ac", "OverridingDef:=", true), _
Array("NAME:L", "Value:=", "1nH"))))
VB Example: Changing the Company Name, Design Name, the background color, and the Axis scaling
in a Report.
VB Example: Changing a property’s value. Note that the AllChoices parameter is only used when the
MenuProp is being added. Also note that either a string of choices separated by commas or an
Array("choice1", "choice2", "choice3") works for the AllChoices parameter.
ClearMessages
Clears information in the Messages window.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax ClearMessages
VB Example oProject.ClearMessages
CloneMaterial
Clones a local material.
UI Access N/A
Boolean:
Return Value l 1 - Material is cloned.
l 0 - Existing material not found or a conflict with the new material name.
Close
Closes the active project.
Warning:
UI Access N/A
Parameters None.
Return Value None.
VB Syntax Close
VB Example oProject.Close
CopyDesign
Copies a specified design.
CutDesign
Cuts a design from the active project. The design is stored in memory and can be pasted.
Warning:
This is a legacy command that is no longer supported and should not be used as it may have unintended effects on solved
designs.
DeleteDataset
Deletes a specified dataset. This can be executed by the oProject, or oDesign variables.
DeleteDesign
Deletes a specified design in the project.
DeleteToolObject
Note:
This command is for internal Ansys use only.
UI Access N/A
EditDataset
Modifies a dataset. This can be executed by the oProject, or oDesign variables.
"X:=", 3, "Y:=", 4
]
]
]
)
oDesign.EditDataset ("ds1"
["NAME:ds2",
["NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 1, "Y:=", 2
],
[
"NAME:Coordinate",
"X:=", 3, "Y:=", 4
]
]
]
)
EditMaterial
Modifies an existing material.
[
"NAME:<all_thermal_modifiers or all_spatial_mod-
ifiers>",
[
"NAME:<modifierName>",
"Property::=" , <string property being mod-
ified>,
"Index::=" , <integer>,
"prop_modifier:=" , <"thermal_modifier" or
"spatial_modifier">,
"use_free_form:=" , <Boolean>,
"free_form_value:=" , <string modifier
value>,
]
]
]
]
oDefinitionManager.EditMaterial("alumina_92pct",
[
"NAME:alumina_92pct",
"CoordinateSystemType:=" , "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic","Thermal","Structural"]
],
"permittivity:=" , "9.3",
"dielectric_loss_tangent:=" , "0.008",
"thermal_conductivity:=" , "26",
"mass_density:=" , "3720",
"specific_heat:=" , "790",
"youngs_modulus:=" , "267000000000",
"poissons_ratio:=" , "0.26",
"thermal_expansion_coeffcient:=", "7.2e-006"
]
)
With Thermal Modifier:
oDefinitionManager.EditMaterial("copper",
[
"NAME:copper",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic","Thermal","Structural"]
],
[
"NAME:ModifierData",
[
"NAME:ThermalModifierData",
"modifier_data:=" , "thermal_modifier_data",
[
"NAME:all_thermal_modifiers",
[
"NAME:one_thermal_modifier",
"Property::=" , "permittivity",
"Index::=" , 0,
"prop_modifier:=" , "thermal_modifier",
"use_free_form:=" , True,
"free_form_value:=" , "if(Temp > 1000cel, 1, if(Temp < -273.15cel,
1, 1))"
]
]
]
],
"permeability:=" , "0.999991",
"conductivity:=" , "58000000",
"thermal_conductivity:=" , "400",
"mass_density:=" , "8933",
"specific_heat:=" , "385",
"youngs_modulus:=" , "120000000000",
"poissons_ratio:=" , "0.38",
"thermal_expansion_coefficient:=" , "1.77e-05"
])
Transient Solve, Non-linear Drude Data Plasma
# ----------------------------------------------
# Script Recorded by Ansys Electronics Desktop Version 2023.1.0
# 14:23:56 Jun 17, 2022
# ----------------------------------------------
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oProject = oDesktop.SetActiveProject("Drude_plasma_parameters_r231")
oDefinitionManager = oProject.GetDefinitionManager()
oDefinitionManager.EditMaterial("Drude",
[
"NAME:Drude",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic"]
],
[
"NAME:AttachedData",
[
"NAME:MatNonLinearDrudeFreqDepData",
"property_data:=" , "nonlinear_drude_data",
"EpsilonInfinity:=" , "1",
"PlasmaFrequency:=" , "4.62348462366278GHz",
"CollisionFrequency:=" , "0.00054491190162662GHz",
"FieldBreakdown:=" , "10000V_per_meter",
"PlasmaMaintainFrequency:=", "2.31174231183139GHz",
"NeutralDensity:=" , 2.65164580488373E+20,
"ElectronDensity:=" , 2.65164580488373E+17,
"CollisionRateConstant:=", 2.05499505485618E-15
]
]
])
Without Modifiers:
oDefinitionManager.EditMaterial "alumina_92pct",
Array(
VB
"NAME:alumina_92pct",
Example
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=", 1,
Array("NAME:PhysicsTypes",
"set:=", Array("Electromagnetic","Thermal","Structural")),
"permittivity:=", "9.3",
"dielectric_loss_tangent:=", "0.008",
"thermal_conductivity:=", "26",
"mass_density:=", "3720",
"specific_heat:=", "790",
"youngs_modulus:=", "267000000000",
"poissons_ratio:=", "0.26",
"thermal_expansion_coeffcient:=", "7.2e-006"
)
With Thermal Modifier:
oDefinitionManager.EditMaterial "copper",
Array("NAME:copper",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
Array("NAME:PhysicsTypes",
"set:=" , Array("Electromagnetic","Thermal","Structural")),
Array("NAME:ModifierData",
Array("NAME:ThermalModifierData",
"modifier_data:=" , "thermal_modifier_data",
Array("NAME:all_thermal_modifiers",
Array("NAME:one_thermal_modifier",
"Property::=" , "permittivity",
"Index::=" , 0,
"prop_modifier:=" , "thermal_modifier",
"use_free_form:=" , True,
"free_form_value:=" , "if(Temp > 1000cel, 1, if(Temp < -273.15cel,
1, 1))"
)
)
)
),
"permeability:=" , "0.999991",
"conductivity:=" , "58000000",
"thermal_conductivity:=" , "400",
"mass_density:=" , "8933",
"specific_heat:=" , "385",
"youngs_modulus:=" , "120000000000",
"poissons_ratio:=" , "0.38",
"thermal_expansion_coefficient:=" , "1.77e-05"
)
ExportDataset
Exports a dataset to a named file. This can be executed by the oProject, or oDesign variables.
ExportMaterial
Exports a local material to a library.
GetActiveDesign
Returns the design in the active project
UI Access N/A
Parameters None.
Return Value Object of the active design.
VB Syntax GetActiveDesign
VB Example Set oDesign = oProject.GetActiveDesign
GetArrayVariables
Returns a list of array variables. To get a list of indexed project variables, execute with oProject. To get a list of indexed local vari-
ables, use oDesign.
UI Access N/A
Parameters None.
Return Value Array of strings containing names of variables.
VB Syntax GetArrayVariables
oProject.GetArrayVariables
VB Example
oDesign.GetArrayVariables
GetChildNames [Project]
Returns the names of the project's child objects.
UI Access N/A
GetChildObject [Project]
Returns the project's child objects.
Note:
UI Access N/A
VB Syntax GetChildObject(<path>)
Set oProject = oDesktop.GetActiveproject()
VB Example
Set oDesign = oProject.GetChildObject(“TeeModel”)
GetChildTypes [Project]
Returns the types of the project's child objects.
UI Access N/A
Parameters None.
Return Value Array of string represents types of the child objects.
VB Syntax GetChildTypes
VB Example oProject.GetChildTypes
GetConfigurableData (Project)
Note:
This command is for internal Ansys use only.
GetDefinitionManager
Gets the DefinitionManager object.
UI Access N/A
Parameters None.
Return Value DefinitionManager object.
VB Syntax GetDefinitionManager
VB Example Set oDefinitionManager = oProject.GetDefinitionManager
GetDependentFiles
Provides a list of the external files referenced in the project, including characteristic (for example, MDX) and coupled project files.
UI Access N/A
Parameters None.
Return Value List of referenced files.
VB Syntax GetDependentFiles
VB Example files = oProject.GetDependentFiles
GetDesign
Returns the interface to a specific design in a given project.
UI Access N/A
GetDesigns
Obtains all designs in the current project.
UI Access N/A
Parameters None.
Return Value List of objects for all designs in the project.
VB Syntax GetDesigns
VB Example oProject.GetDesigns
GetEDBHandle
Returns the EDB handle for the project.
Important:
UI Access N/A
Parameters None.
Return Value String indicating the EDB handle for the project.
VB Syntax GetEDBHandle
VB Example oProject.GetEDBHandle
GetLegacyName
Obtains the legacy name of a project.
Note:
This command is for internal Ansys use only.
UI Access N/A
Parameters None.
Return Value String containing the legacy project name.
VB Syntax GetLegacyName
VB Example oProject.GetLegacyName
GetName [Project]
Obtains the project name
UI Access N/A
Parameters None.
Return Value String containing the project name, not including the path or extension.
VB Syntax GetName
VB Example oProject.GetName
GetObjPath [Project]
Obtains the project name from the full path.
UI Access N/A
Parameters None.
Return Value String containing only the project name.
VB Syntax GetObjPath
VB Example oProject.GetObjPath
GetPath
Returns the location of the project on disk.
UI Access N/A
Parameters None.
Return Value String containing the path to the project, not including the project name.
VB Syntax GetPath
VB Example oProject.GetPath
GetPropNames [Project]
Obtains the property name of the object. At the project level, GetPropNames always returns empty because the project is not asso-
ciated with any property.
UI Access N/A
VB Syntax GetPropNames
VB Example oProject.GetPropNames
GetPropValue [Project]
Returns the property value for the active project object, or specified property values.
UI Access N/A
GetProperties
Gets a list of all the properties belonging to a specific <PropServer> and <PropTab>. This can be executed by the oProject, oDesign,
or oEditor variables.
UI Access N/A
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
Return Value Array of strings containing the names of the appropriate properties.
GetPropertyValue
Returns the value of a single property belonging to a specific <PropServer> and <PropTab>. This function is available with the Project,
Design or Editor objects, including definition editors.
Tip:
Use the script recording feature and edit a property, and then view the resulting script to see the format for that property.
UI Access N/A
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<PropName> String Name of the property.
GetTopDesignList
Returns a list of top-level design names.
UI Access N/A
Parameters None.
Return Value List of strings containing name of top-level designs.
VB Syntax GetTopDesignList
VB Example oProject.GetTopDesignList
GetVariableValue
Gets the value of a single specified variable. To get the value of project variables, execute this command using oProject. To get the
value of local variables, use oDesign.
UI Access N/A
GetVariables
Returns a list of all defined variables. To get a list of project variables, execute this command using oProject. To get a list of local
variables, use oDesign.
UI Access N/A
Parameters None.
VB Syntax GetVariables
oProject.GetVariables
VB Example
oDesign.GetVariables
ImportDataset
Imports a dataset from a named file. This can be executed by the oProject, or oDesign variables. The name of the dataset is file-
name+index number (e.g., dsdata1) unless the filename ends with a trailing number. When there is a trailing number at the end, we
will remove the number and use first unused index.
Tab-delimited or space-delimited files with the extension ".tab" is the recommended file type to be used.
For importing datasets at the Design level, this is the only file type supported.
At the Project level, other file types (e.g., ".csv") are supported. However, after calling the command, you must configure the file import
format manually through the GUI as shown in the figure below.
oProject.ImportDataset('e:\tmp\dsdata.tab')
Python Example
oDesign.ImportDataset('e:\tmp\dsdata.tab')
InsertDesign
Inserts a new design in the project. For HFSS scripts, the last argument will always be empty.
InsertDesignWithWorkflow
Inserts a design with a named workflow and returns an IDispatch string.
UI Access N/A
InsertToolObject
Note:
This command is for internal Ansys use only.
VB Syntax Paste
VB Example oProject.Paste
VB Syntax Redo
VB Example oProject.Redo
RemoveAllUnusedDefinitions
Removes all unused project definitions.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax RemoveAllUnusedDefinitions
VB Example oProject.RemoveAllUnusedDefinitions
RemoveMaterial
Removes a material from a library.
RemoveUnusedDefinitions
Removes any unused project definitions.
"Al-Extruded"
],
[
"NAME:SurfaceMaterials",
"Steel-oxidised-surface"
]
])
VB RemoveUnusedDefinitions <Definitions>
Syntax
VB
oProject.RemoveUnusedDefinitions Array(Array("NAME:Materials", "Al-Extruded"), Array
Exampl- ("NAME:SurfaceMaterials", _
e "Steel-oxidised-surface"))
Rename
Renames the project and saves it. Similar to SaveAs().
Save
Saves the active project.
VB Syntax Save
VB Example oProject.Save
SaveAs
Saves the project under a new name. Requires a full path.
Note:
This script takes two parameters for non-schematic/layout designs and four parameters for schematic/layout designs.
oProject.SaveAs('D:/projects/project1.aedt', True)
Pytho- ----
n oProject.SaveAs('D:/Projects/Project1.aedt', True, 'ef_overwrite', ['NAME:Over-
Exam- rideActions', ['NAME:ef_copy_no_overwrite', ['NAME:Files',
ple
'$PROJECTDIR/circuit_models.inc']], ['NAME:ef_make_path_absolute', ['NAME:Files',
'$PROJECTDIR/SL_6s.sp']]])
Important:
The DefaultAction is applied to all files that are NOT explicitly listed in the OverrideActions array. Those in the Over-
rideActions array are separate arrays for actions that are different from the default action; those actions are applied to the
files listed in the same array:
l If OverrideActions are not specified, DefaultAction is applied to ALL files in project directory.
SaveAsStandAloneProject
Saves the project as a standalone copy.
Note:
This script is not supported when the application is being controlled by Ansys Workbench.
UI Access N/A
SaveProjectArchive
Saves the active project as an archive to the specified file path.
SetActiveDefinitionEditor
Obtains a specified definition editor.
UI Access N/A
SetActiveDesign
Sets a design to be the active design.
UI Access N/A
SetPropValue [Project]
Sets a property value for an active project's child object.
Boolean:
Return Value l True – property found.
l False – property not found.
oProject.SetPropValue("TeeModel/offset", "2mm")
Python
Example oProject.SetPropValue("TeeModel/Results/S Parameter Plot 1/Display Type", "Data
Table")
SetPropertyValue
Sets the value of a single propertybelonging to a specific PropServer and PropTab. This function is available with the Project, Design
or Editor objects, including definition editors.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.
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.
UI Access N/A
l ConstantsTab ("Constants")
l ComponentTab ("General")
l Component("Component")
l Quantities ("Quantities")
l Signals ("Signals")
<propServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<propName> String Name of the property.
SetVariableValue
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.
UI Access N/A
SimulateAll
Simulates all solution setups and Optimetrics setups for all design instances in the project. Script processing only continues when all
analyses are finished.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax SimulateAll
VB Example oProject.SimulateAll
Undo [Project]
Cancels the last project-level command.
VB Syntax Undo
VB Example oProject.Undo
UpdateDefinitions
Updates all definitions. The Messages window reports when definitions are updated, or warns when definitions cannot be found.
UI Access Tools > Project Tools > Update Definitions. Click Select All, then Update.
Parameters None.
Return Value None.
VB Syntax UpdateDefinitions
VB Example oProject.UpdateDefinitions
Object-Oriented Scripting
There are five basic functions that you use in Object Oriented scripting to retrieve and set properties:
1. GetChildNames()
2. GetChildObjects()
3. GetPropNames()
4. GetPropValue()
5. SetPropValue()
At a high level, use GetChildNames() to determine what object instances exist for a given object. An example is shown below to
demonstrate for an AEDT Project shown that has two Designs.
If you open the Command Window that allows for executing python code, you first define the Project Object, oProject, and the Design
Object, oDesign, as shown:
Once the objects have been defined, you can use GetChildNames() to learn what object instances exist for each. As an example,
observe the Child Names of oProject, and you see a list of the Designs in the AEDT Project, per the GUI.
As another example, retrieve the names of the Object Instances available in oDesign, to see the various objects associated with a
Design setup:
These names are what you would expect based on the Project Manager Layout:
In the Project Manager above, any object that has the ‘+’ symbol is populated with children that you can query. Once you know the
name of the object you want, you can instance it via the GetChildObject() command. This defines the instance to the desired object.
As an example, set an instance for the Excitations:
You now have an object, oExcitations defined to be the oDesign Child Object ‘Excitations’. What does this mean? If you expand the
Excitations dialogue in the Project Manager, you expect that the Child Names of this object would be the names of the Excitations as
defined, in this case six ports:
There is clear logic to the Object Child Names as the children of the oExcitations object as the ports that have been defined in HFSS.
Looking at the Project tree can help you to conceive and retrieve desired information.
Expand the first port to see its expected Child Object, its Terminal, in the Project Manager Window:
Through scripting, first define the Port Object (in this example, oPort) using the ‘GetChildObject()’ command for the first port, ‘BAW_
module1_SE1.’ Then determine its Object Child Name, the terminal definition:
As the use and logic for GetChildNames() and GetChildObject() have been demonstrated, you can now explore the properties of each
of these objects, if they exist. The function to determine what properties exist is GetPropNames(). Use this to determine what prop-
erties exist to be retrieved or modified for a given object. The properties available are readily identifiable in the Property window, by
default located beneath the Project Manager window. For example, if you select a given port object, ‘BAW_module1_SE1’ the Prop-
erty window populates as shown:
If you execute the GetPropNames() function on the previously defined object, oPort, you see the same Property Names as available
in the Properties window:
Once you identify the desired object and you know the desired property, you can access the value via GetPropValue(). For example, if
you want to retrieve the name of the object oPort:
To change the value of the property, use the SetPropValue() function. The arguments for this function are (‘Property Name’,’New
Value’). For example, to change the name of the port to ‘Bob’:
This function returns a Boolean ‘True’ if successful. The Project Manager window updates accordingly:
This approach for retrieving and setting properties is general and can be used for many aspects of an Ansys Electronics Desktop sim-
ulation. This Object-Oriented method of property identification and modification operates only on existing objects. Object-Oriented
scripting cannot create new instances; you must revert to the functions in a given Module to do that. Not all Children of a given object
may be accessible via the GetChildNames() command just yet. An example is given for Material property modification later in this App
Note. However, if you need specific objects you can reference details in the Scripting Help or reach out to an Application Engineer.
All materials with a Project Definition, or assigned to an object, in the Project are accessible. For example, assume you want to see the
conductivity of ‘copper.’ Follow the same flow as in the previous section:
The Material Property of interest is "Bulk Conductivity." So you create a "Cond" object to store the value and use the GetPropValue
function to obtain in. Then name the Cond object to see the value:
Retrieving Variables
Retrieving defined variables in a Design or Project is a common effort for automation. There are two types of variables, Design and
Project. Project variables are preceded with a ‘$’ symbol and are retrieved in the Project object as it is globally defined to all Designs.
Design variables do not have any preceding symbols and are retrieved in the Design object as their scope is limited to a given Design.
The following example demonstrates the retrieval of Project Variable names and values, and then Design variable names and val-
ues.:
GetSolutionData API
Many users want to use scripts to extract solution data from Ansys Electronics Desktop for custom Post Processing. Scripting includes
a new method to do this without having to export data to a file and then re-import it for use in a script. The new function is accessible
via the “ReportSetup” Module. The function call is “GetSolutionDataPerVariation()”. A code snippet to extract Terminal S Parameter
data is shown:
The above code shows how you can extract the Dependent and Independent data to variables for easy manipulation. For more inform-
ation on other functions available for this, see GetSolutionDataPerVariation.
Summary
Scripting has been advancing in Ansys Electronics Desktop to better allow you to customize and automate their repetitive or complex
simulations. The ability to easily retrieve and set property values via the Object-Oriented scripting allows for ease or both writing and
reading. The ability to extract solution data within a script execution is a new functionality that markedly enables more advanced post
processing.
Object oriented property scripting presents an easy to use, intuitive and object oriented representation of the data model. The frame-
work supports query of objects and their properties including the edits of the data model in an object oriented fashion. With the new
scripting framework, data exposure is intuitive and provides maximum coverage.
Each exposed script object supports the following COM functions:
l GetName
o Return name of the object as text string
o e.g. name of a design, solve setup, boundary, etc
l GetChildTypes
o An object can have different types of children.
o Return array of text string. Can be empty if the object’s children are NOT categorized into different types.
For example, a design object has 3 children types. The following examples show how the commands run in the Tools > Open
Command Window for IronPython.
>>> design.GetChildTypes()
['Module', 'Editor', ‘Design Data’]
l GetChildNames
o Input: [String – Type]. Default = “Module” and “Editor” for design script object. ‘All’ for other script objects.
o Return an array of immediate children’s names, of a given type if specified
>>> design.GetChildNames("module")
['Boundaries', 'Excitations', 'Optimetrics', 'Results']
l GetChildObject
o Input: String -- Object path. The path may include multiple generations.
o Return the child object if found
For example,
>>> d = project.GetChildObject("hfss")
>>> d.GetChildObject("3d modeler").GetChildNames()
['Box1', 'Box1_1', 'Box1_1_1']
>>> project.GetChildObject("hfss/3d modeler").GetChildNames()
['Box1', 'Box1_1', 'Box1_1_1']
l GetPropNames
o Input: [BOOL - IncludeReadOnly] -- default to true
o Return an array of the object’s properties
For example,
>>> geom = project.GetChildObject("hfss/3d modeler").GetChildObject("Box1")
>>> geom.GetPropNames()
['Name', 'Material', 'Material/SIValue', 'Material/EvaluatedValue', 'Solve Inside', 'Ori-
entation', 'Orientation/Choices', 'Model', 'Group', 'Display Wireframe', 'Material Appearance',
'Color', 'Color/Red', 'Color/Green', 'Color/Blue', 'Transparent']
l GetPropValue
o Input: String – Property Path. The path may include multiple generations.
o Return the property value as VARIANT
For example,
>>> geom.GetPropValue("material")
'"vacuum"’
>>> geom.GetPropValue("xsize")
'3mm'
>>> op.GetPropValue("attach to original object")
False
l • SetPropValue
o Input: String – Property Path. The path may include multiple generations.
o Input: String – Data. New value of the property.
o Return -- True if property data is updated successfully. False if failed to assign the new value.
For example,
>>> geom.SetPropValue("model", False)
>>> boxcmd.SetPropValue("ysize", "4mm")
l GetPropEvaluatedValue (<PropName>)
For example,
oVar = oDesign.GetChildObject(" Variables/var")
oVar.GetPropEvaluatedValue()
l GetPropSIValue (<PropName>
For example,
oCreateBox = oDesign.GetChildObject("3D Modeler/Box1/CreateBox:1")
oCreateBox.GetPropValue("xSize")
return "length / 2"
oCreateBox.GetPropEvaluatedValue("xSize")
return '0.4mm'
oCreateBox.GetPropSIValue("xSize")
return 0.0004
HFSS 3D Layout
l Boundaries, Excitations, Circuit Elements, Analysis, Radiation, Field Overlays, Optimetrics, Results
Maxwell 3D/2D
l Boundaries, Excitations, Analysis, Field Overlays, Optimetrics, Results
RMxprt
l Analysis, Field Overlays, Optimetrics, Results
Q3D
l Boundaries, Nets, Analysis, Optimetrics,
Q2D
l Boundaries, Conductors, Analysis, Field Overlays, Optimetrics,
Icepak
l Thermal, Monitor, Mesh, Analysis, Field Overlays, Optimetrics, Results
Mechanical
l Boundaries, Excitations, Analysis, Field Overlays, Optimetrics, Results
Circuit
l Optimetrics, Results
Circuit Netlist
l Results
EMIT
l Coupling
Simplorer/Twin Builder
l Analysis, Optimetrics, Results
3D component encapsulation
These script interfaces are compliant with encapsulation. For example,
Related Topics
ExampleGetLayeredImpedanceBoundaryPropertyNamesandValues.htm
Some Material Properties like Relatively Permittivity may have values assigned as BH Curves or Tensors, as discussed in the Assign-
ing Materials chapter of the online help.
A new Toolkit allows you to select materials from the Granta materials gateway, such that project materials will automatically be added
when you select a material from the gateway, and that the gateway itself is easily accessed from the materials.
True
>>> omat.GetPropNames()
['Coordinate System Type', 'Coordinate System Type/Choices', 'Relative Permeability Type',
'Relative Permeability Type/Choices', 'Relative Permeability', 'Relative Permeability/SIValue',
'Relative Permeability/EvaluatedValue', 'Bulk Conductivity Type', 'Bulk Conductivity
Type/Choices', 'Bulk Conductivity', 'Bulk Conductivity/SIValue', 'Bulk Con-
ductivity/EvaluatedValue', 'Magnetic Coercivity Type', 'Magnetic Coercivity Magnitude', 'Mag-
netic Coercivity Magnitude/SIValue', 'Magnetic Coercivity Magnitude/EvaluatedValue', 'Magnetic
Coercivity Components', 'Magnetic Coercivity Components/Component1', 'Magnetic Coercivity Com-
ponents/Component2', 'Magnetic Coercivity Components/Component3', 'Composition', 'Com-
position/Choices', '- Stacking Factor Type', '- Stacking Factor', '- Stacking Factor/SIValue',
'- Stacking Factor/EvaluatedValue', '- Stacking Direction', '- Stacking Direction/Choices',
"Young's Modulus Type", "Young's Modulus Type/Choices", "Young's Modulus", "Young's Mod-
ulus/SIValue", "Young's Modulus/EvaluatedValue", "Poisson's Ratio Type", "Poisson's Ratio
Type/Choices", "Poisson's Ratio", "Poisson's Ratio/SIValue", "Poisson's Ratio/EvaluatedValue"]
>>> omat.SetPropValue("Magnetic Coercivity Components/Component2", 2)
True
>>> omat.GetPropValue("Magnetic Coercivity Components")
['Component1:=', '2', 'Component2:=', '2', 'Component3:=', '0']
6-32
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
l An object may have different types of children. For example, a design may have variables, modules, and editors.
l Returns an array of text strings; may be empty if the children are not divided into different types.
GetChildNames(<type>)
l <type> – Child type name. By default, returns all children names for all types.
l Returns an array of immediate children names, belonging to a type if specified.
GetChildObject(<objPath>)
l <objPath> – A child object path; can contain multiple generations (for example, designObject/moduleObject/SetupObject).
l Returns a child property object if the object is found.
GetPropNames(<bIncludeReadOnly>)
l <bIncludeReadOnly) – Optional; defaults to true. True includes read-only properties; False excludes read-only properties.
l Returns an array of the object's property names.
GetPropValue(<propertyPath>)
l <propertyPath> – The property's path; may be a child object's path appended with a property name (for example, TeeModel/Off-
set/SIValue).
l Returns the property value if found. Otherwise causes script error.
SetPropValue(<propertyPath>, <data>)
l <propertyPath> – The property's path; may be a child object's path appended with a property name (for example, TeeModel/Off-
set/SIValue).
l <data> – New data; type depends on property type.
l Returns True if updated successfully; False if new data is invalid.
For a detailed summary of how Property script commands are used in a range of contexts, including Variable objects, see: Object
Script Property Function Summary. Additional examples for these commands are listed under Project Objects, Design Objects, 3D
Modeler, Optimetrics, Radiation Module and Reporter.
Note:
oProject.CommandName <args>
GetPropertyValue
GetVariables
GetVariableValue
SetPropertyValue
SetVariableValue
Additional Property Scripting Example
Example Use of Record Script and Edit Properties
Property Object
The Property Object is the base class defined for all script object that support property Get & Set.
l GetName()
l Returns the name of the object.
l GetChildTypes()
l An object may have different type of children. For example, a design may have variables, modules, and editors.
l Returns array of text strings; may be empty if the children are not divided to different types.
l GetChildNames(<type>)
l <type> – children type name; default returns all children names for all types.
l Returns an array of immediate children names, belonging to the type if specified.
l GetChildObject(<objPath>)
l <objPath> – A child object path. The path may include multiple generations, such as (designOb-
ject/moduleObj/SetupObject).
l Returns a child property object if the object found.
l GetPropEvaluatedValue(<propName>)
l Return the Evaluated-Value for Value-Property and Variable.
l Return the Property-value as text string for other property types.
l GetPropSIValue(<propName>)
l Return the SI-Value for Value-Property and Variable.
l Return NAN for other property type if its value is cannot be converted to a double-floating point value.
l GetPropNames(<bIncludeReadOnly>);
l <bIncludeReadOnly> – optional, default to true; True will include read-only properties, False will exclude read-only prop-
erties.
l Returns an array of the object’s property names.
l GetPropValue(<propertyPath>)
l <propertyPath> – the property's full path. A property name or child object’s path appended with a property name, like
“TeeModel/Offset/SIValue”
l Returns the property value if the property is foun; otherwise causes script error.
l SetPropValue(<propertyPath>, <data>)
l <propertyPath> – the property's full path. A property name or child object’s path appended with a property name, like
“TeeModel/Offset/Value”
l <data> – new data, type is dependent on property type.
l Returns True if property data is updated successfully; False if the new data is invalid.
Project Object
Project Object inherited all functions defined in the Property Object. But it doesn't have property, GetPropValue() & SetPropValue()
function can be used to set its child object's property.
l GetChildTypes() always return [“Design”, “Variable”].
l GetChildNames(type)
GetChildNames() & GetChildName(“Design”) will return all Design names of the project.
GetChildNames(“Variable”) return all project variable names.
l GetChildObject(objPath)
oDesign = oProject("TeeModel")
oVariable = oProject.GetChildObject("VariableName")
l GetPropNames(bIncludeReadOnly) always return empty array since the project has no property.
l GetPropValue(propertyPath)
l SetPropValue(propertyPath, newValue)
oProject.SetPropValue("TeeModel/offset", "2mm") //Set the offset variable value to "2mm" in the TeeModel Design
oProject.SetPropValue("TeeModel/Results/S Parameter Plot 1/Display Type", "Data Table) // Set the report display type to data
table.
Design Object
Design Object inherited all functions defined in the Property Object. But it doesn't have property, GetPropValue() & SetPropValue()
function can be used to set its child object's property..
l GetChildTypes() always return ['Module', 'Editor', 'Variable'].
l GetChildNames(type)
GetChildNames() will return modules & editor child names.
GetChildNames(“Variable”) will return all variable names
GetChildNames(“Module”) will return all module names that support property-object-script like ['Optimetrics', 'RadField', 'Res-
ults']
GetChildNames(“Editor”) will return a 3D editor name for all 3D Designs
l GetChildObject()
oVariable = oDesign.GetChildObject("VariableName")
3D Modeler Object
GetChild commands returns the appropriate properties for modeler objects. For 3D Components and UDMs, these commands do not
return parts, coordinate systems, plans, as top-level modeler children.
oModeler = oDesktop.GetActiveProject().GetActiveDesign().GetChildObject("3D Modeler")
oModeler.GetChildNames()
oModeler.GetChildNames("ModelParts")
oModeler.GetChildNames("AllParts")
oModeler.GetChildNames("NonModelParts")
oModeler.GetChildNames("Planes")
oModeler.GetChildNames("CoordinateSystems")
Variable Object
Is a Property Object that has no child. It also provides quick function call to get/set it properties by adding functions with property name
appended to Get_ & Set_ prefix. To find what functions it provided enter dir(oVar) the command window. It can accessed by the pro-
ject or design object’s GetChildObject(VariableName) function.
oProjVar = oProject.GetChildObject(“$VarName”)
oVar = oProject.GetChildObject(“DesignName/VarName”)
oVar = oDesign.GetChildObject(“variableName”)
oTrace = oRptModule.GetChildObject("S Parameter Plot 1/dB(S(Port1,Port1))") return the trace property object
oAxisX = oRptModule.GetChildObject("S Parameter Plot 1/AxisX") return the axis X property object
l GetPropNames(bIncludeReadOnly) always return empty array since the it \has no property.
l GetPropValue()
oRptModule.GetPropValue(“S Parameter Plot 1/Display Type”)
l SetPropValue()
oRptModule.SetPropValue(“S Parameter Plot 1/Display Type”, “DataTable”)
l SetPropValue(propName, newValue)
oTrace.SetPropValue(“Primary sweep”, “Freq”)
Property A single item that can be modified in the Properties window or in the modal Properties pop-up window.
The item whose properties are being modified. This is usually a compound name, giving all information needed
<PropServer>
by the editor, design, or project in order to locate the item.
<PropTab> Corresponds to one tab in the Properties window, the one under which properties are being edited.
<PropName> The name of a single property.
The following tables list specific <PropServer> and <PropTab> values for different property types.
For Project Variables:
<PropServer> "ProjectVariables"
<PropTab> "ProjectVariableTab"
<PropServer> "LocalVariables"
<PropTab> "LocalVariableTab"
<PropServer> "DefinitionParameters"
<PropTab> "DefinitionParameters"
<ModuleName>:<ItemName> where <ItemName is the boundary name, solution setup name, etc.
<PropServer>
For example, "BoundarySetup:PerfE1"
Boundary Module: "HfssTab"
Mesh Operations Module: "MeshSetupTab"
Analysis Module: "HfssTab"
Optimetrics Module: "OptimetricsTab"
Solutions Module: Does not support properties.
<PropTab>
Field Overlays Module: "FieldsPostProcessorTab"
Radiation Module: "RadFieldSetupTab"
Circuit Module: "CCircuitTab"
System Module: "SystemTab"
HFSS 3D Layout Module: "HFSS 3D LayoutTab"
<PropServer> <ReportSetup>
Array. For example, to set the company name in a plot header to "My Company":
Set oModule = oDesign.GetModule("ReportSetup")
Note:
For scripted property changes in the various modules and editors, refer to the chapters on the System, HFSS 3D Layout,
and Nexxim tools, as well as the Layout and Schematic editors.
<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 and Maxwell, only separator properties and variable prop-
erties can be added.
"SeparatorProp"
"VariableProp"
"TextProp"
"NumberProp"
"ValueProp"
"CheckboxProp"
"MenuProp"
"PointProp"
"VPointProp"
"V3DPointProp"
"ButtonProp"
NewName
Specify the new name of a property if the property’s name is being edited. In HFSS and Maxwell, the name can only be
changed for separators and variables.
Description
Specify a description of the property. In HFSS and Maxwell, the description can only be changed for separators and vari-
ables.
NewRowPosition
Used to reorder rows in the Property dialog box.
In HFSS, this only applies to the Project>Project Variables panel and the Hfss>DesignProperties panel.
In Maxwell, this only applies to the Project>Project Variables panel and the Maxwell3D>DesignProperties, Max-
well2D>Design Properties, or RMxprt>Design Properties panels.
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 and Maxwell, this flag can only be set for vari-
ables and separators.
Hidden
Used to hide a property so it can not be viewed outside of the Property dialog box. In HFSS and Maxwell, this flag can only
be set for variables and separators.
<PropTypeSpecificArgs>
SeparatorProp: no arguments
TextProp: "Value:=", <string>
NumberProp: "Value:=", <double>
ValueProp: "Value:=", <value>
CheckboxProp: "Value:=", <bool>
MenuProp: "Value:=", <string>
PointProp "X:=", <double>, "Y:=", <double>
VPointProp: "X:=", <value>, "Y:=", <value>
V3DPointProp: "X:=",<value>, "Y:=",<value>, "Z:=",<value>
Material Button: "Material:=", <string>
Color Button: "R:=",<int>,"G:=",<int>,"B:=",<int>
Transparency Button: "Value:=", <double>
Parameters:
<OptimizationFlagsArray>
Array("NAME:Optimization",
"Included:=", <bool>,
"Min:=", <value>,
"Max:=", <value>)
<Tuning flagsArray>
Array("NAME:Tuning",
"Included:=", <bool>,
"Step:=", <value>,
"Min:=", <value>,
"Max:=", <value>)
<SensitivityFlagsArray>
Array("NAME:Sensitivity",
"Included:=", <bool>,
"Min:=", <value>,
"Max:=", <value>,
"IDisp:=", <value> )
<StatisticsFlagsArray>
Array("NAME:Statistical",
"Included:=", <bool>,
"Dist:=", <Distribution>,
"StdD:=", <value>,
"Min:=", <value>,
"Max:=", <value>,
"Tol:=", <string>)
<Distribution>
Type: string
Value should be "Gaussian" or "Uniform"
StdD
Standard deviation.
Min
Low cut-off for the distribution.
Max
Tol
Tolerance for uniform distributions. Format is "<int>%".
Example: "20%".
Array("NAME:PropServers", "DefinitionParameters"),_
Array("NAME:DeletedProps", "height"))
VB Example: Changing a property’s value. If the following command were executed, then the value
of the property "XSize" of the PropServer "Box1:CreateBox:1" on the "Geometry3DCmdTab" tab would
be changed. (oEditor is the Geometry3D editor in HFSS.)
oEditor.ChangeProperty Array("NAME:AllTabs", _
Array("NAME:Geometry3DCmdTab", _
Array("NAME:PropServers","Box1:CreateBox:1"), _
Array("NAME:ChangedProps", _
Array("NAME:XSize", "Value:=", "1.4mil"))))
VB Example: Changing the Company Name, Design Name, the background color, and the Axis scaling in
a Report.
Set oProject = oDesktop.SetActiveProject("wgcombiner")
Set oDesign = oProject.SetActiveDesign("HFSSDesign2")
Set oModule = oDesign.GetModule("ReportSetup")
oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:Header", _
Array("NAME:PropServers", "XY Plot1:Header"), _
GetArrayVariables
Returns a list of array variables. To get a list of indexed project variables, execute with oProject. To get a list of indexed local vari-
ables, use oDesign.
UI Access N/A
Parameters None.
Return Value Array of strings containing names of variables.
VB Syntax GetArrayVariables
oProject.GetArrayVariables
VB Example
oDesign.GetArrayVariables
GetProperties
Gets a list of all the properties belonging to a specific <PropServer> and <PropTab>. This can be executed by the oProject, oDesign,
or oEditor variables.
UI Access N/A
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
Return Value Array of strings containing the names of the appropriate properties.
GetPropertyValue
Returns the value of a single property belonging to a specific <PropServer> and <PropTab>. This function is available with the Pro-
ject, Design or Editor objects, including definition editors.
Tip:
Use the script recording feature and edit a property, and then view the resulting script to see the format for that property.
UI Access N/A
Parameters
l BaseElementTab ("Symbol" or "Footprint")
l ComponentTab ("General")
l Component("Component")
l CustomTab ("Intrinsic Variables")
l Quantities ("Quantities")
Signals ("Signals")
l
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<PropName> String Name of the property.
for k in selectionArray:
val = oEditor.GetPropertyValue("PassedParameterTab", k, "R")
...
GetVariables
Returns a list of all defined variables. To get a list of project variables, execute this command using oProject. To get a list of local
variables, use oDesign.
UI Access N/A
Parameters None.
Return Value Array of strings containing the variables.
oDesign.GetVariables()
VB Syntax GetVariables
oProject.GetVariables
VB Example
oDesign.GetVariables
GetVariableValue
Gets the value of a single specified variable. To get the value of project variables, execute this command using oProject. To get the
value of local variables, use oDesign.
UI Access N/A
SetPropertyValue
Sets the value of a single propertybelonging to a specific PropServer and PropTab. This function is available with the Project, Design
or Editor objects, including definition editors.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.
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.
UI Access N/A
l ComponentTab ("General")
l Component("Component")
l Quantities ("Quantities")
l Signals ("Signals")
<propServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<propName> String Name of the property.
<propValue> String The value for the property
SetVariableValue
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.
UI Access N/A
'
' CREATE A RECTANGLE IN HFSS_3D_LAYOUT
'
oProject.InsertDesign "HFSS 3D Layout", "HFSS 3D Layout1", _
"C:\testinstall\Designer\syslib\PCB - SingleSided.asty", ""
Set oDesign = oProject.SetActiveDesign("HFSS 3D Layout1")
Set oEditor = oDesign.SetActiveEditor("Layout")
oEditor.CreateRectangle Array("NAME:Contents", _
"rectGeometry:=", Array("Name:=", _
"rect_1", "LayerName:=", "Top", "lw:=", _
"0mm", "Ax:=", "-22mm", "Ay:=", "20mm", "Bx:=", _
"29mm", "By:=", "-4mm", "ang:=", "0deg"))
'
' GET ALL PROPERTIES OF THE RECTANGLE
'
Dim all_props
Dim prop
Dim val
Dim new_val
'
all_props = oEditor.GetProperties("BaseElementTab","rect_1")
'
' LOOP OVER ALL PROPERTIES
'
For Each prop in all_props
val = oEditor.GetPropertyValue("BaseElementTab","rect_1",prop)
'
' DISPLAY VALUE TO THE USER
'
new_val = InputBox("New Value of "+prop+":",_
"Current Value of "+prop+" is "+val,val)
'
' CHANGE THE VALUE IF DESIRED
'
If new_val <> val Then
oEditor.SetPropertyValue _
"BaseElementTab","rect_1",prop,new_val
val = _
oEditor.GetPropertyValue("BaseElementTab","rect_1",prop)
MsgBox("Now the value of "+prop+" is "+val)
End If
'
Next
'
AddDataset
Adds a dataset. This can be executed by the oProject, or oDesign variables.
)
oDesign.AddDataset(
[
"NAME:$ds1",
[
"NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 2,
"Y:=", 4
],
[
"NAME:Coordinate",
"X:=", 6,
"Y:=", 8
]
]
]
)
oProject.AddDatasetArray("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)))
VB Example
oDesign.AddDatasetArray("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
Deletes a specified dataset. This can be executed by the oProject, or oDesign variables.
EditDataset
Modifies a dataset. This can be executed by the oProject, or oDesign variables.
[
"NAME:Coordinate",
"X:=", 1, "Y:=", 2
],
[
"NAME:Coordinate",
"X:=", 3, "Y:=", 4
]
]
]
)
oDesign.EditDataset ("ds1"
["NAME:ds2",
["NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 1, "Y:=", 2
],
[
"NAME:Coordinate",
"X:=", 3, "Y:=", 4
]
]
]
)
ExportDataset
Exports a dataset to a named file. This can be executed by the oProject, or oDesign variables.
HasDataset
Determines whether a specified dataset exists.
UI Access N/A
Integer:
ImportDataset
Imports a dataset from a named file. This can be executed by the oProject, or oDesign variables. The name of the dataset is file-
name+index number (e.g., dsdata1) unless the filename ends with a trailing number. When there is a trailing number at the end, we
will remove the number and use first unused index.
Tab-delimited or space-delimited files with the extension ".tab" is the recommended file type to be used.
For importing datasets at the Design level, this is the only file type supported.
At the Project level, other file types (e.g., ".csv") are supported. However, after calling the command, you must configure the file import
format manually through the GUI as shown in the figure below.
oDesign.ImportDataset('e:\tmp\dsdata.tab')
8-12
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AddDesignVariablesForDynamicLink
AnalyzeDistributed
ApplyMeshOps
AssignDCThickness
ClearLinkedData
ConstructVariationString
DeleteFieldVariation
DeleteFullVariation
DeleteLinkedDataVariation
EditDesignSettings
EditLayoutForLayoutComponent
EditNotes
ExportConvergence
ExportForHSpice
ExportNMFData
ExportMatrixData
ExportMeshStats
ExportNetworkData
ExportProfile
ExportReport
GenerateMesh
GetActiveEditor
GetAllPorts
GetChildNames [Design]
GetChildObject [Design]
GetChildTypes [Design]
GetConfigurableData
GetData
GetDesignName
GetDesignType
GetDesignValidationInfo
GetEditSourcesCount
GetManagedFilesPath
GetModule
GetName
GetNominalVariation
GetNoteText
GetPostProcessingVariables
GetPropNames [Design]
GetPropValue [Design]
GetSelections
GetSolutionType
GetSolveInsideThreshold
PasteDesign
Redo
RemoveModelingProperties
RenameDesignInstance
RenameSource
ReportTemplates
RunToolkit
SARSetup
SetActiveEditor
SetDesignSettings
SetLengthSettings
SetObjectAttributesForLayoutComponents
SetObjectDeformation
SetObjectTemperature
SetPhaseCenterPerPort
SetPropValue [Design]
SetPropertyValue
SetShowLayoutForLayoutComponent
SetSinglePhaseCenter
SetSolutionType
SetSolveInsideThreshold
SetSourceContexts
Solve
StartAnalysis
StopSimLink
Undo
ValidateCircuit
ValidateDesign
ValidateLink
AddDataset
Adds a dataset. This can be executed by the oProject, or oDesign variables.
[
"NAME:$ds1",
[
"NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 2,
"Y:=", 4
],
[
"NAME:Coordinate",
"X:=", 6,
"Y:=", 8
]
]
]
)
oDesign.AddDataset(
[
"NAME:$ds1",
[
"NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 2,
"Y:=", 4
],
[
"NAME:Coordinate",
"X:=", 6,
"Y:=", 8
]
]
]
)
AddDesignVariablesForDynamicLink
Creates design variables based on any in a Circuit, HFSS, 3D Layout, Q3D, or 2D extractor project that is connected to a Circuit or 3D
Layout design through a dynamic link.
l In the Schematic Editor or Layout Editor, right click the new instance of the linked design and click Add
Design Variables for Dynamic Link.
UI Access
l In the Project Manager, right click on [Project Name] > [Design Name] > [Dynamic Link Design] and
click Add Design Variables for Dynamic Link.
AddModelingProperties
Use: Add a modeling property to a design
Command: None
Syntax: AddModelingProperties <design>
Return Value: None
Parameters: <design>
Type: string
VB Example: oDesign.AddModelingProperties <design>
Analyze
Solves a single solution setup and all of its frequency sweeps.
UI Access Right-click a solution setup in the project tree, and select Analyze.
Integer value:
Return Value l 0 – Success
l Else – Error
AnalyzeAll [design]
Runs all solution setups and Optimetrics setups for the current design instance.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax AnalyzeAll
VB Example oDesign.AnalyzeAll
AnalyzeAllNominal
Runs all defined setups.
UI Access Right-click Analysis in the project tree, and select Analyze All.
Parameters None.
Return Value None.
VB Syntax AnalyzeAllNominal
VB Example oDesign.AnalyzeAllNominal
AnalyzeDistributed
Performs a distributed analysis.
UI Access N/A
Integer value:
Return Value l 0 – Success
l Else – Error
ApplyMeshOps
If any mesh operations 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.
Important:
Integer value:
Return Value l 0 – Success
l Else – Error
VB Syntax ApplyMeshOps(<SetupNameArray>)
VB Example status = oDesign.ApplyMeshOps Array("Setup1","Setup2")
AssignDCThickness
Assigns DC thickness to more accurately compute DC resistance of a thin conducting object for which Solve Inside is not selected.
"pin4",
"gnd"
],
[
"1mm",
"\"<Infinite>\"",
"\"<Effective>\"",
"2mm",
"\"<Infinite>\"",
"\"<Effective>\"",
"3mm",
"\"<Infinite>\"",
"\"<Effective>\""
],
"EnableAuto"
)
ChangeProperty[ReportSetup]
Change the properties for a Report.
"NAME:AllTabs",
[
"NAME:General",
[
"NAME:PropServers",
"XY Plot 1:General"
],
[
"NAME:ChangedProps",
[
"NAME:Use Scientific Notation",
"Value:=", True
]
]
]
])
oModule = oDesign.GetModule("ReportSetup")
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Legend",
[
"NAME:PropServers",
"S Parameter Plot 1:Legend"
],
[
"NAME:ChangedProps",
[
"NAME:Legend Name",
"Value:=" , "Ansys"
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:General",
[
"NAME:PropServers",
"S Parameter Plot 1:General"
],
[
"NAME:ChangedProps",
[
"NAME:Auto Scale Fonts",
"Value:=" , False
]
]
]
])
VB ChangeProperty <PropertyArray>
Syntax
ers", _
"XY Plot 1:General"), Array("NAME:ChangedProps", Array("NAME:Use Scientific Notation",
"Value:=", _
true))))
ClearLinkedData (Design)
Clear the linked data of all the solution setups. Similar to the ClearLinkedData command for the module level.
VB Syntax ClearLinkedData
VB Example oDesign.ClearLinkedData
ConstructVariationString
Lists and orders the variables and values associated with a design variation.
UI Access N/A
Returns variation string with the variables ordered to correspond to the order of variables in design variations.
Return Value The values for the variables are inserted into the variation string. For an example of how Con-
structionVariationString can be used, see the Python example.
CopyItemCommand
Use: Copy tree items, such as Altrasim Solution Setups in Nexxim, or Solve Setups and Frequency Sweeps in Ensemble.
Command: None
Syntax: CopyItemCommand <ItemPathList>
Return Value: None
Parameters: <ItemPathList>
CreateEMLossTarget
CreateEMLossTarget creates a target Icepak or Mechanical design from a source HFSS, Q3D, or Maxwell design.
("NAME:DesignSetup",
Example
"Sim Type:=", _"Forced")
y, I
CreateReport
Creates a new report with a single trace and adds it to the Results branch in the project tree.
Optimetrics Example:
oModule.CreateReport ("XY Plot 3", "Standard",_
"Rectangular Plot", "TR", ["NAME:Context",_
"OptiSetup:=", "ParametricSetup1", "SimValueCon
[1, 0, 2, 0, false, false, 0, 1, _
0, 1, 1, "", 0, 0]], ["Time:=", ["All"],_
"aaa:=", ["Nominal"]], ["X Component:=",_
"Time", "Y Component:=", ["E1.I"]], [])
Spectral Example:
oModule.CreateReport ("XY Plot 4", "Standard",_
"Rectangular Plot", "TR", ["NAME:Context",_
"SimValueContext:=", [ 2, 0, 2, 0, false, false
-1, 1, 0, 1, 1, "", 0, 0, "CG", false, "0", "KP
false, "0", "MH", false, "100", "TE", false, "4
"TH", false, "40", "TS", false, "0ns", "UF", fa
"0", "WT", false, "0", "WW", false, "100"]],_
["Spectrum:=", ["All"], "aaa:=",_
],
[
"X Component:=" , "Freq",
"Y Component:=" , "UU",
"Z Component:=" , ["dB(S(wDipole1_1_p1,wDipole1_1_p1))"]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Transparency",
"Value:=" , "0.5"
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Filled",
"Value:=" , False
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Filled",
"Value:=" , True
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Show Outline",
"Value:=" , True
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Outline Color",
"R:=" , 0,
"G:=" , 0,
"B:=" , 160
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Outline Width",
"Value:=" , "2"
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
[
"NAME:ChangedProps",
[
"NAME:Bar Width",
"Value:=" , "Wide"
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Bar Infinity",
"Value:=" , True
]
]
]
])
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()
oModule.CreateReport "Rectangular Contour Plot 2", "Far Fields", _
"Rectangular Contour Plot", "Setup1 : LastAdaptive", Array("Context:=", _
"Infinite Sphere1"), Array("_u:=", Array("All"), "_v:=", Array("All"), "Freq:=",
Array( _
"5GHz")), Array("X Component:=", "_u", "Y Component:=", "_v", "Z Component:=", Array
( _
"rETotal")), Array()
oModule.CreateReport "Rept2DRectFreq",_
"Modal Solution Data", "XY Plot", _
"Setup1 : Sweep1", _
Array("Domain:=", "Sweep"), _
Array("Freq:=", Array("All")), _
Array("X Component:=", "Freq", _
"Y Component:=", _ Array("dB(S(LumpPort1,LumpPort1))")), _
Array()
DeleteDataset
Deletes a specified dataset. This can be executed by the oProject, or oDesign variables.
DeleteFieldVariation
Deletes field variations, fields and meshes, or fields and meshes for specified variations.
UI Access [Solver] > Results > Clean Up Solutions > [Fields Only / Fields and Meshes].
DeleteFullVariation
Deletes either all solution data, or selected variation data.
DeleteLinkedDataVariation
Deletes the linked data of specified variations.
DeleteOutputVariable
Deletes an existing output variable. The variable can only be deleted if it is not in use by any traces.
UI Access HFSS > Results > Output Variables. In the Output Variables window, click Delete.
oModule.DeleteOutputVariable "testNew"
DeleteSolutionVariation
Deletes all solution data for specific solutions and design variations. This is obsolete and is supported only for backward compatibility.
You should use DeleteFullVariation, DeleteFieldVariation, and DeleteLinked Variation.
UI Access Right-click on Results, select Browse Solutions..., click Delete button in the dialog.
DeleteOutputVariable
Deletes an existing output variable. The variable can only be deleted if it is not in use by any traces.
UI Access HFSS > Results > Output Variables. In the Output Variables window, click Delete.
DistributeAnalysis
Performs a distributed analysis.
UI Access N/A
Integer value:
Return Value l 0 – Success
l Else – Error
EditCoSimulationOptions
Sets options for cosimulation.
Command: None
Syntax: EditCoSimulationOptions <array_name>
EditDesignSettings
Edits design settings.
"EntityCheckLevel:=" , "Strict",
"IgnoreUnclassifiedObjects:=", False,
"SkipIntersectionChecks:=", False,
"SkipMeshChecks:=", True
])
EditImportData
Use: Edit an imported solution
Command: None
Syntax: EditImportData <oldname> <newlink> <newpath> <newname> <data> <file>
Return Value: None
Parameters: <oldname>
Type: string
<newlink>
<newpath>
Type: string
<newname>
Type: string
<data>
Type: array
<file>
Type: string
VB Example: oDesign.EditImportData <oldname> <newlink> <newpath> <newname> <data> <file>
EditInfiniteArray
Edits the properties of an infinite array
Command: None
Syntax: EditInfiniteArray <array_name>
<object_description>:
<circle_description> |
<rectangle_description> |
<line_description> |
<polyon_description> |
<text_description> |
<circle_void_description> |
<rectangle_void_description> |
<line_void_description> |
<polyon_void_description> |
<component_description> |
<pin_description> |
<via_description>
VB Example:
oEditor.Edit Array("NAME:items", Array("NAME:item",
"name:=", "circle_0", Array("NAME:contents",
"circleGeometry:=", Array("Layer:=", 6,
"Name:=", "circle_0", "LayerName:=", "Top",
"lw:=", "0mm", "x:=", "-0.008meter",
"y:=", "13.2924281984334mm", "r:=", 10.2924281984334mm")))
ua
EditLayoutForLayoutComponent
Opens the definition component for editing in HFSS 3D Layout for a Layout Component in an HFSS 3D design.
EditNotes
Updates the notes for the design.
Type: string
VB Example: oDesign.EditOptions <array_name>
EMDesignOptions
Use: Set options for an EM Design.
Command: Right click on design and select EM Design Options
Syntax: DesignOptions <Options Array>
Return Value: None
Parameters:
<Options Array>
Array("NAME:options",
"SaveSolFilesAsBinary:=", <boolean>,
"LowPriorityForSimulations:=", <boolean>,
"SaveNearFieldSolutions:=", <boolean>,
"SchematicEnabled:=", <boolean>,
"UseGlobalNumProc:=", <boolean>,
"ComputeBothEvenAndOddCPWModes:=", <boolean>,
"NumProcessors:=", <int>,
"NumProcessorsDistrib:=", <int>,
"CausalMaterials:=", <boolean>,
"UseHPCForMP:=", <boolean>,
"HPCLicenseType:=", <int>)
"ComputeBothEvenAndOddCPWModes:=", false,
"NumProcessors:=", 1,
"NumProcessorsDistrib:=", 1,
"CausalMaterials:=", true,
"UseHPCForMP:=", true,
"HPCLicenseType:=", 1)
ExportConvergence
For a given variation, exports convergence data (max mag delta S, E, freq) to *.conv file.
UI Access Results > Solution Data. Select Convergence tab and click Export.
ExportDataset
Exports a dataset to a named file. This can be executed by the oProject, or oDesign variables.
ExportForHSpice
Exports matrix solution data to a file in a format suitable for HSpice 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.
UI Access N/A
<FullWaveSpiceFilename>
Type: string
<LumpedElementFilenme>
Type: string
<Unused>
Type: string
<Unused>
Type: string
<PartialFractionFilename>
Type: string
<Fitting Error>
Type: double
<Unusedint>
Type: int
<MaxOrder>
Type: int
<UseCommonGround [Default: FALSE]>
Type: boolean
<DoPassivityCheck [Default: FALSE]>
Type: boolean
Type: string
<Unused>
Type: string
<PartialFractionFilename>
Type: string
<FittingError [Default:0.5]>
Type: double
<MaxOrder [Default:200]>
Type: int
<UseCommonGround [Default:FALSE]>
Type: boolean
<DoPassivityCheck [Default:FALSE]>
Type: boolean
VB Example: oDesign.ExportForSpice "", Array("LNA:LNA"), 0, 0, _
"C:/Documents and Settings/Marcia.BMT/My Documents/Code Modifications/Test" & _
" Designs/s-params_fws_fws.lib", _
"C:/Documents and Settings/Marcia.BMT/My Documents/Code Modifications/Test" & _
" Designs/s-params_fws_lfws.lib", "", "", "", 0.52, 210, 1, 1
ExportMatrixData
Type: <double>
Frequency in hertz.
<MatrixType>
Type: <String>
Value: "Maxwell", "Spice", "Couple" , (one or all of these).
Matrix type to export.
<PassNumber>
Type: <integer>
Pass number.
<ACPlusDCResistance>
Type: <bool>
Default Value: false
Add DC and AC resistance and export the matrix.
VB Example:oDesign.ExportMatrixData "C:/temp/3DScripts/rlgc_lvl.lvl", "C, DC RL, AC RL", "", _
"Setup1:LastAdaptive", "Original", "ohm", "nH", "pF", "mSie", 100000000, _ "Max-
well,Spice,Couple", 0
Python Syn- ExportMatrixData ([FileName, SolnType, DesignVariationKey, Solution, Matrix, ResUnit, IndUnit, CapUnit,
tax CondUnit, Frequency, MatrixType, PassNumber, ACPlusDCResistance])
oDesign.ExportMatrixData
Python (["C:/temp/3DScripts/rlgc_lvl.lvl", "C, DC RL, AC RL", "", _ "Setup1:LastAdaptive",
Example "Original", "ohm", "nH", "pF", "mSie", 100000000, _ "Maxwell,Spice,Couple",
0])
ExportMeshStats
Exports mesh statistics to a file.
UI Access N/A
ExportNetworkData
Exports matrix solution data to a file. Available only for Driven solution types with ports.
UI Access N/A
[Optional <SupportNonStdExport>]
oModule.ExportNetworkData "width=’2in’", _
Array("Setup1:Sweep1"),2, "c:\mydir\out.tab", _
Array("all"), false, 0
VB Example oModule.ExportNetworkData "width=’2in’", _
Array("Setup1:Sweep1", "Setup1:Sweep2"), 3, _
"c:\mydir\out.s2p", Array(1.0e9, 1.5e9, 2.0e9), _
true, 50.0
ExportNetworkData
Exports matrix solution data to a file. Available only for Driven solution types with ports.
UI Access N/A
4 : CitiFile (.cit)
7 : Matlab (.m)
8 : Terminal Z0 spreadsheet
<OutFile> String Full path to the file to write out.
<FreqsArray> Array The frequencies to export. The <FreqsArray> argument contains a
vector (e.g. "1GHz", "2GHz", ...) to use, or "all". To export all fre-
quencies, use Array("all"). If no frequencies are specified, all fre-
quencies are used.
<DoRenorm> Boolean Specifies whether to renormalize the data before export.
<RenormImped> Double Real impedance value in ohms, for renormalization. Required in syn-
tax, but ignored if DoRenorm is false.
<DataType> String Optional. Type: "S", "Y", or "Z". The matrix to export.
<pass> Integer Optional. 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> Integer Optional. Type: "0", "1", or "2"
The format to use for the exported data.
0 = Magnitude/Phase.
1= Real/Imaginary.
2= db/Phase.
<Precision> Integer Optional. Touchstone number of digits precision. Default if not spe-
cified is 15.
<UseExportFreqs> Boolean Specifies whether to use export frequencies.
<IncludeGammaComments> Boolean Specifies whether to include Gamma and Impedance comments.
<SupportNonStdExport> Boolean Specifies whether to support non-standard Touchstone extensions
for mixed reference impedance.
ExportNMFData
<FrequencyArray>
Type: <Array of doubles>
Value: Array(<double>,<double>….)
Frequency points in the sweep that is exported.
<DesignVariation>
Type: <String>
Design variation at which the solution is exported.
<Format>
Type: <String>
Values: "MagPhase", "RealImag", "DbPhase".
The format in which the sparameters will be exported.
<Length>
Type:<String>
Length for exporting sparameters.
<PassNumber>
Type:<integer>
Pass number.
VB Example:
oDesign.ExportNMFData "Setup7 : LastAdaptive", "C:/temp/neu.nmf", "Original", _ 50, Array
(10000000, 20000000, 30000000, 40000000, 50000000, 60000000, 70000000, _ 80000000, 90000000,
100000000), "", "MagPhase","7meter"
ExportNMFData(
"",
# Empty string.
1,
#The number 1.
"Name",
# This is the full path of the file from which the solution is loaded
"ExportFile",
# full path of file to export to
["NAME:Frequencies"],
Python Syntax
#optional, if none defined all frequencies are used
["NAME:NMFOptions",
#Export NMF options object
"DataTypes:=", ["S"],
#DataTypes can be "S", "Y","Z", "G", and "Z0", for S , Y, Z matrix, Gamma and Z0 (zero)
"DisplayFormat:=", "MA",
#DisplayFormat "MA", "RI", "DB"
"FileType:=", "",
# Export File Type
2 - Spreadsheet(*.tab)
3 - Touchstone(*.sNp)
4 - Citifile(*.cit)
6 - Neutral format(*.nmf)
7 - Matlab format(*.m)
"Renormalize:=", false,
#Renormalize true/false
"RefImpedance:=",50,
# Reference Impedance
"Precision:=", 8,
# Number of digits Precision
"Variables:=", ["FF", "cap", "Rs"]
# Array of variables
"Variations:=", ["", "", ""]
# Array of variations to export solutions for
["NAME:ConstantVars"]
#Array of variables that are constant, can be empty
["NAME: DependentVars"]
#Array of variables that are dependent, can be empty
"MatrixSize:=", 2,
#Matrix size, optional (used in nmf file header)
"CreateNPortModel:=", true
100000000000
],
[
"NAME:TSOptions",
"DataTypes:=" , ["S"],
"DisplayFormat:=" , "DB",
"FileType:=" , 3,
"Renormalize:=" , True,
"RefImpedance:=" , 50,
"Precision:=" , 6,
"UseMultipleCores:=" , False,
"NumberOfCores:=" , 1,
"Comments:=" , True,
"Noise:=" , False
])
ExportProfile
Exports a solution profile to file.
UI Access N/A
Generate Mesh
If any mesh operations have been defined but 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.
Integer:
Return Value l 0 – Success
l Else – Failure
GetChildNames [Design]
Returns the names of the design's child objects.
UI Access N/A
GetChildObject [Design]
Returns the design's child objects.
UI Access N/A
GetChildTypes [Design]
Returns the design's child object types.
UI Access N/A
Parameters None.
Return Value String: "Module", "Editor", or "Variable"
VB Syntax GetChildTypes
VB Example oDesign.GetChildTypes
GetConfigurableData
Obtains configurable data of a specified type
Note:
This command is for internal Ansys use only.
UI Access N/A
GetData
Note:
This command is for internal Ansys use only.
GetDesignID
Returns the unique identification number of the active design.
UI Access N/A
Parameters None.
Return Value String indicating the unique identification number of the active design.
VB Syntax GetDesignType
Set oDesign = oProject.GetActiveDesign
VB Example
oDesign.GetDesignID
GetDesignName
Returns the name of the active design.
UI Access N/A
Parameters None.
Return Value String indicating the name of the active design.
VB Syntax GetDesignName
Set oDesign = oProject.GetActiveDesign
VB Example
oDesign.GetDesignName
GetDesignType
Returns the design type of the active design.
UI Access N/A
Parameters None.
String indicating the design type of the active design ("Circuit Design", "Circuit Netlist","EMIT",
Return Value "HFSS 3D Layout Design", "HFSS", "HFSS-IE", "Icepak", "Maxwell 2D", "Maxwell 3D", "Q2D Extractor",
"Q3D Extractor", "RMxprt", or "Twin Builder").
VB Syntax GetDesignType
Set oDesign = oProject.GetActiveDesign
VB Example
oDesign.GetDesignType
ain
GetDesignValidationInfo
Returns the design's validation information.
UI Access N/A
Boolean:
Return Value l 0 – Failure (validation not done)
l 1 – Success (results written to specified location; see file format below)
GetEdgePositionAtNormalizedParameter
Gets the position on an edge with normalized parameter.
UI Access N/A
oEditor.GetEdgePositionAtNormalizedParameter 5, 1
oEditor.GetEdgePositionAtNormalizedParameter 5, 0.5
GetEditSourcesCount
For Characteristic Mode Analysis (CMA), returns the number of sources listed in the Edit Sources panel.
UI Access N/A
Parameters None.
Return Value Integer number of sources.
VB Syntax GetEditSourcesCount
Dim count
VB Example
count = oModule.GetEditSourcesCount
Parameters: <editorName>
Type: string
<object_variable>
Type: string
VB Example: oDesign.GetEditor <editorName> <object_variable>
GetManagedFilesPath
Get the path to the project's results folder.
UI Access N/A
Parameters None.
Return Value String containing path where project results are located.
VB Syntax oDesign.GetManagedFilesPath
VB Example oDesign.GetManagedFilesPath
GetModule
Returns the IDispatch for the specified module.
UI Access N/A
GetModule (RadiationSetupMgr)
Returns the IDispatch for the specified module.
UI Access N/A
GetName
Returns the name of the active design.
UI Access N/A
Parameters None.
VB Syntax GetName
VB Example design_name = oDesign.GetName
GetNominalVariation
Returns the current nominal variation.
UI Access N/A
Parameters None.
Return Value String containing current nominal variation.
VB Syntax GetNominalVariation
VB Example oDesign.GetNominalVariation
GetNoteText
Returns the text of the note attached to a design.
UI Access N/A
Parameters None.
Return Value String: text of the design note.
VB Syntax GetNoteText
VB Example oDesign.GetNoteText
GetObjPath [Design]
Obtains the path to the design.
UI Access N/A
Parameters None.
Return Value String containing the path to the design.
VB Syntax GetObjPath
VB Example oDesign.GetObjPath
GetOutputVariableValue
Returns the double value of an output variable. Only expressions that return a double value are supported. The expression is eval-
uated only for a single point.
UI Access N/A
<ContextArray> Array Structured array containing context for which the output variable expression is
being evaluated. Can be empty.
Array("Context:=", <string>)
GetOutputVariables
Returns the list of output variables.
UI Access N/A
Parameters None.
Return Value Array containing all output variables.
VB Syntax GetOutputVariables
VB Example oDesign.GetOutputVariables
GetPostProcessingVariables
Returns the list of post-processing variables.
UI Access N/A
Parameters None.
Return Value Returns array containing variables.
VB Syntax GetPostProcessingVariables
VB Example oDesign.GetPostProcessingVariables
GetProperties
Gets a list of all the properties belonging to a specific <PropServer> and <PropTab>. This can be executed by the oProject, oDesign,
or oEditor variables.
UI Access N/A
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
Return Value Array of strings containing the names of the appropriate properties.
GetPropertyValue
Returns the value of a single property belonging to a specific <PropServer> and <PropTab>. This function is available with the Pro-
ject, Design or Editor objects, including definition editors.
Tip:
Use the script recording feature and edit a property, and then view the resulting script to see the format for that property.
UI Access N/A
Parameters
l BaseElementTab ("Symbol" or "Footprint")
l ComponentTab ("General")
l Component("Component")
l CustomTab ("Intrinsic Variables")
l Quantities ("Quantities")
Signals ("Signals")
l
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<PropName> String Name of the property.
GetPropNames [Design]
Returns array containing names of property. For designs, always returns an empty array because the design has no property.
UI Access N/A
GetPropValue [Design]
Returns the property value for the active design object, or specified property values.
UI Access N/A
Return Value The property value (integer, string, or array of strings) of the specified child object.
VB Syntax GetPropValue(<propPath>)
val = oDesign.GetPropValue("offset/SIValue")
VB Example disp = oDesign.GetPropValue("Results/S Parameter Plot 1/Display Type")
arr = oDesign.GetPropValue("Results/S Parameter Plot 1/Display Type/Choices")
GetSelections [Design]
This script serves no function at the Design level. See: GetSelections (Layout Editor), GetSelections (Model Editor), or Get Selections
(Schematic Editor).
GetSolutionType
Returns solution type of the design.
UI Access N/A
Parameters None.
String containing the solution type.
Return Value Possible values are: "SBR+", "HFSS [Modal | Terminal] [ Network | Composite]","Transient [Network | Com-
posite]","Eigenmode", or "Characteristic".
VB Syntax GetSolutionType
VB Example oDesign.GetSolutionType
GetSolveInsideThreshold
Returns the solve inside threshold. This command does not apply to HFSS-IE.
UI Access N/A
Parameters None.
Return Value Double representing the solve inside threshold.
VB Syntax GetSolveInsideThreshold
VB Example oDesign.GetSolveInsideThreshold
GetVariables
Returns a list of all defined variables. To get a list of project variables, execute this command using oProject. To get a list of local
variables, use oDesign.
UI Access N/A
Parameters None.
Return Value Array of strings containing the variables.
VB Syntax GetVariables
oProject.GetVariables
VB Example
oDesign.GetVariables
GetVariableValue
Gets the value of a single specified variable. To get the value of project variables, execute this command using oProject. To get the
value of local variables, use oDesign.
UI Access N/A
GetVariationVariableValue
Returns the value for a specified variation's variable.
UI Access N/A
Returns a double precision value in SI units, interpreted to mean the value of the variable contained in the vari-
Return Value
ation string.
ImportDataset
Imports a dataset from a named file. This can be executed by the oProject, or oDesign variables. The name of the dataset is file-
name+index number (e.g., dsdata1) unless the filename ends with a trailing number. When there is a trailing number at the end, we
will remove the number and use first unused index.
Tab-delimited or space-delimited files with the extension ".tab" is the recommended file type to be used.
For importing datasets at the Design level, this is the only file type supported.
At the Project level, other file types (e.g., ".csv") are supported. However, after calling the command, you must configure the file import
format manually through the GUI as shown in the figure below.
InsertDesign
Inserts a new design in the project. For HFSS scripts, the last argument will always be empty.
PushExcitations
Allows access to computed excitations for transient and linear frequency solutions. The script command can be accessed from three
locations.
l Layout Editor
UI Access l Schematic Editor
l Select a Nexxim solution in a 3D Layout design, right click, and choose Push Excitations.
Parameters This argument is empty when excitations are pushed from a Nexxim
solution.
<PushExcitations Para- Array This parameter changes depending on whether the excitations
meters> comes from a transient or linear frequency solution. The keyword
l Bartlett
l Blackman
l Hamming
l Hanning
l Kaiser
l Welch
l Weber
l Lanzcos
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Redo [Design]
Reapplies the last design-level command.
VB Syntax Redo
VB Example oDesign.Redo
RenameDesignInstance
Renames a design instance.
UI Access Right-click a design instance in the project tree, and then click Rename on the shortcut menu.
RunToolkit
Runs a Python toolkit script, applying it to the active design. The toolkit script itself may have prerequisites, such as sweeps defined, or
specific model characteristics, such as port definitions.
Important:
Full scripting for cable modeling is not supported and no arguments are allowed in the script. The RunToolkit command
will not automatically create a cable bundle, but will simply open the Cable Modeling dialog box. You will have to manually
input your parameters.
SARSetup
Sets up for the specific absorption rate (SAR) computation. This command does not apply to HFSS-IE.
SetActiveEditor
Sets the active editor.
UI Access N/A.
SetAllowMaterialOverride
Sets the option to allow material override.
UI Access N/A.
SetBackgroundMaterial
Sets the design's background material.
Important:
You can only use this script in 2D Extractor if there is no surface ground in the design and the problem type is "open".
UI Access From the Project Manager, right-click the design and select Set Background Material.
SetDesignMode
Switches between HFSS 3D Layout operating modes.
SetDesignSettings
Sets the design settings.
[
"NAME:Model Validation Settings",
"EntityCheckLevel:=" , "Strict",
"IgnoreUnclassifiedObjects:=", False,
"SkipIntersectionChecks:=", False
])
],
[
"NAME:Model Validation Settings",
"EntityCheckLevel:=", "Strict",
"IgnoreUnclassifiedObjects:=", False,
"SkipIntersectionChecks:=", False
])
SetDoMeshAssembly
Set the active Mesh fusion properties for each object.
Command: Set Components for Mesh Fusion
Syntax: SetDoMeshAssembly <MeshAssemblyParameters>
Return Value: None
Parameters: <MeshAssemblyParameters>
Python Example
oDesign.SetDoMeshAssembly(
[
"NAME:AllSettings",
[
"NAME:MeshAssembly",
[
"NAME:Cylinder3",
[
"NAME:MeshSetting",
[
"NAME:GlobalSurfApproximation",
"CurvedSurfaceApproxChoice:=", "UseSlider",
"SliderMeshSettings:=" , 7
],
[
"NAME:GlobalCurvilinear",
"Apply:=" , False
],
[
"NAME:GlobalModelRes",
"UseAutoLength:=" , True
],
"MeshMethod:=" , "AnsoftClassic",
"UseLegacyFaceterForTauVolumeMesh:=", False,
"DynamicSurfaceResolution:=", False,
"UseFlexMeshingForTAUvolumeMesh:=", False,
"UseAlternativeMeshMethodsAsFallBack:=", True,
"AllowPhiForLayeredGeometry:=", True
],
"MeshAssemblyBoundingVolumePadding:=", ["0","0","0","0","0","0"]
],
[
"NAME:Pentagon_tilted2_1",
"MeshAssemblyBoundingVolumePadding:=", ["0","0","0","0","0","0"]
],
[
"NAME:Cone_with_variable1",
"MeshAssemblyBoundingVolumePadding:=", ["0","0","0","0","0","0"]
]
],
[
"NAME:Priority Components",
"Cylinder3",
"Cone_with_variable1",
"BoxWithMeshRegion1"
]
])
SetFastTransformationForLayoutComponent
Toggles whether layout components in HFSS 3D show outlines of objects across layers during view changes. This improves the visu-
alization performance.
SetLengthSettings
Sets the distributed and lumped lengths of the design, as well as the rise time.
UI Access N/A
SetObjectAttributesForLayoutComponent
Sets visualization attributes for layout components in HFSS 3D for a named component for layers, net and objects.
"ShowDielectric:=" , False,
"DisplayMode:=" , 2,
[
"NAME:ObjectAttributesInLayerMode",
"GND_1_L2:=" , [True,True,0],
"GND_2_L4:=" , [True,True,0],
"GND_3_L6:=" , [True,True,0],
"GND_4_L9:=" , [True,True,0],
"GND_5_L11:=" , [True,True,0],
"Inner_Layer_3_L10:=" , [True,True,0],
"Top_L1:=" , [True,True,100],
"VCC1_L7:=" , [True,True,0],
"VCC2_L8:=" , [True,True,0]
],
[
"NAME:ObjectAttributesInNetMode",
"GND:=" , [True,True,29],
"VCC:=" , [True,True,0],
"neg:=" , [True,True,67],
"pos:=" , [True,True,67]
],
[
"NAME:ObjectAttributesInObjectMode",
"line_1:=" , [True,True,0],
"line_2:=" , [True,True,0],
"line_3:=" , [True,True,100],
"line_4:=" , [True,True,100],
"rect_6:=" , [True,True,0],
"rect_17:=" , [True,True,0],
"rect_18:=" , [True,True,0],
"rect_19:=" , [True,True,0],
"rect_20:=" , [True,True,0],
"rect_21:=" , [True,True,0],
"rect_22:=" , [True,True,0],
"line_24:=" , [True,True,100],
"via_0:=" , [True,True,100],
"via_1:=" , [True,True,100],
"via_2:=" , [True,True,100],
"via_3:=" , [True,True,100]
]
])
SetObjectDeformation
Sets the deformation of objects when calling Ansys Electronics Desktop from Ansys Workbench
UI Access N/A
SetObjectTemperature
Sets the temperature of objects.
oDesign.SetObjectTemperature Array(
VB "NAME:TemperatureSettings", "IncludeTemperatureDependence:=", _
Example true, "EnableFeedback:=", true, "Temperatures:=", Array("RegularPolyhedron1", _
"22cel", "Polygon1", "22cel"))
SetPhaseCenterPerPort
Sets phase center per port for an HFSS Modal antenna in preparation for link to a target SBR+ design.
UI Access N/A
[
"NAME:1", "Coordinate System:=", "Phase Center CS1",
"NAME:2", "Coordinate System:=", "Phase Center CS2"
])
SetPropValue [Design]
Sets the property value for the active property object.
Boolean:
Return Value l True - property found and the new value is valid.
l False - property not found.
tax
SetPropertyValue
Sets the value of a single propertybelonging to a specific PropServer and PropTab. This function is available with the Project, Design
or Editor objects, including definition editors.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.
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.
UI Access N/A
l ConstantsTab ("Constants")
l ComponentTab ("General")
l Component("Component")
l Quantities ("Quantities")
l Signals ("Signals")
<propServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<propName> String Name of the property.
<propValue> String The value for the property
SetShowLayoutForLayoutComponent
Layout visualization, rather than bounding box, for a Layout Component in an HFSS 3D design.
SetSinglePhaseCenter
Sets a single phase center for an HFSS Modal antenna in preparation for link to a target SBR+ design.
UI Access N/A
SetSolutionType
Sets the solution type for the design.
<ModelExteriorAsIE> String Only Applies for Driven Solution Type with Auto Open Mode as True.
Possible values are: Radiation, FEBI, PML
[
"NAME:Options",
"EnableAutoOpen:=" , False
])
oDesign.SetSolutionType("Transient Network",
[
"NAME:Options",
"EnableAutoOpen:=" , False
])
oDesign.SetSolutionType("SBR+",
[
"NAME:Options",
"EnableAutoOpen:=" , False
])
SetSolveInsideThreshold
Sets the solve inside threshold to the specified double.
UI Access N/A
SetSourceContexts
For Near or Far Field projects for Driven Modal or Driven Terminal Network Analysis Solutions, specifies the port name and all mod-
es/terminals of that port to be enabled as Source Context.
SetVariableValue
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.
UI Access N/A
SimulateLink
Runs linked simulation.
UI Access N/A
Solve
Performs one or more simulation. The next script command will not be executed until the simulation(s) are complete.
Integer:
Return Value
l 0 – Simulation(s) completed.
l 1 – Simulation error.
l -1 – Command execution error.
StopSimLink
Stops linked simulation.
UI Access N/A
Undo [Design]
Cancels the last design-level command.
VB Syntax Undo
VB Example oDesign.Undo
ValidateLink
Note:
This command is for internal Ansys use only.
ValidateDesign
Returns whether a design is valid.
VB Syntax ValidateDesign
VB Example oDesign.ValidateDesign
ValidateLink
Note:
This command is for internal Ansys use only.
9-154
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Assign Array
Creates an array based on a unit cell model.
If the array has Enable Sizing Variable enabled, a block for Enable Sizing Variable will occur, and will show for AVector and for
BVector. The Python example shows this block.
oModule.AssignArray(
[
"NAME:A",
"Name:=" , "A",
"UseAirObjects:=" , True,
"RowPrimaryBnd:=" , "Primary1",
"ColumnPrimaryBnd:=" , "Primary2",
"RowDimension:=" , 5,
"ColumnDimension:=" , 5,
"Visible:=" , False,
"ShowCellNumber:=" , True,
"RenderType:=" , 0,
"Padding:=" , 1,
"PostProcessRow:=" , "3",
"PostProcessCol:=" , "3",
"Active:=" , "All",
"Air:=" , "None"
[
"Name:EnableSizingVariable",
"ForAVector:=", "AVectorVar",
"ForBVector:=". "BVectorVar"
]
])
CreateArrayAirbox
Creates an array airbox.
"kXNegPad:=" , <real>,
"kYPosPad:=" , <real>,
"kYNegPad:=" , <real>,
"kZPosPad:=" , <real>,
"kZNegPad:=" , <real>,
"Boundary:=" , "<string>",
"ApplyInfiniteGP:=" , <boolean>
["direction:=", "<InfiniteGPDirection>"]
)
"ApplyInfiniteGP:=" , False
]
)
CreateOpenRegion
Creates an open region volume.
DeleteArray
Use: Delete an existing array based on a unit cell model.
Command: Delete
Syntax: DeleteArray
Return Value: None
Parameters: None
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("forcreatearraycube")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("ModelSetup")
oModule.DeleteArray
EditArray
Edits the properties of an existing array.
If the array has Enable Sizing Variable enabled, a block for Enable Sizing Variable will occur, and will show for AVector and for
BVector. The Python example shows this block.
[5,5]"
]
],
["NAME:Rotation"
],
"Active:=" , "All",
[
"NAME:PostProcessingCells"
],
"Colors:=" , []
])
GetArrayNames
Gets names of the arrays defined in the current design.
UI Access N/A
Parameters None.
Return Value Array of names.
VB Syntax GetArrayNames
VB Example oModule.GetArrayNames
GetLatticeVectors
Gets lattice vectors defined in the current design.
UI Access N/A
Parameters None.
Return Value Array of starting point coordinates paired with ending point coordinates.
VB Syntax GetLatticeVectors
VB Example oModule.GetLatticeVectors
IsArrayDefined
Determines whether an array is defined in the current design.
UI Access N/A
Parameters None.
Integer:
Return Value l 1 - an array is already defined.
l 0 - no array has been defined.
VB Syntax IsArrayDefined
VB Example oModule.IsArrayDefined
UpdateArrayAirbox
Updates an array airbox.
UI Access N/A.
UpdateOpenRegionPadding
Updates the padding for a defined open region.
"UseMaterialAppearance:=", <boolean>,
"IsLightweight:=", <boolean>)
Where:
l Flags – Takes a string containing "NonModel" and/or "Wireframe", separated by the # character. For example,
"NonModel#Wireframe".
l Color – Takes a string containing an RGB triple, formatted as "(<RGB>)". For example, "(255 255 255)".
l Transparency – Takes a value between 0 and 1.
l PartCoordinateSystem – Orientation of the primitive. The name of one of the defined coordinate systems should be specified.
l UDMId – Takes a string containing an ID.
l MaterialValue – Takes a string of the material name.
l SurfaceMaterialValue – Takes a string of the surface material name.
l Solveinside – Takes a boolean value.
l ShellElement – Takes a boolean value specifying whether or not a shell element is present.
l ShellElementThickness – Takes a string containing the shell element thickness. If element is not present, pass empty string.
l IsMaterialEditable – Takes a boolean value.
l IsLightweight – Takes a boolean value.
<SelectionsArray>
<SelectionsArray> typically takes the following structure:
Array("NAME:Selections",
"Selections:=", <string>)
Where:
l Selections – Takes a comma-separated list of parts on which to perform the action. For example, "Rect1, Rect2, Rect3".
Note:
Selections is the only parameter required in all 3D Modeler Editor scripts. See individual scripts for additional required para-
meters.
Organization
UI Access N/A
DeletePolylinePoint
Deletes either a start point or an end point from an existing polyline segment.
"<PolylineName>:<PolylineAction>:<int>">,
"Segment Index:=", <integer>,
"At Start:=", <bool True for start point; False
for end point>)
DuplicateAlongLine
Duplicates specified parts along a line.
["NAME:Selections",
"Selections:=" , "Box1",
"NewPartsModelFlag:=" , "Model"
],
["NAME:DuplicateToAlongLineParameters",
"CreateNewObjects:=" , False,
"XComponent:=" , "1mm",
"YComponent:=" , "-0.7mm",
"ZComponent:=" , "0mm",
"NumClones:=" , "2"
],
["NAME:Options",
"DuplicateAssignments:=", False
],
["CreateGroupsForNewObjects:=", False
])
Array( "NAME:Selections",
"Selections:=", "Box1",
"NewPartsModelFlag:=", "Model")
Array( "NAME:DuplicateToAlongLineParameters",
"CreateNewObjects:=", false,
"XComponent:=", "1mm",
"YComponent:=", "-0.7mm",
"ZComponent:=", "0mm",
"NumClones:=", "2")
Array( "NAME:Options",
"DuplicateAssignments:=", false)
Array( "CreateGroupsForNewObjects:=", false)
DuplicateAroundAxis
Duplicates specified parts around an axis.
Array("NAME:DuplicateAroundAxisParameters",
"CreateNewObjects:=" , <boolean>,
"WhichAxis:=" , <string>,
"AngleStr:=" , <string>,
"NumClones:=" , <string containing number greater
than 1>)
<OptionsArray> Array Structured array.
Array("NAME:Options",
"DuplicateAssignments:=", <boolean>)
<CreateGroup> Array Optional. Structured array.
Array("CreateGroupsForNewObjects:=", <boolean>)
"CreateNewObjects:=" , True,
"WhichAxis:=" , "Z",
"AngleStr:=" , "90deg",
"NumClones:=" , "2"
],
["NAME:Options",
"DuplicateAssignments:=", False
],
["CreateGroupsForNewObjects:=", False
])
Array("NAME:Options",
"DuplicateAssignments:=", false)
Array("CreateGroupsForNewObjects:=", false)
DuplicateMirror
Duplicates specified parts according to a mirror plane.
"DuplicateAssignments:=", <boolean>)
<CreateGroup> Array Optional. Structured array.
Array("CreateGroupsForNewObjects:=", <boolean>)
],
["CreateGroupsForNewObjects:=", False
])
Mirror
Mirrors specified part(s).
["NAME:MirrorParameters",
"MirrorBaseX:=" , "-0.2mm",
"MirrorBaseY:=" , "-1.2mm",
"MirrorBaseZ:=" , "0mm",
"MirrorNormalX:=" , "-0.316227766016838mm",
"MirrorNormalY:=" , "0.948683298050514mm",
"MirrorNormalZ:=" , "0mm"
])
"MirrorNormalZ:=", "0mm")
Move
Moves specified part(s).
"TranslateVectorX:=" , "-0.5mm",
"TranslateVectorY:=" , "0.1mm",
"TranslateVectorZ:=" , "0mm"
])
OffsetFaces
Offsets the faces of selected part(s).
Array("NAME:OffsetParameters",
"OffsetDistance:=" , <string>)
VB Syntax Paste
oEditor.Copy Array("NAME:Selections", "Selections:=" , "Box1_2")
VB Example
oEditor.Paste
Rotate
Rotates specified object(s).
oEditor.Rotate
Array("NAME:Selections",
"Selections:=", "Box1_1",
VB Example "NewPartsModelFlag:=", "Model")
Array("NAME:RotateParameters",
"RotateAxis:=", "Z",
"RotateAngle:=", "90deg")
Scale
Scales specified object(s).
oEditor.Scale(
["NAME:Selections",
"Selections:=", "Box1",
"NewPartsModelFlag:=", "Model"
],
Python Example
["NAME:ScaleParameters",
"ScaleX:=", "2",
"ScaleY:=", "2",
"ScaleZ:=", "2"
])
Export
ExportModelImageToFile
ExportModelMeshToFile
Fillet
FlattenGroup
Generate History
GetActiveCoordinateSystem
GetCoordinateSystems
HealObject
Import
ImportDXF
ImportGDSII [Modeler]
Intersect
MoveCStoEnd
MoveEntityToGroup
MoveFaces
ProjectSheet
PurgeHistory
ReplaceWith3DComponent
Section
SeparateBody
SetModelUnits
SetWCS
ShowWindow
Split
Subtract
SweepFacesAlongNormal
ThickenSheet
UncoverFaces
Unite
Ungroup
WrapSheet
AlignFaces
Aligns the adjacent selected faces of imported objects which have only one operation in their History Tree.
AssignMaterial
Assigns a material to specified object(s).
l SolveInside
l ShellElement
l ShellElementThickness
l IsMaterialEditable
l UseMaterialAppearance
l IsLightweight
oEditor.AssignMaterial(
["NAME:Selections",
"AllowRegionDependentPartSelectionForPMLCreation:=", True,
"AllowRegionSelectionForPMLCreation:=", True,
"Selections:=" , "Box1"
],
["NAME:Attributes",
Python Example "MaterialValue:=" , "diamond",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=" , "nan",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=" , False,
"IsLightweight:=" , False
])
oEditor.AssignMaterial
Array("NAME:Selections",
"AllowRegionDependentPartSelectionForPMLCreation:=", true,
"AllowRegionSelectionForPMLCreation:=", true,
"Selections:=" , "Box1")
Array("NAME:Attributes",
VB Example "MaterialValue:=" , "diamond",
"SolveInside:=" , false,
"ShellElement:=" , false,
"ShellElementThickness:=" , "nan",
"IsMaterialEditable:=" , true,
"UseMaterialAppearance:=" , false,
"IsLightweight:=" , false)
Chamfer
Creates a chamfer.
Array("NAME:Parameters",
Array("NAME:ChamferParameters",
"Edges:=" , <array containing integer>,
"Vertices:=" , <array>,
"LeftDistance:=" , <string>,
"RightDistance:=" , <string>,
"ChamferType:=" , <string "Symmetric",
"Left Distance-Angle", "Right Distance-Angle", or
"Left Distance-Right Distance">)
)
"LeftDistance:=" , "0.1mm",
"RightDistance:=" , "0.1mm",
"ChamferType:=" , "Symmetric"
]
])
CleanUpModel
Cleans up history tree operations.
VB Syntax CleanUpModel
VB Example oEditor.CleanUpModel
Connect
Connects two or more 1D polyline objects or 2D sheet objects.
CoverLines
Covers two or more 1D objects to form a sheet.
oEditor.CoverLines Array(
"NAME:Selections",
VB Example
"Selections:=", "Polyline3,Polyline4",
"NewPartsModelFlag:=", "Model")
CoverSurfaces
Covers two or more faces to form a solid object.
"Selections:=", "Obj1_Face1,Obj2_Face2",
"NewPartsModelFlag:=", "Model")
CreateEntityList
Creates a list of entities containing objects or faces (not both).
UI Access Modeler > List > Create > [Object / Face] List.
"EntityList:=", "Bondwire1,Bondwire2"
],
["NAME:Attributes",
"Name:=", "Objectlist1"
])
CreateFaceCS
Creates a Face Coordinate System from a selected face.
Parameters Array("NAME:FaceCSParameters",
<OriginArray>,
"MoveToEnd:=", <boolean>,
"FaceID:=", <integer>,
<AxisPosnArray>,
"WhichAxis:=" , <string "X", "Y", or "Z">,
"ZRotationAngle:=" , <string>,
"XOffset:=" , <string>,
"YOffset:=" , <string>,
"AutoAxis:=" , <boolean>)
<OriginArray> Array Structured array.
Array("NAME:Origin",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"PositionType:=" , <string "FaceCenter",
"EdgeCenter", "OnVertex", "OnEdge", or "OnFace">,
"UParam:=" , <float between 0 and 1 representing
the relative position of the point on the edge or
face>,
"VParam:=" , <float between 0 and 1 representing
the relative position of the point on the edge or
face>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
IsAttachedToEntity specifies whether the point is anchored to a vertex,
edge, or face. If True, provide UParam and VParam. If False, provide
XPosition, YPosition, and ZPosition to provide fixed position. Pass "0" for
unused parameters.
<AxisPosnArray> Array Structured array.
Array("NAME:AxisPosn",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"PositionType:=" , <string "FaceCenter",
"EdgeCenter", "OnVertex", "OnEdge", or "OnFace">,
"UParam:=" , <float>,
"VParam:=" , <float>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
<AttributesArray> Array Structured array. See: AttributesArray.
oEditor.CreateFaceCS(
["NAME:FaceCSParameters",
["NAME:Origin",
"IsAttachedToEntity:=" , True,
"EntityID:=" , 46,
"FacetedBodyTriangleIndex:=", -1,
"TriangleVertexIndex:=" , -1,
"PositionType:=" , "FaceCenter",
"UParam:=" , 0,
"VParam:=" , 0,
Python Example
"XPosition:=" , "0",
"YPosition:=" , "0",
"ZPosition:=" , "0"
],
"MoveToEnd:=" , False,
"FaceID:=" , 46,
["NAME:AxisPosn",
"IsAttachedToEntity:=" , True,
"EntityID:=" , 46,
"FacetedBodyTriangleIndex:=", -1,
"TriangleVertexIndex:=" , -1,
"PositionType:=" , "OnFace",
"UParam:=" , 0.487129134674319,
"VParam:=" , 0.308528523557527,
"XPosition:=" , "1292.27748080459mm",
"YPosition:=" , "-814.882885865484mm",
"ZPosition:=" , "0mm"
],
"WhichAxis:=" , "X",
"ZRotationAngle:=" , "0deg",
"XOffset:=" , "0mm",
"YOffset:=" , "0mm",
"AutoAxis:=" , False
],
["NAME:Attributes",
"Name:=" , "FaceCS1",
"PartName:=" , "Rectangle1"
])
tachedToEntity:=", _
true, "EntityID:=", 58, "FacetedBodyTriangleIndex:=", -1, "TriangleVertexIndex:=", _
-1, "PositionType:=", "FaceCenter", "UParam:=", 0, "VParam:=", 0, "XPosition:=", _
"0", "YPosition:=", "0", "ZPosition:=", "0"), "MoveToEnd:=", false, "FaceID:=", _
58, Array("NAME:AxisPosn", "IsAttachedToEntity:=", true, "EntityID:=", 58,
"FacetedBodyTriangleIndex:=", _
Exampl-
e -1, "TriangleVertexIndex:=", -1, "PositionType:=", "OnFace", "UParam:=", _
0.0664066713146499, "VParam:=", 0.407014331135309, "XPosition:=", _
"1826.56266852586mm", "YPosition:=", "-1355.79140131881mm", "ZPosition:=", "0mm"),
"WhichAxis:=", _
"X", "ZRotationAngle:=", "0deg", "XOffset:=", "0mm", "YOffset:=", "0mm", "AutoAxis:=",
_
false), Array("NAME:Attributes", "Name:=", "FaceCS2", "PartName:=", "Rectangle2")
CreateGroup
Creates a group from objects specified in the history tree.
Parameters Array("NAME:GroupParameter",
"ParentGroupID:=" , <string>,
"Parts:=" , <string>,
"SubmodelInstances:=" , <string>,
"Groups:=" , <string>)
CreateObjectCS
Creates an object coordinate system from a selected object.
UI Access Modeler > Coordinate System > Create > Object > [Offset / Rotated / Both].
face>,
"VParam:=" , <float between 0 and 1 representing
the relative position of the point on the edge or
face>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
IsAttachedToEntity specifies whether the point is anchored. If True,
provide UParam and VParam. If False, provide XPosition, YPosition, and
ZPosition to provide fixed position. Pass "0" for unused parameters.
<xAxisArray> Array Structured array for absolute position:
Array("NAME:xAxis",
"DirectionType:=" , "AbsoluteDirection",
"EdgeID:=" , <integer>,
"FaceID:=" , <integer>,
"xDirection:=" , <string>,
"yDirection:=" , <string>,
"zDirection:=" , <string>,
"UParam:=" , <float>,
"VParam:=" , <float>)
<xAxisPosArray> Array Structured array for relative position:
Array("NAME:xAxisPos",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"PositionType:=" , <string "OnVertex",
"EdgeCenter", "FaceCenter", or "OnEdge">,
"UParam:=" , <float>,
"VParam:=" , <float>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
<yAxisArray> Array Structured array for absolute position:
Array("NAME:yAxis",
"DirectionType:=" , "AbsoluteDirection",
"EdgeID:=" , <integer>,
"FaceID:=" , <integer>,
"xDirection:=" , <string>,
"yDirection:=" , <string>,
"zDirection:=" , <string>,
"UParam:=" , <float>,
"VParam:=" , <float>)
<yAxisPosArray> Array Structured array for relative position:
Array("NAME:yAxisPos",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"PositionType:=" , <string "OnVertex",
"EdgeCenter", "FaceCenter", or "OnEdge">,
"UParam:=" , <float>,
"VParam:=" , <float>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
<AttributesArray> Array Structured array. See: AttributesArray.
"TriangleVertexIndex:=" , -1,
"PositionType:=" , "OnVertex",
"UParam:=" , 0,
"VParam:=" , 0,
"XPosition:=" , "0",
"YPosition:=" , "0",
"ZPosition:=" , "0"
],
"MoveToEnd:=" , False,
"ReverseXAxis:=" , False,
"ReverseYAxis:=" , False,
["NAME:xAxis",
"DirectionType:=" , "AbsoluteDirection",
"EdgeID:=" , -1,
"FaceID:=" , -1,
"xDirection:=" , "1",
"yDirection:=" , "0",
"zDirection:=" , "0",
"UParam:=" , 0,
"VParam:=" , 0
],
["NAME:yAxis",
"DirectionType:=" , "AbsoluteDirection",
"EdgeID:=" , -1,
"FaceID:=" , -1,
"xDirection:=" , "0",
"yDirection:=" , "1",
"zDirection:=" , "0",
"UParam:=" , 0,
"VParam:=" , 0
]
],
["NAME:Attributes",
"Name:=" , "ObjectCS1",
"PartName:=" , "Box2"
])
VB
oEditor.CreateObjectCS Array("NAME:ObjectCSParameters", Array("NAME:Origin", "IsAt-
Exampl- tachedToEntity:=", _
e false, "EntityID:=", -1, "FacetedBodyTriangleIndex:=", -1, "TriangleVertexIndex:=", _
CreateObjectFromEdges
Creates an object from the specified object edge.
Array("NAME:BodyFromEdgeToPara-
meters",
"Edges:=" , <array containing
integer edges>
)
)
<CreateGroupsForNewObjects> Array Structured array.
Array("CreateGroupsForNewObjects:=",
<boolean True to create groups for new
objects; else False>)
["CreateGroupsForNewObjects:=", False
])
CreateObjectFromFace
Creates 2D objects from specified face(s).
UI Access N/A
CreateObjectFromFaces
Creates 2D objects from specified face(s).
"FacesToDetach:=" , [68]
]
],
["CreateGroupsForNewObjects:=", False
])
CreateRelativeCS
Creates a Relative Coordinate System.
UI Access Modeler > Coordinate System > Create > Relative CS > [Offset / Rotated / Both].
"OriginZ:=" , <string>,
"XAxisXvec:=" , <string>,
"XAxisYvec:=" , <string>,
"XAxisZvec:=" , <string>,
"YAxisXvec:=" , <string>,
"YAxisYvec:=" , <string>,
"YAxisZvec:=" , <string>)
<AttributesArray> Array Structured array. See: AttributesArray. CreateRelativeCS supports only
the "Name" parameter.
"XAxisZvec:=" , "0mm",
"YAxisXvec:=" , "0mm",
"YAxisYvec:=" , "1mm",
"YAxisZvec:=" , "0mm"
],
["NAME:Attributes",
"Name:=" , "RelativeCS1"
])
DeleteEmptyGroups
Deletes group(s) from the history tree.
DeleteLastOperation
Deletes the last operation performed on the specified object(s).
oEditor.DeleteLastOperation([
"NAME:Selections",
Python Example "Selections:=", "Box3",
"NewPartsModelFlag:=", "Model"
])
DeleteOperation
Deletes specified operation performed on a selected object.
UI Access Select an operation in the project tree, then press Delete on the keyboard.
Array("NAME:PartOperations", _
Array("NAME:Coil_0", _
"OperationIndices:=", Array(1))), _
Array("NAME:UDMOperations"))
DetachEdges
Detaches the specified edge(s) from an object.
"NewPartsModelFlag:=", "Model"
],
["NAME:Parameters",
["NAME:DetachEdgesToParameters",
"EdgesToDetach:=", [18,17]
]
])
DetachFaces
Detaches the specified face(s) from an object.
<DetachFacesArray>)
<DetachFacesArray> Array Structured array.
Array("NAME:DetachFacesToParameters",
"FacesToDetach:=" , <array containing integer
face IDs>)
"NewPartsModelFlag:=", "Model")
Example Array("NAME:Parameters", Array("NAME:DetachFacesToParameters", "FacesToDetach:=",
[68,67]))
EditEntityList
Modifies an entity list.
],
["NAME:GeometryEntityListParameters",
"EntityType:=" , "Object",
"EntityList:=" , "Box1, Box2, Box3"
])
EditFaceCS
Recreates an existing face coordinate system. See: CreateFaceCS.
Parameters Array("NAME:FaceCSParameters",
<OriginArray>,
"MoveToEnd:=", <boolean>,
"FaceID:=", <integer>,
<AxisPosnArray>,
"WhichAxis:=" , <string "X", "Y", or "Z">,
"ZRotationAngle:=" , <string>,
"XOffset:=" , <string>,
"YOffset:=" , <string>,
"AutoAxis:=" , <boolean>)
<OriginArray> Array Structured array.
Array("NAME:Origin",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"PositionType:=" , <string "FaceCenter",
"EdgeCenter", "OnVertex", "OnEdge", or "OnFace">,
"UParam:=" , <float between 0 and 1 representing
the relative position of the point on the edge or
face>,
"VParam:=" , <float between 0 and 1 representing
the relative position of the point on the edge or
face>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
IsAttachedToEntity specifies whether the point is anchored to a vertex,
edge, or face. If True, provide UParam and VParam. If False, provide
XPosition, YPosition, and ZPosition to provide fixed position. Pass "0" for
unused parameters.
<AxisPosnArray> Array Structured array.
Array("NAME:AxisPosn",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"PositionType:=" , <string "FaceCenter",
"EdgeCenter", "OnVertex", "OnEdge", or "OnFace">,
"UParam:=" , <float>,
"VParam:=" , <float>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
<AttributesArray> Array Structured array. See: AttributesArray. Use to select the coordinate sys-
tem to edit.
oEditor.EditFaceCS(
["NAME:FaceCSParameters",
["NAME:Origin",
"IsAttachedToEntity:=" , True,
"EntityID:=" , 12,
"FacetedBodyTriangleIndex:=", -1,
"TriangleVertexIndex:=" , -1,
"PositionType:=" , "FaceCenter",
"UParam:=" , 0,
"VParam:=" , 0,
Python Example
"XPosition:=" , "0",
"YPosition:=" , "0",
"ZPosition:=" , "0"
],
"MoveToEnd:=" , False,
"FaceID:=" , 12,
["NAME:AxisPosn",
"IsAttachedToEntity:=" , True,
"EntityID:=" , 12,
"FacetedBodyTriangleIndex:=", -1,
"TriangleVertexIndex:=" , -1,
"PositionType:=" , "OnFace",
"UParam:=" , 0.62951717774066,
"VParam:=" , 0.226514925559344,
"XPosition:=" , "1200mm",
"YPosition:=" , "-354.697014888131mm",
"ZPosition:=" , "125.903435548132mm"
],
"WhichAxis:=" , "X",
"ZRotationAngle:=" , "0deg",
"XOffset:=" , "0mm",
"YOffset:=" , "0mm",
"AutoAxis:=" , False
],
["NAME:Attributes",
"Name:=" , "FaceCS1",
"PartName:=" , "Box1"
])
Array("NAME:FaceCSParameters",
Array("NAME:Origin",
"IsAttachedToEntity:=" , True,
"EntityID:=" , 12,
"FacetedBodyTriangleIndex:=", -1,
"TriangleVertexIndex:=" , -1,
"PositionType:=" , "FaceCenter",
"UParam:=" , 0,
"VParam:=" , 0,
"XPosition:=" , "0",
"YPosition:=" , "0",
"ZPosition:=" , "0"),
"MoveToEnd:=" , False,
"FaceID:=" , 12,
Array("NAME:AxisPosn",
"IsAttachedToEntity:=" , True,
"EntityID:=" , 12,
"FacetedBodyTriangleIndex:=", -1,
"TriangleVertexIndex:=" , -1,
"PositionType:=" , "OnFace",
"UParam:=" , 0.62951717774066,
"VParam:=" , 0.226514925559344,
"XPosition:=" , "1200mm",
"YPosition:=" , "-354.697014888131mm",
"ZPosition:=" , "125.903435548132mm"),
"WhichAxis:=" , "X",
"ZRotationAngle:=" , "0deg",
"XOffset:=" , "0mm",
"YOffset:=" , "0mm",
"AutoAxis:=" , False)
Array("NAME:Attributes",
"Name:=" , "FaceCS1",
"PartName:=" , "Box1")
EditObjectCS
Edits an existing object coordinate system. See: CreateObjectCS.
Parameters Array("NAME:ObjectCSParameters",
<OriginArray>
"MoveToEnd:=" , <boolean>,
"ReverseXAxis:=" , <boolean>,
"ReverseYAxis:=" , <boolean>,
<xAxisArray / xAxisPosArray>
<yAxisArray / yAxisPosArray>)
Note: xAxisArray and xAxisPosArray differ. Use xAxisArray for absolute
position and xAxisPosArray for relative position. Do the same for yAx-
isArray and yAxisPosArray.
<OriginArray> Array Structured array.
Array("NAME:Origin",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"PositionType:=" , <string "OnVertex",
"EdgeCenter", "FaceCenter", "OnEdge", or "Abso-
lutePosition">,
"UParam:=" , <float between 0 and 1 representing
the relative position of the point on the edge or
face>,
"VParam:=" , <float between 0 and 1 representing
the relative position of the point on the edge or
face>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
IsAttachedToEntity specifies whether the point is anchored. If True,
provide UParam and VParam. If False, provide XPosition, YPosition, and
ZPosition to provide fixed position. Pass "0" for unused parameters.
<xAxisArray> Array Structured array for absolute position:
Array("NAME:xAxis",
"DirectionType:=" , "AbsoluteDirection",
"EdgeID:=" , <integer>,
"FaceID:=" , <integer>,
"xDirection:=" , <string>,
"yDirection:=" , <string>,
"zDirection:=" , <string>,
"UParam:=" , <float>,
"VParam:=" , <float>)
<xAxisPosArray> Array Structured array for relative position:
Array("NAME:xAxisPos",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"PositionType:=" , <string "OnVertex",
"EdgeCenter", "FaceCenter", or "OnEdge">,
"UParam:=" , <float>,
"VParam:=" , <float>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
<yAxisArray> Array Structured array for absolute position:
Array("NAME:yAxis",
"DirectionType:=" , "AbsoluteDirection",
"EdgeID:=" , <integer>,
"FaceID:=" , <integer>,
"xDirection:=" , <string>,
"yDirection:=" , <string>,
"zDirection:=" , <string>,
"UParam:=" , <float>,
"VParam:=" , <float>)
<yAxisPosArray> Array Structured array for relative position:
Array("NAME:yAxisPos",
"IsAttachedToEntity:=" , <boolean>,
"EntityID:=" , <integer>,
"FacetedBodyTriangleIndex:=", <integer>,
"TriangleVertexIndex:=" , <integer>,
"XPosition:=" , "0",
"YPosition:=" , "0",
"ZPosition:=" , "0"
],
"MoveToEnd:=" , False,
"ReverseXAxis:=" , False,
"ReverseYAxis:=" , False,
["NAME:xAxis",
"DirectionType:=" , "AbsoluteDirection",
"EdgeID:=" , -1,
"FaceID:=" , -1,
"xDirection:=" , "1",
"yDirection:=" , "0",
"zDirection:=" , "0",
"UParam:=" , 0,
"VParam:=" , 0
],
["NAME:yAxis",
"DirectionType:=" , "AbsoluteDirection",
"EdgeID:=" , -1,
"FaceID:=" , -1,
"xDirection:=" , "0",
"yDirection:=" , "1",
"zDirection:=" , "0",
"UParam:=" , 0,
"VParam:=" , 0
]
],
["NAME:Attributes",
"Name:=" , "ObjectCS1",
"PartName:=" , "Box2"
])
"EntityID:=", _
80, "FacetedBodyTriangleIndex:=", -1, "TriangleVertexIndex:=", -1, "PositionType:=", _
"EdgeCenter", "UParam:=", 0, "VParam:=", 0, "XPosition:=", "0", "YPosition:=", _
"0", "ZPosition:=", "0"), Array("NAME:yAxisPos", "IsAttachedToEntity:=", true,
"EntityID:=", _
69, "FacetedBodyTriangleIndex:=", -1, "TriangleVertexIndex:=", -1, "PositionType:=", _
"EdgeCenter", "UParam:=", 0, "VParam:=", 0, "XPosition:=", "0", "YPosition:=", _
"0", "ZPosition:=", "0")), Array("NAME:Attributes", "Name:=", "ObjectCS2",
"PartName:=", _
"Box3")
EditRelativeCS
Edits an existing Relative Coordinate System. See: CreateRelativeCS.
"XAxisXvec:=" , <string>,
"XAxisYvec:=" , <string>,
"XAxisZvec:=" , <string>,
"YAxisXvec:=" , <string>,
"YAxisYvec:=" , <string>,
"YAxisZvec:=" , <string>)
<AttributesArray> Array Structured array. See: AttributesArray. Use to select the coordinate sys-
tem to edit.
"YAxisZvec:=" , "0mm"
],
["NAME:Attributes",
"Name:=" , "RelativeCS1"
])
Export
Exports the model to a file.
Note:
This script does not export image file types or GDSII files. See: ExportModelImageToFile and ExportGDSII.
Return None.
Value
ExportModelImageToFile
Exports the model as an image file (*.avz, *.bmp, *.gif, *.jpeg, *.tiff, *.wrl). In Release 23.1, this command is fully supports -ng (non-
graphical) mode. To export to Ensight use *.avz. For export to Ensight in -ng mode, the corresponding version of Ensight must be
installed. On Linux, it might need manual set environment variable AWP_ROOT212 to its installation path, e.g. AWP_ROOT212-
2=/installations/ansys_inc/v212/ for AnsysEDT v21.2 and Ensight 21.2.
ExportModelImageToFile supports export overlay of polar plot 3D with existing transformation (scaling, rotation and translation) in -ng
(non-graphical) mode.
("C:/Users/jdoe/Desktop/export.bmp",
1920,
1080,
[
"NAME:SaveImageParams",
"ShowAxis:=" , "True",
"ShowGrid:=" , "True",
"ShowRuler:=" , "True",
"ShowRegion:=" , "Default",
"Selections:=" , "",
"FieldPlotSelections:=" , "",
"FitToSelections:=" , "",
"FitToFieldPlotSelections:=", "",
"Orientation:=" , ""
])
512,
Array("NAME:SaveImageParams",
"ShowAxis:=", "True",
"ShowGrid:=", "True",
"ShowRuler:=", "True",
"ShowRegion:=", "Default",
"Selections:=", "",
"FitToFieldPlotSelections:=", "",
"Orientation:=", ""
ExportModelMeshToFile
Exports geometry model to a 3D model file (e.g. *.obj, *.wrl, etc.).
UI Access N/A
Fillet
Performs a fillet on specified edge(s).
oEditor.Fillet(
["NAME:Selections",
"Selections:=" , "Box1",
"NewPartsModelFlag:=" , "Model"
],
["NAME:Parameters",
Python Example ["NAME:FilletParameters",
"Edges:=" , [13],
"Vertices:=" , [],
"Radius:=" , "1mm",
"Setback:=" , "0mm"
]
])
"Edges:=" , Array(13),
"Vertices:=" , Array(),
"Radius:=" , "1mm",
"Setback:=" , "0mm"))
FlattenGroup
Flattens a specified history tree group.
GenerateHistory
Generates the history for specified 1D object(s).
oEditor.GenerateHistory Array("NAME:Selections",
"Selections:=" , "Polyline1",
VB Example
"NewPartsModelFlag:=" , "Model",
"UseCurrentCS:=" , True)
GetActiveCoordinateSystem
Returns the active coordinate system.
UI Access None.
Parameters None.
Return Value String name of active coordinate system.
VB Syntax GetActiveCoordinateSystem
dim csName
VB Example
csName = oEditor.GetActiveCoordinateSystem
GetActiveCoordinateSystemTransform
Returns the transformation information of active coordinate system.
UI Access None.
Parameters None.
Return Value Array of strings containing transformation information.
VB Syntax GetActiveCoordinateSystemTransform
VB Example oEditor.GetActiveCoordinateSystemTransform
GetCoordinateSystems
Returns the names of coordinate systems in the design.
UI Access None.
Parameters None.
Return Value Array containing string names of coordinate systems.
VB Syntax GetCoordinateSystems()
VB Example dim csNames
csNames = oEditor.GetCoordinateSystems
HealObject
Heals an imported object.
"SimplifyType:=" , <integer>,
"TightenGapsWidth:=" , <float>,
"RemoveSliverFaces:=" , <boolean>,
"RemoveSmallEdges:=" , <boolean>,
"RemoveSmallFaces:=" , <boolean>,
"SliverFaceTol:=" , <integer>,
"SmallEdgeTol:=" , <integer>,
"SmallFaceAreaTol:=" , <integer>,
"BoundingBoxScaleFactor:=", <integer>,
"RemoveHoles:=" , <boolean>,
"RemoveChamfers:=" , <boolean>,
"RemoveBlends:=" , <boolean>,
"HoleRadiusTol:=" , <integer>,
"ChamferWidthTol:=" , <integer>,
"BlendRadiusTol:=" , <integer>,
"AllowableSurfaceAreaChange:=",
<integer>,
"AllowableVolumeChange:=", <integer>)
oEditor.HealObject(
["NAME:Selections",
"Selections:=" , "Box1",
"NewPartsModelFlag:=" , "Model"
],
["NAME:ObjectHealingParameters",
"Version:=" , 1,
"AutoHeal:=" , True,
"TolerantStitch:=" , True,
"SimplifyGeom:=" , True,
Python Example
"TightenGaps:=" , True,
"HealToSolid:=" , False,
"StopAfterFirstStitchError:=", False,
"MaxStitchTol:=" , 0.001,
"ExplodeAndStitch:=" , True,
"GeomSimplificationTol:=", -1,
"MaximumGeneratedRadiusForSimplification:=", -1,
"SimplifyType:=" , 2,
"TightenGapsWidth:=" , 1E-06,
"RemoveSliverFaces:=" , False,
"RemoveSmallEdges:=" , False,
"RemoveSmallFaces:=" , False,
"SliverFaceTol:=" , 0,
"SmallEdgeTol:=" , 0,
"SmallFaceAreaTol:=" , 0,
"BoundingBoxScaleFactor:=", 1250,
"RemoveHoles:=" , False,
"RemoveChamfers:=" , False,
"RemoveBlends:=" , False,
"HoleRadiusTol:=" , 0,
"ChamferWidthTol:=" , 0,
"BlendRadiusTol:=" , 0,
"AllowableSurfaceAreaChange:=", 5,
"AllowableVolumeChange:=", 5
])
Import
Imports a 3D model file.
Note:
This script does not import DXF or GDSII models. See: ImportDXF and ImportGDSII.
Array("NAME:NativeBodyParameters",
"HealOption:=" , <integer>,
"Options:=" , <string>,
"FileType:=" , <string "UnRecognized">,
"MaxStitchTol:=" , <integer>,
"ImportFreeSurfaces:=" , <boolean>,
"GroupByAssembly:=" , <boolean>,
"CreateGroup:=" , <boolean>,
"STLFileUnit:=" , <string>,
"MergeFacesAngle:=" , <float>,
"HealSTL:=" , <boolean>,
"ReduceSTL:=" , <boolean>,
"ReduceMaxError:=" , <integer>,
"ReducePercentage:=" , <integer>,
"PointCoincidenceTol:=" , <float>,
"CreateLightweightPart:=", <boolean>,
"ImportMaterialNames:=" , <boolean>,
"SeparateDisjointLumps:=", <boolean>,
"SourceFile:=" , <string>)
"SourceFile:=" , "C:\\Users\\jdoe\\Desktop\\export.model"
])
"SeparateDisjointLumps:=", False,
"SourceFile:=" , "C:\\Users\\jdoe\\Desktop\\export.model")
ImportDXF [Modeler]
Imports a DXF model file.
"DefeatureDistance:=" , 0,
"RoundCoordinates:=" , False,
"RoundNumDigits:=" , 4,
"WritePolyWithWidthAsFilledPoly:=", False,
"ImportMethod:=" , 1,
"2DSheetBodies:=" , False,
["NAME:LayerInfo",
["NAME:0",
"source:=" , "0",
"display_source:=" , "0",
"import:=" , True,
"dest:=" , "0",
"dest_selected:=" , False,
"layer_type:=" , "signal"
],
["NAME:LAYER_1",
"source:=" , "LAYER_1",
"display_source:=" , "LAYER_1",
"import:=" , True,
"dest:=" , "LAYER_1",
"dest_selected:=" , False,
"layer_type:=" , "signal"
],
["NAME:LAYER_2",
"source:=" , "LAYER_2",
"display_source:=" , "LAYER_2",
"import:=" , True,
"dest:=" , "LAYER_2",
"dest_selected:=" , False,
"layer_type:=" , "signal"
]
]
])
("NAME:0", "source:=", _
"0", "display_source:=", "0", "import:=", true, "dest:=", "0", "dest_selected:=", _
false, "layer_type:=", "signal"), Array("NAME:LAYER_1", "source:=", "LAYER_1", "dis-
play_source:=", _
"LAYER_1", "import:=", true, "dest:=", "LAYER_1", "dest_selected:=", false, "layer_
type:=", _
"signal"), Array("NAME:LAYER_2", "source:=", "LAYER_2", "display_source:=", "LAYER_2",
"import:=", _
true, "dest:=", "LAYER_2", "dest_selected:=", false, "layer_type:=", "signal")))
ImportFromClipboard
Imports a model from clipboard.
VB Syntax ImportFromClipboard
VB Example oEditor.ImportFromClipboard
ImportGDSII [Modeler]
Imports a GDSII model file.
<string DestLayer>)
["NAME:LayerMapInfo",
"LayerNum:=" , 14,
"DestLayer:=" , "Signal14",
"layer_type:=" , "signal"
]
],
"OrderMap:=",
[
"entry:=",
["order:=", 0, "layer:=", "Signal12"],
"entry:=",
["order:=", 1, "layer:=", "Signal13"],
"entry:=",
["order:=", 2, "layer:=", "Signal14"]
]
])
"ImportMethod:=", 1,
Array("NAME:LayerMap",
Array("NAME:LayerMapInfo",
"LayerNum:=", 1,
"DestLayer:=", "Signal1",
"layer_type:=", "signal"]))
"OrderMap:=", Array(
"entry:=", Array(
"order:=", 0,
"layer:=", "Signal1")))
Imprint
Imprints the geometry of one object upon another.
"KeepOriginals:=", <boolean>)
ImprintProjection
Projects the form of a sheet object onto the face or faces of another object (either solid or sheet).
"KeepOriginals:=", False,
"NormalProjection:=", True,
"Distance:=", "1.36014705087354mm",
"DirectionX:=", "0.882257546512569",
"DirectionY:=", "0.294085848837523",
"DirectionZ:=", "0.367607311046904"])
Intersect
Intersects specified objects.
"Selections:=", "Rectangle1,Rectangle2")
Array("NAME:IntersectParameters",
"KeepOriginals:=", False)
MoveCStoEnd
Moves a specified Object Coordinate System to the end of the History tree.
MoveEntityToGroup
Moves a specified entity or entities to a specified group.
Array("ParentGroup:=", "Box_Group")
MoveFaces
Moves the specified faces along normal or along a vector.
UI Access Modeler > Surface > Move Faces > Along [Normal/Vector].
"Box2,Box1"), _
Array("NAME:Parameters", _
Array("NAME:MoveFacesParameters", _
"MoveAlongNormalFlag:=", true, _
"OffsetDistance:=", "1mm", _
"FacesToMove:=", Array(218)),
Array("NAME:MoveFacesParameters", _
"MoveAlongNormalFlag:=", false,_
"OffsetDistance:=", "1mm", _
"MoveVectorX:=", "1mm", _
"MoveVectorY:=", "0mm", _
"MoveVectorZ:=", "0mm", _
"FacesToMove:=", Array(185)))
ProjectSheet
Project a sheet object, typically for modeling thin conformal deposits. Typically followed by Thicken Sheet.
PurgeHistory
Purges the history of a specified object.
ReplaceWith3DComponent
Replaces the selection with a 3D component.
UI Access None.
"HiddenParts:=", [],
"IncludedCS:=", [],
"ReferenceCS:=", "Global",
"IncludedParameters:=", ["bend_angle"],
"ParameterDescription:=", ["bend_angle:=", ""]
],
["NAME:DesignData",
"Excitations:=", ["1","2"]
],
["NAME:ImageFile",
"ImageFile:=", ""
]
)
Section
Creates a 2D cross-section of the selection in the specified plane.
Array("NAME:SectionToParameters",
"CreateNewObjects:=" , <boolean>,
"SectionPlane:=" , <string "XY", "YZ", or
"ZX">,
"SectionCrossObject:=" , <boolean>)
oEditor.Section
Array("NAME:Selections",
"Selections:=" , "Cone1",
"NewPartsModelFlag:=" , "Model")
VB Example
Array("NAME:SectionToParameters",
"CreateNewObjects:=" , True,
"SectionPlane:=" , "XY",
"SectionCrossObject:=" , False)
SeparateBody
Separates the bodies of specified multi-lump objects.
"NewPartsModelFlag:=", "Model"
])
SetModelUnits
Sets the model units.
SetWCS
Sets the working coordinate system.
ShowWindow
Opens the active 3D Modeler window.
UI Access None.
Parameters None.
Return Value None.
VB Syntax ShowWindow
VB Example oEditor.ShowWindow
Simplify
Converts a complex MCAD object into simpler primitives which are easy to mesh and solve.
"SeparateBodies:=", <boolean>,
"CloneBody:=", <boolean>,
"Generate Primitive History:=", <boolean>,
"NumberPointsCurve:=", <integer>,
"LengthThresholdCurve:=", <integer>)
<CreateGroup> Array Structured array.
Array("CreateGroupsForNewObjects:=",<boolean>)
"NumberPointsCurve:=", 3,
"LengthThresholdCurve:=", 20),
Array("CreateGroupsForNewObjects:=", true)
Split
Splits the specified object(s) along a plane.
For an edge:
l SplitPlane is "Dummy"
l ToolType is "EdgeTool"
l ToolEntityID is the face ID
"SplitCrossingObjectsOnly:=", False,
"DeleteInvalidObjects:=", True
])
Stitch
Stitches selected sheets.
Array("NAME:StitchParameters",
"MaxTol:=", -1)
Subtract
Subtracts the specified object(s).
["NAME:Selections",
"Blank Parts:=", "Rectangle1",
"Tool Parts:=", "Rectangle2"
],
["NAME:SubtractParameters",
"KeepOriginals:=", False
])
SweepFacesAlongNormal
Sweep the specified face(s) along normal.
Array("NAME:Selections",
"Selections:=", "Rectangle1",
"NewPartsModelFlag:=", "Model"),
Array("NAME:Parameters",
"NAME:SweepFaceAlongNormalToParameters",
"FacesToDetach:=", Array(57),
"LengthOfSweep:=", "0.5mm")
)
ThickenSheet
Thickens a sheet object to convert it to a 3D object.
UncoverFaces
Uncovers the specified face(s).
Parameters Array("NAME:Parameters",
Array("NAME:UncoverFacesParameters",
"FacesToUncover:=" , <array of face
IDs>))
"FacesToUncover:=" , [12,16,18]
]
])
Unite
Unites the specified objects.
Ungroup
Ungroups a specified history tree group.
WrapSheet
Wraps a sheet object to another object.
UI Access None.
AddDefinitionFromLibFile
AddViewOrientation
BreakUDMConnection
ChangeProperty
Delete
FitAll
GeometryCheckAndAutofix
GetBodyNamesByPosition
GetChildNames [Modeler]
GetChildOjbect [Modeler]
GetChildTypes [Modeler]
GetEdgeByPosition
GetEdgeIDsFromObject
GetEdgeIDsFromFace
GetEntityListIDByName
GetExtendedDefinitionObject
GetFaceArea
GetFaceByPosition
GetFaceCenter
GetFaceIDs
GetGeometryModelerMode
GetMatchedObjectName
GetModelBoundingBox
GetModelUnits
GetNumObjects
GetObjectIDByName
GetObjectName
GetObjectNameByFaceID
GetObjectsByMaterial
GetObjectsInGroup
GetObjectVolume
GetPropertyValue
GetPropEvaluatedValue
GetPropNames
GetPropSIValue
GetPropValue
GetSelections
GetUserPosition
GetVertexIDsFromEdge
GetVertexIDsFromFace
GetVertexIDsFromObject
GetVertexPosition
OpenExternalEditor
PageSetup
RenamePart
SetPropValue [Modeler]
AddDefinitionFromBlock
Adds a material definition from block text (same definition format as would be contained in the material library file) by library type
(using definition folder name). This scripting command directly supports the .AMAT (or .ASURF) definition formats.
UI Access N/A
y-
nt-
ax
oProject = oDesktop.NewProject()
oProject.InsertDesign("HFSS", "HFSSDesign1", "DrivenModal", "")
oDesign = oProject.SetActiveDesign("HFSSDesign1")
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateBox(
P- [
yt-
h-
o- "NAME:BoxParameters",
n
E-
x- "XPosition:=" , "-0.4mm",
a-
m- "YPosition:=" , "-1mm",
pl-
e
"ZPosition:=" , "0mm",
"XSize:=" , "1.4mm",
"YSize:=" , "1.6mm",
"ZSize:=" , "0.6mm"
],
"NAME:Attributes",
"Name:=" , "Box1",
"Flags:=" , "",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"vacuum\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , True,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
oDefinitionManager = oProject.GetDefinitionManager()
defBlock = "$begin 'vacuum2' $begin 'AttachedData' $begin 'MatAppearanceData' property_data-
='appearance_data' Red=230 Green=230 Blue=230 Transparency=0.95 $end 'MatAppearanceData'
$end 'AttachedData' simple('permittivity', 1) ModTime=1499970477 $end 'vacuum2'"
added = oDefinitionManager.AddDefinitionFromBlock(defBlock, "Materials", "10101010", True)
addedName = ''
if isinstance(added, basestring):
addedName = added
elif isinstance(added, list):
addedName = added[0]
else:
"NAME:AllTabs",
"NAME:Geometry3DAttributeTab",
"NAME:PropServers",
"Box1"
],
"NAME:ChangedProps",
"NAME:Material",
"Value:=", materialNameInQuotes
]
]
])
AddDefinitionFromLibFile
Adds a material definition from a library file (e.g. AMAT file), by name and library type (using definition folder name) . This scripting
command directly supports the .AMAT (or .ASURF) definition formats.
UI Access N/A
<FilePath> String Path of the library file (i.e. AMAT file or ASURF file)
<defName> String Which definition to use, required because a lib file can have multiple definitions.
Parameters
<defFolderName> String Library type (by definition folder name).
<newTimeStamp> String New timestamp string (time_t as integer, number of seconds since 1/1/1970
12:00am), default is current time
<replaceExisting> Boolean True to replace existing, False to choose a new unique name if an existing defin-
ition is found, default is False
Python
oProject = oDesktop.NewProject()
Example oProject.InsertDesign("HFSS", "HFSSDesign1", "DrivenModal", "")
oDesign = oProject.SetActiveDesign("HFSSDesign1")
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateBox(
"NAME:BoxParameters",
"XPosition:=" , "-0.4mm",
"YPosition:=" , "-1mm",
"ZPosition:=" , "0mm",
"XSize:=" , "1.4mm",
"YSize:=" , "1.6mm",
"ZSize:=" , "0.6mm"
],
"NAME:Attributes",
"Name:=" , "Box1",
"Flags:=" , "",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"vacuum\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , True,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
oDefinitionManager = oProject.GetDefinitionManager()
scriptDir = os.path.dirname(os.path.realpath(__file__))
amatFilePath = scriptDir + '/material0.txt'
materialName = "material0"
materialNameInQuotes = "\"" + materialName + "\""
added = oDefinitionManager.AddDefinitionFromLibFile(amatFilePath, materialName, "Mater-
ials", "")
addedName = ''
if isinstance(added, basestring):
addedName = added
elif isinstance(added, list):
addedName = added[0]
else:
addedName = added.GetName().replace("Materials:", "")
AddInfoMessage(os.path.basename(__file__) + " result: " + addedName)
oEditor.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Geometry3DAttributeTab",
[
"NAME:PropServers",
"Box1"
],
[
"NAME:ChangedProps",
[
"NAME:Material",
"Value:=", materialNameInQuotes
]
]
]
])
AddViewOrientation
Creates a new orientation using a script. Input parameters can be either vector components or angles. Local view orientation specific
to a design can be saved in project by calling Save() on the project object.
Note:
You cannot use the name of an existing view. Default views include: top, bottom, right, left, front, back, trimetric, dimetric,
and isometric.
UI Access View > Modify Attributes > Orientation List. Enter parameters and click Add.
Array("NAME:Scaling",
<float>,
<float>,
<float>
),
Array("NAME:Translation",
<float>,
<float>,
<float>
),
"ProjectionType:=" ,
<string "Orthographic" or "Perspective">,
Array("NAME:ProjectionLimits",
<float>,
<float>,
<float>,
<float>,
<float>,
<float>
)
Python Syntax
AddViewOrientation(<orientationName>, <isGlobalOrientation>, <OrientationVectorComponents or Ori-
entationAnglesArray>, <ProjectionParams>)
["NAME:ProjectionParams",
Python Example
["NAME:Scaling",
0.591607987880707,
0.591607987880707,
0.591607928276062
],
["NAME:Translation",
0,
2.38418579101563E-07,
-5.7486834526062
],
"ProjectionType:=" , "Orthographic",
["NAME:ProjectionLimits",
-2.44362282752991,
2.44362282752991,
-1,
1,
0.625207424163818,
10.8721580505371
]
]
)
Example Using Vector without Projection Parameters:
oEditor.AddViewOrientation("orientation6", 0,
["NAME:OrientationVectorComponents",
["NAME:Direction",
-0.801783978939056,
-0.267262011766434,
-0.534521996974945
],
["NAME:Up",
-0.507091999053955,
-0.169030994176865,
0.845155000686646
]
])
Array("NAME:ProjectionParams",
Array("NAME:Scaling",
0.591607987880707,
0.591607987880707,
0.591607928276062
),
Array("NAME:Translation",
0,
2.38418579101563E-07,
-5.7486834526062
),
"ProjectionType:=" , "Orthographic",
Array("NAME:ProjectionLimits",
-2.44362282752991,
2.44362282752991,
-1,
1,
0.625207424163818,
10.8721580505371
)
)
Example Using Vector without Projection Parameters:
oEditor.AddViewOrientation "orientation6", 0,
Array("NAME:OrientationVectorComponents",
Array("NAME:Direction",
-0.801783978939056,
-0.267262011766434,
-0.534521996974945
),
Array("NAME:Up",
-0.507091999053955,
-0.169030994176865,
0.845155000686646
)
)
AssignSurfaceMaterial
Assigns a material to specified surfaces.
UI Access N/A
Parameters l SolveInside
l ShellElement
l ShellElementThickness
l IsMaterialEditable
l UseMaterialAppearance
l IsLightweight
oEditor.AssignSurfaceMaterial(
["NAME:Selections",
"AllowRegionDependentPartSelectionForPMLCreation:=", True,
"AllowRegionSelectionForPMLCreation:=", True,
"Selections:=" , "Rectangle1"
],
["NAME:Attributes",
Python Example "MaterialValue:=" , "diamond",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=" , "nan",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=" , False,
"IsLightweight:=" , False
])
oEditor.AssignSurfaceMaterial
Array("NAME:Selections",
"AllowRegionDependentPartSelectionForPMLCreation:=", true,
"AllowRegionSelectionForPMLCreation:=", true,
"Selections:=" , "Rectangle1")
Array("NAME:Attributes",
VB Example "MaterialValue:=" , "diamond",
"SolveInside:=" , false,
"ShellElement:=" , false,
"ShellElementThickness:=" , "nan",
"IsMaterialEditable:=" , true,
"UseMaterialAppearance:=" , false,
"IsLightweight:=" , false)
BreakUDMConnection
Breaks a current UDM connection to SpaceClaim.
ChangeProperty
Changes the properties of an object in the history tree.
"NAME:PropServers" ,
"Box1"
],
[
"NAME:ChangedProps",
[
"NAME:Material",
"Value:=" , "\"vacuum\""
],
[
"NAME:Display Wireframe",
"Value:=" , True
]
]
]
])
)
)
)
Example Changing a Box's Material and Wireframe Display:
oEditor.ChangeProperty(
Array("NAME:AllTabs",
Array("NAME:Geometry3DAttributeTab",
Array("NAME:PropServers",
"Box1"
),
Array("NAME:ChangedProps",
Array("NAME:Material",
"Value:=", "\"vacuum\""
),
Array("NAME:Display Wireframe",
"Value:=", True
)
)
)
)
CloseAllWindows[Editor]
Closes all windows belong to current 3D Modeler editor.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax CloseAllWindows
VB Example oEditor.CloseAllWindows
Defeature
Removes irrelevant features from a primitive.
UI Access N/A
Parameters Array("NAME:options",
"tolerance:=", <double containing tolerance value>,
"fix:=", <boolean, if true, then self-intersections
are fixed.>)
Delete
Deletes the specified object(s).
FitAll
Fits the design to the modeling area.
VB Syntax FitAll()
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
VB Example
oEditor.FitAll()
GenerateAllUserDefinedModels
Generates all user defined models.
UI Access N/A
Parameters None.
Return Value Array of models generated.
VB Syntax GenerateAllUserDefinedModels
VB Example oEditor.GenerateAllUserDefinedModels
GenerateUserDefinedModel
Generates specified user defined model(s).
UI Access N/A
Example model2"])
VB Syn- GenerateAllUserDefinedModels
tax
GeometryCheckAndAutofix
Use: Runs Geometry Check and optionally applies autofixes.
Command: HFSS 3D Layout > Geometry Check
Syntax: GeometryCheckAndAutofix <ChecksArray>,
minimum_area_meters_squared,
<FixesArray>
Return Value: None
Parameters: <ChecksArray> - Array("NAME:checks", <check 1>, <check 2>, …, <check n>)
Specify the checks that should be included. Specifying fewer checks may speed up execution but
may also result in less problems reported in the message manager (or the logfile) and con-
sequently less problems that can be fixed by autofixes.
The following are valid checks that can be specified:
— "Self-Intersecting Polygons"
— "Disjoint Nets (Floating Nodes)"
— "DC-Short Errors"
— "Identical/Overlapping Vias"
— "Misaligments"
There may be no checks, all 5 of the checks, or anything in between. The order that checks are
specified in is not relevant.
minimum_area_meters_squared
Specify a decimal value for the minimum area (e.g. .000015) optionally in scientific notation
(e.g. 2E-006). Cutouts smaller than this minimum area may be ignored during validation check.
UI Access N/A
["NAME:Parameters",
"XPosition:=","0mm",
"YPosition:=","15mm",
"ZPosition:=","0mm"
]
)
GetChildNames [Modeler]
Returns the names of children for a specified input. For 3D Components and UDMs, these commands do not return parts, coordinate
systems, plans, as top-level modeler children.
Note:
This command is not supported by the EMIT and Circuit design types.
UI Access N/A
Standalone Example:
oEditor.GetChildNames("ModelParts")
Python Example oEditor.GetChildNames("Points")
Example used in Conjunction with GetChildObject and GetPropNames:
oDesign = oProject.GetActiveDesign()
l This returns an array containing string model parts. For example: "WG_Interior", "WG", "MT_Interior",
"MT", "Box2", "Cylinder1".
oWGi = oModel.GetChildObject("WG_Interior")
l This returns property names from child object assigned to oWGi. In this case: "Name", "Material", "Mater-
ial/SIValue", "Material/EvaluatedValue", "Solve Inside", "Orientation", "Orientation/Choices", "Model",
"Display Wireframe", "Material Appearance", "Color", "Color/Red", "Color/Green", "Color/Blue", and
"Transparent".
Standalone Example:
oEditor.GetChildNames "ModelParts"
VB Example
oEditor.GetChildNames "Points"
Example used in Conjunction with GetChildObject and GetPropNames:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Set oDesign = oProject.GetActiveDesign()
Set oModel = oDesign.GetChildObject "3D Modeler"
oModel.GetChildTypes()
l This returns an array containing string model parts. For example: "WG_Interior", "WG", "MT_Interior",
"MT", "Box2", "Cylinder1".
Set oWGi = oModel.GetChildObject "WG_Interior"
l This returns property names from child object assigned to oWGi. In this case: "Name", "Material", "Mater-
ial/SIValue", "Material/EvaluatedValue", "Solve Inside", "Orientation", "Orientation/Choices", "Model", "Dis-
play Wireframe", "Material Appearance", "Color", "Color/Red", "Color/Green", "Color/Blue", and
"Transparent".
GetChildObject [Modeler]
Returns a 3D modeler child object, which can be assigned to a variable. Will return normally if there are no active objects. For 3D Com-
ponents and UDMs, these commands do not return parts, coordinate systems, plans, as top-level modeler children.
Note: This command is not supported by the EMIT and Circuit design types.
UI Access N/A
Return Value Returns the 3D Modeler object. In the examples below, it is assigned to the variable oEditor.
Standalone Example:
oDesign = oProject.GetActiveDesign()
oEditor = oDesign.GetChildObject("3D Modeler")
Example used in Conjunction with GetChildNames and GetPropNames:
Python Example
oDesign = oProject.GetActiveDesign()
oModel = oDesign.GetChildObject("3D Modeler")
oModel.GetChildTypes()
l This returns an array containing string model parts. For example: "WG_Interior", "WG", "MT_Interior",
"MT", "Box2", "Cylinder1".
oWGi = oModel.GetChildObject("WG_Interior")
l This returns property names from child object assigned to oWGi. In this case: "Name", "Material", "Mater-
ial/SIValue", "Material/EvaluatedValue", "Solve Inside", "Orientation", "Orientation/Choices", "Model", "Dis-
play Wireframe", "Material Appearance", "Color", "Color/Red", "Color/Green", "Color/Blue", and
"Transparent".
VB Syntax GetChildObject<object>
Standalone Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
VB Example
Dim oDesign
Dim oEditor
Set oDesign = oProject.GetActiveDesign()
Set oEditor = oDesign.GetChildObject "3D Modeler"
l This returns an array containing string model parts. For example: "WG_Interior", "WG", "MT_Interior",
"MT", "Box2", "Cylinder1".
Set oWGi = oModel.GetChildObject "WG_Interior"
l This returns property names from child object assigned to oWGi. In this case: "Name", "Material", "Mater-
ial/SIValue", "Material/EvaluatedValue", "Solve Inside", "Orientation", "Orientation/Choices", "Model",
"Display Wireframe", "Material Appearance", "Color", "Color/Red", "Color/Green", "Color/Blue", and
"Transparent".
GetChildTypes [Modeler]
Gets child types of queried designs or editors obtained by GetActiveProject() and GetActiveDesign() commands. For 3D Components
and UDMs, these commands do not return parts, coordinate systems, plans, as top-level modeler children.
Note:
This command is not supported by the EMIT and Circuit design types.
UI Access N/A
Parameters None.
Return Value Array containing the names of child types.
Standalone Example:
oDesign = oProject.GetActiveDesign()
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.GetChildTypes()
Python Example
l This returns an array containing strings: "ModelParts", "AllParts", "NonModelParts", "Coordin-
ateSystems", "Points", "Planes", "SubmodelDefinitions", "Groups", and "Lists".
oDesign = oProject.GetActiveDesign()
oDesign.GetChildNames()
l This returns an array containing names of child objects for the design. For example: "Boundaries", "Nets",
"Analysis", "Optimetrics", "Radiation", "Results", and "3D Modeler".
oDesign.GetChildTypes()
l This returns an array containing the child types. For example: "Module", "Editor", and "Variable".
VB Syntax GetChildTypes()
Standalone Example:
Dim oDesign
Dim oProject
Dim oEditor
Set oDesign = oProject.GetActiveDesign()
VB Example Set oEditor = oDesign.SetActiveEditor "3D Modeler"
oEditor.GetChildTypes()
Dim oProject
Dim oDesign
Set oDesign = oProject.GetActiveDesign()
Set oDesign.GetChildNames()
l This returns an array containing names of child objects for the design. For example: "Boundaries", "Nets",
"Analysis", "Optimetrics", "Radiation", "Results", and "3D Modeler".
Set oDesign.GetChildTypes()
l This returns an array containing the child types. For example: "Module", "Editor", and "Variable".
GetEdgeByPosition
Returns the ID for edge(s) that contact a specified point.
UI Access N/A
oEditor.GetEdgeByPosition Array("NAME:EdgeParameters",
"BodyName:=", "Box1",
VB Example "Xposition:=", "10mm",
"YPosition:=", "0mm",
"ZPosition:=", "10mm")
GetEdgeIDFromNameForFirstOperation
Gets edge ID from first operation of a part.
UI Access N/A
GetEdgeIDsFromFace
Returns the edge IDs for a specified Face ID.
UI Access N/A
GetEdgeIDsFromObject
Returns the edge IDs for a specified object.
UI Access N/A
GetEdgeLength
Returns the length of edges for a specified Face ID.
UI Access N/A
GetEntityListIDByName
Returns a list of IDs in a given entity list (either object or face). See: CreateEntityList.
UI Access N/A
GetExtendedDefinitionObject
Get an object-oriented property scripting object by name and library type (using definition folder name) which also supports get-
ting/setting mod time and getting/setting generic string attributes. This scripting command directly supports the .AMAT (or .ASURF)
definition formats.
UI Access N/A
Parameters
<defName> String Definition to retrieve.
<defFolderName> String Library type (by definition folder name).
Return Value An extended material wrapper script object (see material wrapper script object functions above).
P- GetExtendedDefinitionObject(<defName>, <defFolderName>)
yt-
h-
o-
n
S-
y-
nt-
ax
oProject = oDesktop.GetActiveProject()
P-
oDefMgr = oProject.GetDefinitionManager()
yt-
h- defBlock = "$begin 'vacuum2' $begin 'AttachedData' $begin 'MatAppearanceData' property_data-
o- ='appearance_data' Red=230 Green=230 Blue=230 Transparency=0.95 $end 'MatAppearanceData'
n $end 'AttachedData' simple('permittivity', 1) ModTime=1499970477 $end 'vacuum2'"
E-
x- oDefMgr.AddDefinitionFromBlock(defBlock, 'Materials', '10101010', True)
a-
m- oMat = oDefMgr.GetExtendedDefinitionObject('vacuum2', 'Materials')
pl-
e
# use extended definition object function(s) to manipulate the definition
oMat.SetModTime("1630611487")
GetFaceArea
Returns the area of a specified face.
UI Access N/A
GetFaceCenter
Returns the center position of a specified face.
UI Access N/A
GetFaceByPosition
Returns the face ID located at a specified position.
Note:
The coordinates must point to exactly one face, not a vertex or edge where two or more faces join.
UI Access N/A
"BodyName:=", "Box1",
"XPosition:=", "0.2mm",
"YPosition:=", "-0.2mm",
"ZPosition:=", "0.4mm"
])
GetFaceIDFromNameForFirstOperation
Gets face ID from first operation of a part.
UI Access N/A
GetFaceIDs
Returns the face IDs associated with a specified object.
UI Access N/A
GetFaceIDsOfSheet
Returns the face IDs associated with a specified sheet object.
UI Access N/A
GetGeometryModelerMode
Returns the modeler mode (3D or XY) for the current design. This lets you know whether the current model is 2D or 3D.
UI Access N/A
Parameters None.
VB Syntax GetGeometryModelerMode
VB Example oEditor.GetGeometryModelerMode
GetGroupSubmodelNames
Returns name of models belong to a specific group.
UI Access N/A
GetMatchedObjectName
Returns all object names containing the input text string.
UI Access N/A
GetModelBoundingBox
Returns the bounding box of the current model.
UI Access N/A
Parameters None.
Return Value Array containing string Xmin, Ymin, Zmin, Xmax, Ymax, and Zmax values of the bounding box.
VB Syntax GeModelBoundingBox
VB Example oEditor.GetModelBoundingBox
GetModelUnits
Returns the model's unit of measure.
UI Access N/A
Parameters None.
Return Value String containing unit of measure.
VB Syntax GetModelUnits
VB Example oEditor.GetModelUnits
GetNumObjects
Returns the number of objects in a design.
UI Access N/A
Parameters None.
Return Value Integer number of objects.
VB Syntax GetNumObjects
VB Example oEditor.GetNumObjects(
GetObjectIDByName
Given an object's name, returns its ID. IDs are used with CreateEntityList.
UI Access N/A
GetObjectName
Returns an object's name from its specified base index (creation order).
UI Access N/A
VB Example oEditor.GetObjectName 3
GetObjectNameByEdgeID
Returns an object name given an edge ID.
UI Access N/A
GetObjectNameByFaceID
Returns an object name given a face ID.
UI Access N/A
GetObjectNameByID
Returns an object name given an ID.
UI Access N/A
VB Example oEditor.GetObjectNameByID 10
GetObjectNameByVertexID
Returns an object name given a vertex ID.
UI Access N/A
GetObjectsByMaterial
Returns a list of objects of a specified material.
UI Access N/A
GetObjectShapeType
Returns the shape type of a specified object.
UI Access N/A
GetObjectsInGroup
Returns a list of objects in a specified group.
UI Access N/A
GetObjectVolume
Returns an object's volume from its name).
UI Access N/A
GetObjPath [Editor]
Obtains the path to the 3D modeler.
UI Access N/A
Parameters None.
Return Value String containing the path.
VB Syntax GetObjPath
VB Example oEditor.GetObjPath
GetPartsForUserDefinedModel
Obtains parts from a specified user defined model.
UI Access N/A
UI Access N/A
Parameters None.
Return Value Array of strings containing names of points.
VB Syntax GetPoints
VB Example oEditor.GetPoints
GetPropEvaluatedValue
Returns the Evaluated-Value for Value-Property and Variable. Returns the Property-value as text string for other property types
Note:
This command is not supported by the EMIT and Circuit design types.
UI Access N/A
GetPropertyValue
Returns the value of a single property belonging to a specific <PropServer> and <PropTab>. This function is available with the Project,
Design or Editor objects, including definition editors.
Tip:
Use the script recording feature and edit a property, and then view the resulting script to see the format for that property.
UI Access N/A
Parameters
l BaseElementTab ("Symbol" or "Footprint")
l ComponentTab ("General")
l Component("Component")
l CustomTab ("Intrinsic Variables")
l Quantities ("Quantities")
Signals ("Signals")
l
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<PropName> String Name of the property.
GetPropNames [Modeler]
Returns the property names for the active model object, or specified property values.
Note:
This command is not supported by the EMIT and Circuit design types.
UI Access N/A
True by default.
VB Syntax GetPropNames(<IncludeReadOnly>)
VB Example oEditor.GetPropName True
GetPropSIValue
Returns the SI-Value for Value-Property and Variable. Return NAN for other property type if its value is not able to convert to be a
double-floating point value.
Note:
This command is not supported by the EMIT and Circuit design types.
UI Access N/A
Property value as a double floating value, or NAN if the property value cannot be converted to double floating
Return Value
point.
GetPropValue [Modeler]
Returns the property value for the active model object, or specified property values.
Note:
This command is not supported by the EMIT and Circuit design types.
UI Access N/A
VB Syntax GetPropValue(<propPath>)
Rh1 = oDesign.GetChildObject("Box1")
VB Example
GetPropValue("Orientation")
GetRelativeCoordinateSystems
Returns the relative coordinate systems in the current 3D modeler.
UI Access N/A
Parameters None.
Return Value Array containing name of relative coordinate systems.
VB Syntax GetRelativeCoordinateSystems
VB Example oEditor.GetRelativeCoordinateSystems
UI Access N/A
Parameters None.
Return Value Array containing object IDs
VB Syntax GetSelections
VB Example oEditor.GetSelections
GetSubGroupsInGroup
Returns subgroup names in a specified group.
UI Access N/A
l "<materialName>"
l "<assignmentName>"
l "Non Model"
l "Solids"
l "Unclassified"
l "Sheets"
l "Lines"
VB Syntax GetSubGroupsInGroup<group>
VB Example oEditor.GetSubGroupsInGroup "Sheets"
GetUserPosition
Returns a user's current coordinates in the 3D Modeler window.
UI Access N/A
GetVertexIDFromNameForFirstOperation
Returns vertex ID associated with a specified vertex belongs to the first operation of a part.
UI Access N/A
GetVertexIDsFromEdge
Returns vertex IDs associated with a specified edge.
UI Access N/A
GetVertexIDsFromFace
Returns vertex IDs associated with a specified face.
UI Access N/A
GetVertexIDsFromObject
Returns vertex IDs associated with a specified object.
UI Access N/A
GetVertexPosition
Returns an array of coordinates for a specified vertex.
UI Access N/A
GetWireBodyNames
Returns the wire body names in current 3D modeler.
UI Access N/A
Parameters None.
Return Value Array containing string of names.
VB Syntax GetWireBodyNames
VB Example oEditor.GetWireBodyNames
OpenExternalEditor
Launches a SpaceClaim session.
])
PageSetup
Specifies Page Setup settings for printing.
)
)
RemoveBadEdges
Removes bad edges from specified list.
UI Access N/A
RemoveBadFaces
Removes bad faces from specified list.
UI Access N/A
RemoveBadVertices
Removes bad vertices from specified list.
UI Access N/A
RenamePart
Renames an object.
SetPropValue [Modeler]
Sets the property value for the active model property.
Note:
This command is not supported by the EMIT and Circuit design types.
Boolean:
Return Value l True – property found.
l False – property not found.
SetTopDownViewDirectionForActiveView
Sets active view to top-down view direction.
UI Access N/A
SetTopDownViewDirectionForAllViews
Sets all views to top-down view direction.
UI Access N/A
UpdatePriorityList
Updates specified priority lists.
UI Access N/A
UpgradeVersion
Upgrades legacy geometry to current version.
UI Access Right-click on an operation icon in the history tree, select Upgrade Version.
Parameters Array("NAME:PartOperations",
Array("NAME:<string>",),
"OperationIndices:=", <array of integers>),
Array("NAME:UDMOperations") )
oEditor.UpgradeVersion([
"NAME:Parameters",
["NAME:PartOperations",
["NAME:source",
Python Example
"OperationIndices:=", [0]]
],
["NAME:UDMOperations"]
])
Validate3DComponent
Validates a 3D component.
UI Access N/A
Boolean:
Return Value l 1 - component is valid.
l 0 - component is not valid.
WriteHistoryTreeLayoutForTest
Writes history tree layout to a file.
UI Access N/A
l 0 - do not show.
AddCableToBundle
CreateCableBundle
CreateCableHarness
CreateClockSource
CreatePWLSource
CreateStraightWireCable
CreateTwistedPairCable
ExportCableLibrary
ImportCableLibrary
RemoveCable
UpdateCableHarness
AddCableToBundle
Add a cable to an existing bundle using the Beta Cable Modeling feature. Right click on the 3D Component icon and select
Cables>Edit Cables to open the Cable Editor.
"YPos:=" , "0mm",
"RotX:=" , "0deg"
],
[
"NAME:CableInstAttribs",
"Name:=" , "tpwire2"
])
CreateCableBundle
Creates a cable bundle using the Beta Cable Modeling feature. Right click on the 3D Component icon and select Cables>Edit
Cables to open the Cable Editor. Then Add>Bundle....
CreateCableHarness
Creates a cable harness using the Beta Cable Modeling feature. Right click on the 3D Component icon and select Cables>New
Cable Harness to open the Insert Cable Harness Component Editor.
"Origin:=" , ["0mm","0mm","0mm"],
"XAxisEnd:=" , ["-6mm","0mm","0mm"],
"PlaneFlip:=" , True,
[
"NAME:RefConductors",
"tpwire2/w1"
],
[
"NAME:InputTerminations",
"tpwire2/w1:=" , [ "Source:="
"tpwire2/w2:=" , [ "Imped:="
],
[
"NAME:OutputTerminations",
"tpwire2/w1:=" , [ "Imped:="
"tpwire2/w2:=" , [ "Source:="
]
],
[
"NAME:HarnessAttribs",
"Name:=" , "MyHarness"
])
CreateClockSource
Creates a clock source using the Beta Cable Modeling feature. Right click on the 3D Component icon and select Cables>Edit Cable
Sources... to open the Cable Time Domain Sources Editor.
Parameters None
Return Value None
VB Syntax CreateClockSourceArray(<parameters> )
oModule.CreateClockSource Array("NAME:ClockSignalParams", "Period:=", "35us",
"LowPulseVal:=", _
VB Example "0V", "HighPulseVal:=", "1V", "Risetime:=", "5us", "Falltime:=", "5us",
"PulseWidth:=", _
"20us"), Array("NAME:TDSourceAttribs", "Name:=", "clock2")
CreatePWLSource
Creates a PWL source using the Beta Cable Modeling feature. Right click on the 3D Component icon and select Cables > Edit Cable
Sources... to open the Cable Time Domain Sources Editor.
"0V"
],
[
"NAME:TimeValues",
"0ns",
"1ns",
"2ns"
]
],
[
"NAME:TDSourceAttribs",
"Name:=" , "pwl3"
])
VB Syntax CreatePWLSourceArray(<parameters> )
oModule.CreatePWLSource Array("NAME:PWLSignalParams", Array("NAME:SignalValues",
"0V", _
VB Example "0.5V", "0V"), Array("NAME:TimeValues", "0ns", "1ns", "2ns")), Array
("NAME:TDSourceAttribs", "Name:=", _
"pwl1")
CreateStraightWireCable
Creates a straight Wire Cable using the Beta Cable Modeling feature. Right click on the 3D Component icon and select Cables > Edit
Cables to open the Cable Editor. Then Add Straight Wire Cable.
[
"NAME:StWireAttribs",
"Name:=" , "stwire1"
])
VB Syntax Paste
oModule.CreateStraightWireCable Array("NAME:StWireParams", "WireStandard:=",
"ISO", "WireGauge:=", _
"0.13", "CondDiameter:=", "0.55mm", "CondMaterial:=", "copper", "InsThickness:=", _
VB Example
"0.25mm", "InsMaterial:=", "PVC plastic", "InsType:=", "Thin Wall"), Array
("NAME:StWireAttribs", _
"Name:=","stwire3")
CreateTwistedPairCable
Creates a twisted pair cable using the Beta Cable Modeling feature. Right click on the 3D Component icon and select Cables>Edit
Cables to open the Cable Editor. Then Add Twisted Pair Cable.
Array("NAME:VirtualJacketParams", "JacketMaterial:=", _
"", "InnerDiameter:=", "0"), "IsLayLengthSpecified:=", false, "LayLength:=", _
"13.8888888888889mm", "TurnsPerMeter:=", "72"), Array("NAME:TwistedPairAttribs", "Name:=", _
"tpwire3")
ExportCableLibrary
Exports a cable library created using the Beta Cable Modeling feature. Right click on the 3D Component icon and select Cables>Ex-
port Cable Library. to open a browser window.
VB Syntax ExportCableLibrary(<parameters> )
VB Example oModule = oDesign.GetModule("CableSetup")
oModule.ExportCableLibrary("D:\\Users\\JaneDoe\\PersonalLib\\MyCables")
ImportCableLibrary
Imports an existing cable library created using the Beta Cable Modeling feature. Right click on the 3D Component icon and select
Cables>Export Cable Library. to open a browser window.
VB Syntax ImportCableLibrary(<parameters> )
oModule = oDesign.GetModule("CableSetup")
VB Example
oModule.ExportCableLibrary("D:\\Users\\JaneDoe\\PersonalLib\\MyCables")
RemoveCable
Removes an existing cable created using the Beta Cable Modeling feature. Right click on the 3D Component icon and select
Cables>Edit Cables.... to open a Cable Editor window.
VB Syntax ImportCableLibrary(<parameters> )
oModule = oDesign.GetModule("CableSetup")
VB Example
oModule.RemoveCable("bundle4")
UpdateCableHarness
Creates a cable harness using the Beta Cable Modeling feature. Right click on the 3D Component icon and select Cables>New
Cable Harness to open the Insert Cable Harness Component Editor.
"NAME:OutputTerminations",
"tpwire2/w1:=" , [ "Imped:="
"tpwire2/w2:=" , [ "Source:="
]
],
[
"NAME:HarnessAttribs",
"Name:=" , "MyHarness"
])
"5V", "Imped:=", _
"50ohm"), "tpwire2/w2:=", Array("Imped:=", "50ohm"))), Array("NAME:Har-
nessAttribs", "Name:=", _
"MyNewHarness")
11-256
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
CreateOutputVariable
Adds a new output variable. Different forms of this command are executed for different design types.
Note:
Output variables are associated with a name and an expression. The name is not permitted to collide with design variable,
sim value, or other output variable names. It cannot have spaces or any arithmetic or other operators in it. Expression defin-
itions cannot be cyclic. For example, A = 2*B, B=3*A is not allowed.
HFSS Example:
Pyth-
oModule.CreateOutputVariable("Var" & OutputQuantity, OutputQuantity, Solution, "Far
on
Fields", ["Context:=", InfiniteSphere, "Domain:=", "Sweep"])
Exam-
ple
Layout Editor Example :
HFSS Example:
oModule.CreateOutputVariable "Var_" & OutputQuantity, OutputQuantity, Solution, "Far
Fields",
VB Array("Context:=", InfiniteSphere, "Domain:=", "Sweep")
Exam-
ple Layout Editor Example :
Set oModule = oDesign.GetModule("OutputVariable")
oModule.CreateOutputVariable "test","mag(S(WavePort1,WavePort1))", "Setup1 : LastAdaptive
", "Modal Solution Data", Array("Domain:=", "Sweep")
DeleteOutputVariable
Deletes an existing output variable. The variable can only be deleted if it is not in use by any traces.
UI Access HFSS > Results > Output Variables. In the Output Variables window, click Delete.
DoesOutputVariableExist
Verifies whether or not a named output variable exists.
UI Access N/A
Return Value Boolean True if the variable exists; False if it does not.
oDesign = oProject.GetActiveDesign()
oModule = oDesign.GetModule("OutputVariable")
oModule.DoesOutputVariableExist("MyTestVar")
VB Syntax DoesOutputVariableExist(<outputVariableName>)
Set oModule = oDesign.GetModule "OutputVariable"
VB Example
oModule.DoesOutputVariableExist "MyTestVar"
EditOutputVariable
Changes the name or expression of an existing output variable.
UI Access N/A
Array("Context:=", <string>)
For Layout Editor, use Domain array:
Array("Domain:=", <string>)
ExportOutputVariables
Exports output variables to a file.
Boolean:
GetOutputVariables
Returns the list of output variables.
UI Access N/A
Parameters None.
Return Value Array containing all output variables.
VB Syntax GetOutputVariables
VB Example oDesign.GetOutputVariables
GetOutputVariableValue
Returns the double value of an output variable. Only expressions that return a double value are supported. The expression is eval-
uated only for a single point.
UI Access N/A
l "Fields"
l "Far Fields"
l "Near Fields"
"Emission Test"
l
<ContextArray> Array Structured array containing context for which the output variable expression is
being evaluated. Can be empty.
Array("Context:=", <string>)
ImportOutputVariables
Imports output variables from a file.
Boolean:
SimValueContext
SimValueContext holds context information for a trace, and describes how data for a trace should be extracted from the simulation.
SimValueContext contains a list of 14 required initial values:
SimValueContext (
Domain ID, Calculation Type, Number of Cycles, Rise Time,
Step, Impulse, Context ID, Window Width,
For example, the following indicates a trace in the Time Domain, Standard Calculation with the number of cycles being 2:
"SimValueContext:=", Array(1, 0, 2, 0, false, false, -1, 1, 0, 1, 1, "", 0, 0)
Additional, context-specific values may follow the required values, as described in subsection 15 below.
1. Domain ID
No Domain 0
Time Domain 1
Spectrum Domain 2
Sweep Domain 3
Device Domain 4
SinglePt Domain 5
LoadPull Domain 6
Transient Domain 7
Budget Domain 8
NetworkFunction Domain 9
Oscillator Domain 55802
Noise Domain 55803
Transfer Function Domain 55807
Time Frequency Domain 55808
Transient Time Domain 55809
Periodic AC Domain 55818
UI Domain 55819
Eye Measurement Domain 55823
Initial Response Domain 55824
Peak Distortion Domain 55825
2. Calculation Type
Standard Calculation 0
Device2_DCIV 1
Device3_DCIV_Output 2
Device3_DCIV_Input 3
Device3_DCIV_Transfer 4
Device3_DCIV_Reverse 5
Device2_ACLoad 6
Device3_ACLoad_Output 7
Device3_ACLoad_Input 8
Device3_ACLoad_Transfer 9
Device3_ACLoad_Reverse 10
Constellation 11
EyeDiagram 12
FreeX ( Statistic Report ) 13
Context-specific values are entered in the format "key, true/false, keyvalue", where:
— "key" is the name of the key being set.
— "true/false" indicates whether the key is a string value.
— "keyvalue" is the value of the key.
— The order of the context keys is not significant.
— Context keys have software defaults that will be used if not provided in the script.
VB Example:
* Script can specify either MH or MF. If neither is specified, Max Harmonics is set to 100. If both are specified, MF is used.
Window Type ID
Rectangular 0
Bartlett 1
Blackman 2
Hamming 3
Hanning 4
Kaiser 5
Welch 6
Weber 7
Lanzcos 8
c. Eyeprobe index context for UI domain, Time domain, Eye Measuremant domain in VerifEye and QuickEye analysis:
d. Eyesource index context for Initial Response domain and Peak Distortion domain in VerifEye and QuickEye analysis:
Note:
When you execute Tools > Record Script, operations performed in the Reporter are automatically recorded.
ClearAllTraceCharacteristics
CopyReportDefinitions
CopyReportData
CopyTraceDefinitions
CopyTracesData
CreateReport
CreateReportFromFile
CreateReportFromTemplate
CreateReportOfAllQuantities
DeleteMarker
DeleteAllReports
DeleteReports
DeleteTraces
EditQuickEyeAnalysis
EditVerifEyeAnalysis
FFTOnReport
ExportFieldsToFile
ExportImageToFile
ExportModelImageToFile
ExportModelMeshToFile
ExportPlot3DToFile
ExportToFile [Reporter]
ExportMarkerTable
GetAllCategories
GetAllQuantities
GetAllReportNames
GetAvailableDisplayTypes
GetAvailableReportTypes
GetAvailableSolutions
GetChildNames
GetChildObject
GetChildTypes
GetDisplayType
GetPropertyValue
GetSolutionContexts
GetSolutionDataPerVariation
GroupPlotCurvesByGroupingStrategy
ImportIntoReport
MovePlotCurvesToGroup
MovePlotCurvesToNewGroup
PasteReports
PasteTraces
RenameReport
RenameTrace
ResetPlotSettings
SavePlotSettingsAsDefault
SetPropValue
UpdateAllFieldsPlots
UpdateAllReports
UpdateQuantityFieldsPlots
UpdateReports
UpdateTraces
UpdateTracesContextandSweeps
UnGroupPlotCurvesInGroup
AddAllEyeMeasurements
Displays all the eye measurements in tabular format
UI Access Right-click the report and select Trace Characteristics > Add All Eye Measurements
AddCartesianLimitLine
Adds a limit line to a report on the X axis.
AddCartesianLimitLineFromCurve
Adds a limit line to a report from selected curve on the plot.
UI Access Report2D > Add Limit Line > From Selected Curve...
"NAME:CartesianLimitLineFromCurve",
"TraceName:=" , "Phase",
"CurveName:=" , "",
"Start:=" , "0deg",
"Stop:=" , "375deg",
"YAxis:=" , 1,
"YOffset:=" , 0,
"CreateMode:=" , "AboveCurve",
"YShiftPercent:=" , 10
])
"YShiftPercent:=", 10)
AddCartesianLimitLineFromEquation
Adds a limit line to a report from a specified equation.
"Start:=" , "9GHz",
"Stop:=" , "11GHz",
"Step:=" , "0.2GHz",
"Equation:=" , "x+1"
])
AddCartesianXMarker
Adds a marker to a report on the X axis.
AddCartesianYMarker
Adds a marker to a report on the Y axis.
AddCartesianYMarkerToStack
Adds a marker to a stacked report on the Y axis.
UI Access N/A
AddDeltaMarker
Add markers to calculate differences between two trace points on a plot.
AddMarker
Adds a marker to a trace on a report.
AddNote
Adds a note at a specified location to a given report.
Array("NAME:<StringDataName>", <NoteArray>)
<NoteArray> Array Structured array:
Array("NAME:<NoteDataSourceName>",
"SourceName:=", <string source name>,
"HaveDefaultPos:=", <boolean True for position 0,0;
False to specify below>,
"DefaultXPos:=", <int X position for note; 0 for
default>,
"DefaultYPos:=", <int Y position for note; 0 for
default>,
"String:=", <string note text>)
]
)
AddTraceCharacteristics
Adds a trace characteristics field to the legend on a report.
UI Access Report2D > Trace Characteristics > All. This opens the Add Trace Characteristics dialog box.
AddTraces
Creates a new trace and adds it to the specified report.
<ReportDataArray> Array This array contains the report quantity and X, Y, and (Z) axis definitions.
Array("X Component:=", <VariableName>,
"Y Component:=", <VariableName> | <ReportQuant-
ityArray>)
<ReportQuantityArray> ex. Array("dB(S(Port1,
Port1))")
ApplyReportTemplate
Applies settings to a report from a template file.
ChangeProperty[ReportSetup]
Change the properties for a Report.
[
"NAME:General",
[
"NAME:PropServers",
"XY Plot 1:General"
],
[
"NAME:ChangedProps",
[
"NAME:Use Scientific Notation",
"Value:=", True
]
]
]
])
oModule = oDesign.GetModule("ReportSetup")
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Legend",
[
"NAME:PropServers",
"S Parameter Plot 1:Legend"
],
[
"NAME:ChangedProps",
[
"NAME:Legend Name",
"Value:=" , "Ansys"
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:General",
[
"NAME:PropServers",
"S Parameter Plot 1:General"
],
[
"NAME:ChangedProps",
[
"NAME:Auto Scale Fonts",
"Value:=" , False
]
]
]
])
VB ChangeProperty <PropertyArray>
Syntax
VB
"XY Plot 1:CartesianDisplayTypeProperty"), Array("NAME:ChangedProps", Array("NAME:Show X
Examp- Scrollbar", "Value:=", _
le true))))
oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:General", Array("NAME:PropServ-
ers", _
ClearAllMarkers
Clears all markers from a report.
ClearAllTraceCharacteristics
Clears all trace characteristics from the legend in a report.
CloneReportsFromDatasetSolution
Clones a report for a solveed solution from a dataset solution.
UI Access Right-click the Project tree on the report and choose Clone from Dataset Solution > [Dataset_SolutionName]
CopyPlotSettings
Copies settings of a specified plot.
CopyReportDefinitions
Copy the definition of a report for paste operations.
UI Access Select a report in the Project tree, right-click and select Copy Definition
CopyReportsData
Copy all data corresponding to the specified reports.
UI Access Select a report in the Project tree, right-click and select Copy Data
CopyTraceDefinitions
Copy trace definitions for a paste operation.
UI Access Select a trace in the Project tree, right-click and select Copy Definition
CopyTracesData
Copies trace data for a paste operation.
UI Access Select a trace in the Project tree, right-click and select Copy Data.
CreateReport
Creates a new report with a single trace and adds it to the Results branch in the project tree.
"Emission Test"
<DisplayType> String Type of display.
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", "3D
Rectangular Bar Plot" or "3D Polar Plot".
If <ReportType> is "Fields", then set to one of the following:
"Rectangular Plot", "Polar Plot", "Radiation Pattern",
"Rectangular Contour Plot", "Data Table", "3D Rect-
angular Plot", or "3D Rectangular Bar Plot".
If <ReportType> is "Far Fields" or "Near Fields", then set to one of the fol-
lowing:
"Rectangular Plot", "Radiation Pattern", "Rectangular
Contour Plot" "Data Table",
"3D Rectangular Plot", "3D Rectangular Bar Plot" or "3D
Polar Plot"
If <ReportType> is "Emission Test", then set to one of the following:
"Rectangular Plot" or "Data Table"
<SolutionName> String Name of the solution as listed in the Modify Report dialog box.
<ContextArray> Array 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> Array Contains sweep definitions for the report.
Array("<VariableName>:= ", <ValueArray>)
<ValueArray>
Array("All") or Array("Value1", "Value2", ..."Valuen")
examples of <VariableName> "Freq", "Theta", "Distance"
<ReportDataArray> Array 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))")
Optimetrics Example:
oModule.CreateReport ("XY Plot 3", "Standard",_
"Rectangular Plot", "TR", ["NAME:Context",_
"OptiSetup:=", "ParametricSetup1", "SimValueCon
[1, 0, 2, 0, false, false, 0, 1, _
0, 1, 1, "", 0, 0]], ["Time:=", ["All"],_
"aaa:=", ["Nominal"]], ["X Component:=",_
"Time", "Y Component:=", ["E1.I"]], [])
Spectral Example:
oModule.CreateReport ("XY Plot 4", "Standard",_
"Rectangular Plot", "TR", ["NAME:Context",_
"SimValueContext:=", [ 2, 0, 2, 0, false, false
-1, 1, 0, 1, 1, "", 0, 0, "CG", false, "0", "KP
false, "0", "MH", false, "100", "TE", false, "4
"TH", false, "40", "TS", false, "0ns", "UF", fa
"Freq:=" , ["All"],
"UU:=" , ["All"],
"ZZZ:=" , ["Nominal"]
],
[
"X Component:=" , "Freq",
"Y Component:=" , "UU",
"Z Component:=" , ["dB(S(wDipole1_1_p1,wDipole1_1_p1))"]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Transparency",
"Value:=" , "0.5"
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Filled",
"Value:=" , False
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Filled",
"Value:=" , True
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Show Outline",
"Value:=" , True
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Outline Color",
"R:=" , 0,
"G:=" , 0,
"B:=" , 160
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Outline Width",
"Value:=" , "2"
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
"S Parameter Plot 4:Traces-dB(S(wDipole1_1_p1,wDipole1_1_p1))"
],
[
"NAME:ChangedProps",
[
"NAME:Bar Width",
"Value:=" , "Narrow"
]
]
]
])
oModule.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Bar",
[
"NAME:PropServers",
[
"NAME:ChangedProps",
[
"NAME:Bar Infinity",
"Value:=" , True
]
]
]
])
Array()
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()
oModule.CreateReport "Rectangular Contour Plot 2", "Far Fields", _
"Rectangular Contour Plot", "Setup1 : LastAdaptive", Array("Context:=", _
"Infinite Sphere1"), Array("_u:=", Array("All"), "_v:=", Array("All"), "Freq:=",
Array( _
"5GHz")), Array("X Component:=", "_u", "Y Component:=", "_v", "Z Component:=", Array
( _
"rETotal")), Array()
oModule.CreateReport "Rept2DRectFreq",_
"Modal Solution Data", "XY Plot", _
"Setup1 : Sweep1", _
Array("Domain:=", "Sweep"), _
Array("Freq:=", Array("All")), _
Array("X Component:=", "Freq", _
CreateReport [Designer]
Use:Creates a new report with a single trace and adds it to the Results branch in the project tree.
Command:Product Menu>Results>Create <type> Report
Syntax:CreateReport <ReportName> <ReportType> <DisplayType> <SolutionName> <ContextArray> <FamilesArray>
<ReportDataArray>
Return Value:None
Parameters:<ReportName>
Type: <string>
Name of Report.
<ReportType>
Type: <string>
Possible values are:
"Standard" - For most plot types.
"Load Pull" - For load pull plots.
"Constellation" - For constellation plots.
"Data table" - For data tables.
"Eye Diagram" - For eye diagrams.
"Statistical" - For statistical plots.
<DisplayType>
Type: <string>
Possible values are:
"Rectangular Plot", "Polar Plot", "Radiation Pattern", "Smith Chart", "Data Table", "3D Rectangular Plot", "3D Polar Plot", or
"Rectangular Stacked Plot".
<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:=", <SimValueContext>)
<FamiliesArray>
Type: Array of strings
Contains sweep definitions for the report.
Array("<VariableName>:= ", <ValueArray>)
<ValueArray>
Array("All") or Array("Value1", "Value2", ..."Valuen")
examples of <VariableName>
"Freq", "Theta", "Distance"
<ReportDataArray>
Type: Array of strings
This array contains the report quantity and X, Y, and (Z) axis definitions.
Array("X Component:=", <VariableName>, "Y Component:=", <VariableName> | <ReportQuantityArray>)
<ReportQuantityArray>
ex. Array("dB(S(Port1, Port1))")
VB Example:
VB Example:
oModule.CreateReport "Data Table 1", "Standard", "Data Table", "LinearFrequency",_
Array("NAME:Context", "SimValueContext:=", Array( _
3, 0, 2, 0, false, false, -1, 1, 0, 1, 1, "", 0, 0)), Array("F:=", Array("All")), Array("X Com-
ponent:=", _
"F", "Y Component:=", Array("dB(S(Port1,Port1))")), Array()
VB Example:
oModule.CreateReport "3D Rectangular Plot 1", "Standard", "3D Rectangular Plot", _
"LinearFrequency", Array("NAME:Context", "SimValueContext:=", Array(3, 0, 2, 0, _
false, false, -1, 1, 0, 1, 1, "", 0, 0)), Array("F:=", Array("All")), Array("X Component:=", _
"F", "Y Component:=", "F", "Z Component:=", Array("dB(S(Port1,Port1))")), Array()
VB Example:
oModule.CreateReport "3D Rectangular Plot 2", "Standard", "3D Rectangular Plot", _
],
[
"Unit Interval:=" , "1e-009s",
"Offset:=" , "0",
"Auto Delay:=" , True,
"Manual Delay:=" , "0ps",
"AutoCompCrossAmplitude:=", True,
"CrossingAmplitude:=" , "0mV",
"AutoCompEyeMeasurementPoint:=", True,
"EyeMeasurementPoint:=" , "5e-010s"
])
CreateReportFromFile
Creates a new report from an .rdat file.
CreateReportFromTemplate
Creates a report from a saved template.
UI Access [product] > Results > Report Templates > PersonalLib > [TemplateName]
"ReportTemplates/TestTemplate.rpt"
CreateReportOfAllQuantities
Creates a report including all quantities in a category. Cannot create a report with expressions.
UI Access NA
["Nominal"],"b:=", ["Nominal"]],[],[])
DeleteMarker
Use:Deletes the specified marker.
UI Access [product] > Fields > Fields > Marker > Delete Marker.
DeleteAllReports
Deletes all existing reports.
UI Access Right-click the report to delete in the project tree, and then click Delete All Reports on the shortcut menu.
Parameters None.
Return Value None.
VB Syntax DeleteAllReports
VB Example oModule.DeleteAllReports
DeleteReports
Deletes an existing report or reports.
UI Access Right-click the report to delete in the project tree, and then click Delete on the shortcut menu
DeleteTraceCharacteristics
Deletes a trace characteristics field from a report
UI Access N/A
DeleteTraces
Deletes an existing traces or traces.
UI Access Right-click the Trace to delete in the project tree, and then click Delete on the shortcut menu
DoesSupportTraceCharacteristics
Determines whether trace characteristics is supported in a specified display type.
UI Access N/A
Integer
Return Value l 1 - trace characteristics is supported.
l 0 - trace characteristics not supported.
DumpAllReportsData
Dumps all reports data to an Ansoft report data file.
UI Access N/A
EditCartesianXMarker
Edits an XMarker value.
UI Access N/A
EditCartesianYMarker
Edits a YMarker value.
UI Access N/A
EditMarker
Edits a marker on a report.
UI Access N/A
ExportEyeMaskViolation
Exports eye mask violations to a file.
UI Access N/A
ExportImageToFile [Reporter]
Exports a report image in a specified format. In Release 23.1, this command is fully supports -ng (non-graphical) mode.
UI Access N/A
ExportModelImageToFile
Exports the model as an image file (*.avz, *.bmp, *.gif, *.jpeg, *.tiff, *.wrl). In Release 23.1, this command is fully supports -ng (non-
graphical) mode. To export to Ensight use *.avz. For export to Ensight in -ng mode, the corresponding version of Ensight must be
installed. On Linux, it might need manual set environment variable AWP_ROOT212 to its installation path, e.g. AWP_ROOT212-
2=/installations/ansys_inc/v212/ for AnsysEDT v21.2 and Ensight 21.2.
ExportModelImageToFile supports export overlay of polar plot 3D with existing transformation (scaling, rotation and translation) in -ng
(non-graphical) mode.
("C:/Users/jdoe/Desktop/export.bmp",
1920,
1080,
[
"NAME:SaveImageParams",
"ShowAxis:=" , "True",
"ShowGrid:=" , "True",
"ShowRuler:=" , "True",
"ShowRegion:=" , "Default",
"Selections:=" , "",
"FieldPlotSelections:=" , "",
"FitToSelections:=" , "",
"FitToFieldPlotSelections:=", "",
"Orientation:=" , ""
])
Array("NAME:SaveImageParams",
"ShowAxis:=", "True",
"ShowGrid:=", "True",
"ShowRuler:=", "True",
"ShowRegion:=", "Default",
"Selections:=", "",
"FitToFieldPlotSelections:=", "",
"Orientation:=", ""
ExportModelMeshToFile
Exports geometry model to a 3D model file (e.g. *.obj, *.wrl, etc.).
UI Access N/A
ExportPlot3DToFile [Reporter]
Use: Exports 3D polar, spherical and rectangular plot to a case file. It works in both graphical and NG mode..
Command: None.
Syntax: ExportPlot3DToFile(<plotName>, <path>)
Return Value: A 3D plot file.
Parameters: <plotName>
Type: <string>
Plot name.
<Path>
Type: <string>
Path to file.
ExportReport
Note:
The ExportReport script command has been replaced by the script command ExportToFile. ExportReport remains in order
to retain backward compatibility for existing scripts, but it is strongly recommended that you now use ExportToFile.
<FileExtension>
Type: string
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
"Plot1", "c:\report1.dat")
ExportReportDataToFile
Exports report data to a file.
UI Access N/A
ExportTableToFile
Exports a marker table from a report to a file.
UI Access Right-click on a plot, select Marker > Export Marker Table... or Export Delta Marker Table...
ExportToFile [Reporter]
From a data table or plot, generates text format, comma delimited, tab delimited, .dat, or .rdat type output files.
UI Access Right-click on report name in the Project tree and select Export.
ExportUniformPointsToFile
Exports uniform points from a data table or plot report that includes the Export Uniform Points to File option enabled to text format,
comma delimited, tab delimited, or .dat type output files.
UI Access Right-click on report name in the project tree and select Export Data.
GetAllCategories
Get all available category names (not including variable and output-variables) in a solution for a report type and display type, returned
as an array of text strings.
UI Access NA
GetAllQuantities
Gets all available quantity names in category, returned as an array of text strings.
UI Access NA
GetAllReportNames
Gets the names of existing reports in a design
UI Access N/A
Parameters None.
Return Value Array of report names
VB Syntax GetAllReportNames
VB Example oModule.GetAllReportNames
GetAvailableDisplayTypes
Retrieves all supported display types in report type as an array of text strings.
UI Access N/A
GetAvailableReportTypes
Retrieves all available report types in the current Design as an array of text string.
UI Access N/A
Parameters None.
Return Value Array of text strings
VB Syntax GetAvailableReportTypes
VB Example oModule.GetAvailableReportTypes
GetAvailableSolutions
Gets all available solutions in report type as an array of text strings.
UI Access N/A
UI Access N/A
Parameters None.
Return Value Array of strings containing all report names.
VB Syntax GetChildNames
VB Example oModule.GetChildNames
UI Access NA
Return Value A ReportSetup(Results) Module Child Object, [ReportSetup(Results) Module Child Objects ]
GetChildTypes [ReportSetup]
Gets child types of queried Report module object.
UI Access N/A
Parameters None.
Return Value Array of strings containing child object types.
VB Syntax GetChildTypes
VB Example oModule.GetChildTypes
GetCurvePropServerName
Gets the PropServer (the owner of the properties, or the list containing them) name of a curve.
UI Access N/A
GetDisplayType
Gets the display type of a specified report.
UI Access NA
GetDynLinkIntrinsicVariables
Gets variable names from a trace included in dynamic link outputs.
UI Access N/A
GetDynLinkQtyValueState
Gets the state of the quantity values from a source dynamic linked trace.
UI Access N/A
GetDynLinkTraces
Gets the names of the dynamic linked traces.
UI Access N/A
GetDynLinkVariableValues
Gets the values of a variable from a dynamic linked trace.
UI Access N/A
GetName
Returns the name of the active design.
UI Access N/A
Parameters None.
VB Syntax GetName
VB Example design_name = oDesign.GetName
GetObjPath [Design]
Obtains the path to the design.
UI Access N/A
Parameters None.
Return Value String containing the path to the design.
VB Syntax GetObjPath
VB Example oDesign.GetObjPath
GetPropertyValue
Returns the value of a single property belonging to a specific <PropServer> and <PropTab>. This function is available with the Pro-
ject, Design or Editor objects, including definition editors.
Tip:
Use the script recording feature and edit a property, and then view the resulting script to see the format for that property.
UI Access N/A
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<PropName> String Name of the property.
GetPropNames [Reporter]
Report setup module does not have its own property, this function always returns empty array.
UI Access N/A
Parameters None.
Return Value Empty array.
VB Syntax GetPropNames
VB Example oModule.GetPropNames
UI Access N/A
GetQtyExpressionsForSourceTrace
Gets the quantity expressions from a specified source trace.
UI Access N/A
GetReportTraceNames
Gets the names of existing trace names in a plot.
UI Access N/A
GetReportSummaryForRegressionTesting
Gets report summary from a dumped report file.
UI Access N/A
GetSolutionContexts
Gets all available solution context names in a solution as an array of text strings.
UI Access N/A
oModule.GetSolutionContexts _
VB Example "Far Fields", "Rectangular Plot", _
"Setup1:LastAdaptive"
GetSolutionDataPerVariation
Obtains solution data for a given report type and solution. You must have already run a simulation.
UI Access N/A
l GetDataUnits()
l GetRealDataValues()
l GetImagDataValues()
l ReleaseData()
l GetDesignVariableNames()
l GetDesignVariableUnits()
l GetDesignVariableValue()
l GetDesignVariationKey()
Note:
l This command is not recordable from the UI, but its parameters are similar to CreateReport, so you may record a
CreateReport script to get the parameter values.
l For the returned ISolutionDataResultComInterface object, some of its functions have an optional boolean para-
meter: SIValue. SIValue defaults to True. When the pass in value is True, return data values will be in Standard Inter-
national values; when False, return data values will be in the current units.
Example: Freq Sweep with [1GHz, 2GHz,3GHz], GetSweepUnits(“Freq”) return “GHz”; GetSweepValues(“Freq”,
True) return [1000000,2000000,3000000]; GetSweepValues(“Freq”, False) return [1,2,3].
GetDataExpressions
Returns data expressions.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
Parameters N/A
Return Value Array of text strings
VB Syntax GetDataExpressions()
dim expressions
VB Example
expressions = oModule.GetDataExpressions()
GetDataUnits
Returns text string containing units.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
oModule.GetDataUnits(expressions)
Python Example
VB Syntax GetDataUnits(<expressionString>)
VB Example oModule.GetDataUnits(expressions)
GetDesignVariableNames
Returns array of strings containing design variable names.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access NA
Parameters NA
Return Value Array of strings
VB Syntax GetDesignVariableNames()
dim names
VB Example
names = oModule.GetDesignVariableNames()
GetDesignVariableUnits
Returns array of strings containing design variable units.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
VB Syntax GetDesignVariableUnits(<varName>)
dim units
VB Example
units = oModule.GetDesignVariableUnits("Variable Name")
GetDesignVariableValue
Returns a design variable's value.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
GetDesignVariationKey
Returns a design's Variation Key.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
Parameters N/A
Return Value String containing variation key.
VB Syntax GetDesignVariationKey()
dim key
VB Example
set key = oModule.GetDesignVariationKey()
GetImagDataValues
Returns array of imaginary data values.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
VB Syntax GetImagDataValues(<expressionString>,<siValue>)
dim imaginaryvalues
VB Example
imaginaryvalues = oModule.GetImagDataValues("expression",True)
GetPerQuantityPrimarySweepValues
Returns per quantity primary sweep values.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
Return Value Array of doubles if IsPerQuantityPrimarySweep() returned True; error if returned False
GetRealDataValues
Returns array of real data values.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
VB Syntax GetRealDataValues(<expressionString>,<siValue>)
dim realvalues
VB Example
realvalues = oModule.GetRealDataValues("expression",True)
GetSweepNames
Returns array of text strings containing primary sweep name(s).
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
Parameters N/A
Return Value Array of text strings
VB Syntax GetSweepNames()
dim sweepnames
VB Example
sweepnames = oModule.GetSweepNames()
GetSweepUnits
Returns text string containing units.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
VB Syntax GetSweepUnits(<sweepName>)
dim sweepunits
VB Example
sweepunits = oModule.GetSweepUnits("Sweep 1")
GetSweepValues
Returns sweep values.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
IsDataComplex
Returns whether an expression is complex.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access NA
VB Syntax IsDataComplex(<expressionString>)
VB Example oModule.IsDataComplex('.001,.234,.455,.434')
IsPerQuantityPrimarySweep
Returns whether data expressions have different primary sweep values.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
Parameters N/A
Return Value Boolean (True if data expressions have different primary sweep values)
VB Syntax IsPerQuantityPrimarySweep()
dim var
VB Example
var = oModule.IsPerQuantityPrimarySweep()
Release Data
Releases all cached data. After this function is called, all subsequent function calls to the object will fail.
Important:
This script does not function on its own, but as part of GetSolutionDataPerVariation.
UI Access N/A
Parameters N/A
VB Syntax ReleaseData()
VB Example oModule.ReleaseData()
GroupPlotCurvesByGroupingStrategy
Groups curves in a Stacked Plot automatically based on a curve grouping strategy.
UI Access N/A
ImportIntoReport
Imports .tab, .csv, and .dat format files into a report.
UI Access Right-click on report name in the Project tree and select Import....
ImportReportDataIntoReport
Imports report data from a file into a specified report.
UI Access N/A
MovePlotCurvesToGroup
In a Stacked Plot move curve(s) from its stack(s) to an existing stack. Here term ‘group’ is synonymous to ‘stack’ in the context of
cartesian stacked plot.
UI Access N/A
Python oModule.MovePlotCurvesToGroup("XY Stacked Plot 1", ["R2.V : TR", "R2.I : TR"], "Stack
Example 2")
MovePlotCurvesToNewGroup
Move curve(s) from its stack(s) to a new stack. Here term ‘group’ is synonymous to ‘stack’ in the context of Cartesian stacked plot.
UI Access N/A
OpenWindowForAllReports
Opens windows for all reports belong to current design.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax OpenWindowForAllReports
VB Example oModule.OpenWindowForAllReports
OpenWindowForReports
Opens windows for specified reports.
UI Access N/A
PastePlotSettings
Paste plot settings to a specified report.
PasteReports
Paste copied reports to results in the current project.
VB Syntax PasteReports
VB Example oModule.PasteReports
PasteReportsWithLegacyNames
Pastes copied reports to results in the current project with legacy name definitions.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax PasteReportsWithLegacyNames
VB Example oModule.PasteReportsWithLegacyNames
PasteTraces
Pastes copied traces to a named plot.
UI Access Paste
PasteTracesWithLegacyNames
Pastes copied traces to a named plot using legacy name definitions.
UI Access N/A
RenameReport
Renames an existing report.
UI Access Select a report on the Project tree, right-click and select Rename
RenameTrace
To rename a trace in a plot
UI Access N/A
ResetPlotSettings
Resets plot settings to defaults.
SavePlotSettingsAsDefault
Saves report plot settings as default.
SetLinkOutputTraces
Specifies dynamic link output traces from the current design.
[
"Plot 1:=", ["Trace1"],
"Plot 2:=", ["Trace1"]
])
Return Value True if the property is found and the new value is valid. Otherwise return False.
Syntax
Python
oRptModule.SetPropValue(“S Parameter Plot 1/Display Type”, “DataTable”)
Example oRptModule.SetPropValue(“S Parameter Plot 1/db(S(port1,port2)/Primary sweep”, “Freq”)
UnGroupPlotCurvesInGroup
From a Stacked Plot, ungroups curves in a stack.
UI Access N/A
UpdateAllReports
Updates all reports in the Results branch in the project tree.
UI Access Right-click on Results in the project tree, select Update All Reports
Parameters None
Return Value None
VB Syntax UpdateAllReports
VB Example oModule.UpdateAllReports
UpdateReports
Updates specified reports.
UI Access N/A
UpdateTraces
Update the traces in a report for which traces are not automatically updated by the Report Traces dialog box, Update Report, Real
Time selection.
Array("Context:=", <GeometryType>)
<GeometryType> ex. "Infinite Spheren", "Spheren",
"Polylinen"
<FamiliesArray> Array Contains sweep definitions for the report.
Array("<VariableName>:= ", <ValueArray>)
<ValueArray>
Array("All") or Array("Value1", "Value2", ..."Valuen")
examples of <VariableName> "Freq", "Theta", "Distance"
<ReportDataArray> Array This array contains the report quantity and X, Y, and (Z) axis definitions.
Array("X Component:=", <VariableName>,
"Y Component:=", <VariableName> | <ReportQuant-
ityArray>)
<ReportQuantityArray> ex. Array("dB(S(Port1, Port1))")
<ExtTraceInfo> Array Optional. Array defines extended trace information.
"SimValueContext:=", [2,0,2,0,False,False,
-1,1,0,1,1,"",0,0,"CG",False,"0","KP",False,"0","MH",False,
"100","TE",False,"100s","TH",False,"40",
"TS",False,"0ns","UF",False,
"0","WT",False,"0","WW",False,"100"]
],
[
"Spectrum:=", ["All"]
],
[
"X Component:=", "Spectrum",
"Y Component:=", ["mag(NEG1.VAL)"]
], [])
UpdateTracesContextAndSweeps
Edits sweeps and context of multiple traces without affecting their component expressions.
["dB(ActiveS(Port1:1))", "dB(ActiveS(Port2:1))"],
"Setup1 : Sweep1", [],
["Freq:=", ["9GHz", "9.05GHz", "9.1GHz",
"9.15GHz", "9.2GHz",
"9.25GHz", "9.3GHz", "9.35GHz",
"9.4GHz", "9.45GHz", "9.5GHz",
"9.55GHz",
"9.6GHz", "9.65GHz", "9.7GHz",
"9.9GHz", "9.95GHz", "10GHz"],
"off-
set:=",["All"]])
Boundary and
Excitation Module Script Commands 14-1
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
l Coupled Boundaries:
l Lattice Pair
l Primary
l Secondary
l Finite Conductivity
l HalfSpace
l Impedance
l Layered Impedance
l Linked Impedance
l Lumped RLC
l Perfect E
l Perfect H
l Radiation
l Symmetry
l Multipaction SEE
l Fresnel
Boundary and
Excitation Module Script Commands 14-2
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
l Wave Port
l Incident Wave Excitations:
l Plane Wave
l Hertzian-Dipole Incident Wave
l Cylindrical Wave
l Gaussian Beam
l Linear Antenna Wave
l Linked Field Excitations:
l Far Field Incident Wave
l Near Field Incident Wave
l Cable Network
l Voltage
l Current
l Magnetic Bias
l Multipaction Charge Region
l Multipaction DC Bias
Boundary and
Excitation Module Script Commands 14-3
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AutoIdentifyNets
AutoIdentifyPorts
AutoIdentifyTerminals
ChangeImpedanceMult
ConvertNPortCircuitElementToPorts
CreateNPortCircuitElement
DeleteAllBoundaries
DeleteAllExcitations
DeleteBoundaries
GetBoundaryAssignment
GetBoundaries
GetBoundariesOfType
GetDefaultBaseName
GetExcitations
GetExcitationsOfType
GetHybridRegions
GetHybridRegionsOfType
GetNumBoundaries
GetNumBoundariesOfType
GetNumExcitations
Boundary and
Excitation Module Script Commands 14-4
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetNumExcitationsOfType
GetPortExcitationsCount
IdentifyNets
ReassignBoundary
RemoveAssignmentFromBoundary
RenameBoundary
ReprioritizeBoundaries
SetDefaultBaseName
AddAssignmentToBoundary
Adds a new geometry assignment to a boundary.
UI Access N/A
Parameters Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Boundary and
Excitation Module Script Commands 14-5
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
["NAME:PerfE1",
"Faces:=", [12]])
AutoIdentifyLatticePair
Automatically identifies coupled lattice pair within specified object.
UI Access Boundaries > Assign > Coupled... > Auto Identify Lattice Pair...
Boundary and
Excitation Module Script Commands 14-6
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AutoIdentifyNets
Use: Automatically identifies nets.
Command: Q3D Extractor>Nets>Auto Identify Nets
Syntax: AutoIdentifyNets
Return Value: None
Command: oModule.AutoIdentifyNets
AutoIdentifyPorts
Automatically identifies ports in a terminal design.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-7
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AutoIdentifyTerminals
Automatically identifies the terminals within the given ports.
Boundary and
Excitation Module Script Commands 14-8
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
UI Access N/A
Boundary and
Excitation Module Script Commands 14-9
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ChangeImpedanceMult
Modifies the port impedance multiplier.
ConvertNportCircuitElementsToPorts
Converts one or more HFSS Circuit Element to one or more ports.
Boundary and
Excitation Module Script Commands 14-10
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
CreateNportCircuitElements
Creates an HFSS Circuit Element from one or more ports.
Right-click Circuit Elements > Create Single Port Model... or Circuit Elements > Create Multi-Terminal
UI Access
Model...
Parameters Array("NAME:<NPortName>",
"Definition:=", <string>,
<AssignmentArray>)
Boundary and
Excitation Module Script Commands 14-11
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
["NAME:Nport1",
"Definition:=", "Model",
["NAME:Assignments",
["NAME:Model",
"Assign:=", "1"]
]
])
oModule.CreateNportCircuitElement(
["NAME:Nport2",
"Definition:=", "Model2",
["NAME:Assignments",
["NAME:P01__NET179__T1",
"Assign:=", "2"],
["NAME:P02__NET178__T1",
"Assign:=", "3"],
["NAME:P03__NET178__T1",
"Assign:=", "4"],
["NAME:P04__NET179__T1",
"Assign:=", "5"],
]
Boundary and
Excitation Module Script Commands 14-12
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
])
oModule.CreateNportCircuitElement _
VB Example
Array("NAME:Nport2", _
"Definition:=", "Model2", _
Array("NAME:Assignments", Array("NAME:P01__NET179__T1", "Assign:=", _
"2"), Array("NAME:P02__NET178__T1", "Assign:=", "3"), _
Array("NAME:P03__NET178__T1", "Assign:=", _
"4"), Array("NAME:P04__NET179__T1", "Assign:=", "5")))
DeleteAllBoundaries
Deletes all boundaries.
Boundary and
Excitation Module Script Commands 14-13
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
VB Syntax DeleteAllBoundaries
VB Example oModule.DeleteAllBoundaries
DeleteAllExcitations
Deletes all excitations.
VB Syntax DeleteAllExcitations
VB Example oModule.DeleteAllExcitations
Boundary and
Excitation Module Script Commands 14-14
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
DeleteBoundaries
Deletes the specified boundaries and excitations.
UI Access Delete command in the List dialog box. Click [product] > List to open the List dialog box.
EditNportCircuitElement
Edits an HFSS Circuit Element.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-15
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
<AssignmentArray>)
Boundary and
Excitation Module Script Commands 14-16
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.EditNportCircuitElement _
Array("NAME:Nport1", "Definition:=", "Model", _
VB Example
Array("NAME:Assignments", _
Array("NAME:Model", "Assign:=", "1")))
GetBoundaries
Gets boundary names in the current design.
UI Access N/A
Parameters None.
Return Value Array of boundary names.
VB Syntax GetBoundaries
VB Example oModule.GetBoundaries
GetBoundariesOfType
Gets boundary names of the given type.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-17
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetBoundaryAssignment
Gets a list of face IDs associated with the given boundary or excitation assignment.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-18
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetDefaultBaseName
Gets the default base name for boundaries for a project.
UI Access N/A
GetDiffPairs
Gets the names of differential pairs defined.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-19
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Parameters None.
Return Value Array of differential pair names.
VB Syntax GetDiffPairs
VB Example oModule.GetDiffPairs
GetExcitations
Gets excitation port and terminal names for a model.
UI Access N/A
Parameters None.
Return Value Array of excitation name paired with excitation type.
Boundary and
Excitation Module Script Commands 14-20
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
VB Syntax GetExcitations
VB Example oModule.GetExcitations
GetExcitationsOfType
Gets excitation names of the given type.
UI Access N/A
GetHybridRegions
Gets hybrid region names for a project.
UI Access N/A
Parameters None.
Return Value Array of hybrid region names.
Boundary and
Excitation Module Script Commands 14-21
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
VB Syntax GetHybridRegions
VB Example oModule.GetHybridRegions
GetHybridRegionsOfType
Gets hybrid region names of the given type.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-22
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetNumBoundaries
Gets the number of boundaries in a design.
UI Access N/A
Parameters None.
Return Value Integer number of boundaries.
VB Syntax GetNumBoundaries
VB Example oModule.GetNumBoundaries
GetNumBoundariesOfType
Gets the number of boundaries of the given type.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-23
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetNumExcitations
Gets the number of excitations in a design.
UI Access N/A
Parameters None.
Return Value Integer number of excitations.
VB Syntax GetNumExcitations
VB Example oModule.GetNumExcitations
Boundary and
Excitation Module Script Commands 14-24
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetNumExcitationsOfType
Gets the number of excitations of the given type, including all defined modes and terminals of ports.
UI Access N/A
GetNumHybridRegions
Gets number of hybrid regions in a design.
UI Access N/A
Parameters None.
Return Value Integer number of hybrid regions.
Boundary and
Excitation Module Script Commands 14-25
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
VB Syntax GetNumHybridRegions
VB Example oModule.GetNumHybridRegions
GetNumHybridRegionsOfType
Gets number of hybrid regions of the given type.
UI Access placeholder
Boundary and
Excitation Module Script Commands 14-26
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetPortExcitationCounts
Gets all port names and corresponding number of modes/terminals for each port excitation.
UI Access N/A
Parameters None.
Return Value Array of port names and corresponding mode/terminal counts.
VB Syntax GetPortExcitationCounts
VB Example oModule.GetPortExcitationCounts
IdentifyNets
Returns a list of nets and their associated objects and sources.
UI Access N/A
Parameters None.
Return Value List of nets.
Boundary and
Excitation Module Script Commands 14-27
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
VB Syntax IdentifyNets
VB Example oModule.IdentifyNets
ListNets
Returns a list of nets and their associated objects and sources.
UI Access N/A
If <rmName> is provided, returns a list of nets under the specified Reduce Matrix operation.
Return Value
If no <rmName> is provided, returns a list of all nets in the design.
Boundary and
Excitation Module Script Commands 14-28
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ReassignBoundary
Specifies a new geometry assignment for a boundary.
Parameters Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Boundary and
Excitation Module Script Commands 14-29
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Faces:=", Array(17))
RemoveAssignmentFromBoundary
Removes a geometry assignment from a boundary.
Parameters Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Boundary and
Excitation Module Script Commands 14-30
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
RenameBoundary
Renames a boundary or excitation.
UI Access Right-click a boundary in the project tree, and then click Rename on the shortcut menu.
ReprioritizeBoundaries
Specifies the order in which the boundaries and excitations are recognized by the solver. The first boundary in the list has the highest
priority.
Boundary and
Excitation Module Script Commands 14-31
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
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.
Boundary and
Excitation Module Script Commands 14-32
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetDefaultBaseName
Sets the default base name for boundaries for a project.
UI Access N/A
SetPhaseCenterPerPort
Sets phase center per port for an HFSS Modal antenna in preparation for link to a target SBR+ design.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-33
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-34
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetSinglePhaseCenter
Sets a single phase center for an HFSS Modal antenna in preparation for link to a target SBR+ design.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-35
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignHalfSpace
AssignHybridRegion
AssignIERegion
AssignImpedance
AssignIncidentWave
AssignLayeredImp
AssignLinkedRegion
AssignLumpedPort
AssignLumpedRLC
AssignMagneticBias
AssignRFDischargeDCBias
AssignPrimary
AssignPerfectE
AssignPerfectH
AssignRadiation
AssignRadiation
AssignScreeningImpedance
AssignSymmetry
AssignTerminal
AssignVoltage
Boundary and
Excitation Module Script Commands 14-36
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignWavePort
AutoCreatePECCapForWavePort
CircuitPortToLumpedPort
EditCircuitPort [HFSS]
EditCurrent
EditDiffPairs
EditFiniteCond
EditHalfSpace
EditHybridRegion
EditImpedance
EditIncidentWave
EditLayeredImpedance
EditPrimary
EditPerfectE
EditPerfectH
EditLumpedPort
EditLumpedRLC
EditMagneticBias
EditNPortCircuitElement
EditRadiation
EditRFDischargeDCBias
Boundary and
Excitation Module Script Commands 14-37
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditSymmetry
EditTerminal
EditVoltage
EditWavePort
LumpedPortToCircuitPort
SetHybridRegionCoupledGroup
SetSBRSources
SetSBRSourcesBlockage
SetSBRWedgeSettings
SetTerminalReferenceImpedances
SwapCircuitPortAssignment
UnassignIERegions
AssignAnisotropicImpedance
Assigns an Anisotropic Impedance boundary
Boundary and
Excitation Module Script Commands 14-38
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-39
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.AssignAnisotropicImpedance(
["NAME:Anisotropic1",
"Faces:=" , [17215],
"UseInfiniteGroundPlane:=", False,
"CoordSystem:=" , "Global",
"HasExternalLink:=" , False,
"ZxxResistance:=" , "377",
Python Example "ZxxReactance:=" , "0",
"ZxyResistance:=" , "0",
"ZxyReactance:=" , "0",
"ZyxResistance:=" , "0",
"ZyxReactance:=" , "0",
"ZyyResistance:=" , "377",
"ZyyReactance:=" , "0"
])
Boundary and
Excitation Module Script Commands 14-40
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Faces:=", Array(17215),
"UseInfiniteGroundPlane:=", false,
"CoordSystem:=" , "Global",
"HasExternalLink:=" , false,
"ZxxResistance:=" , "377",
"ZxxReactance:=" , "0",
"ZxyResistance:=" , "0",
"ZxyReactance:=" , "0",
"ZyxResistance:=" , "0",
"ZyxReactance:=" , "0",
"ZyyResistance:=" , "377",
"ZyyReactance:=" , "0"
)
AssignAperture
Assigns an aperture boundary on selected IE region.
Boundary and
Excitation Module Script Commands 14-41
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.AssignAperture(
["NAME:Aperture1",
Python Example
"Objects:=", ["Rectangle1"]
])
AssignCircuitPort
Assigns a circuit port for a driven terminal or driven modal design in HFSS.
Parameters Array("NAME:<PortName>",
"Edges:=", [n1, n2],
"Impedance:=", "valueohm",
Boundary and
Excitation Module Script Commands 14-42
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"DoDeembed:=", <boolean>
"RenormalizeAllTerminals:=", <boolean>
"TerminalIDLit:=", Array()
)
Boundary and
Excitation Module Script Commands 14-43
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Edges:=", Array(50,56),
"Impedance:=", "50ohm",
"DoDeembed:=", false,
"RenormalizeAllTerminals:=", true,
"TerminalIDList:=", Array())
AssignCurrent
Creates a current source.
Boundary and
Excitation Module Script Commands 14-44
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignCylindricalWave
Creates an incident Cylindrical wave
Boundary and
Excitation Module Script Commands 14-45
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
UI Access HFSS > Excitations > Assign > Incident Wave > Cylindrical Wave.
Boundary and
Excitation Module Script Commands 14-46
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.AssignCylindricalWave(
["NAME:IncCWave1",
"Objects:=" , ["Cylinder1"],
"IsCartesian:=" , True,
"EoX:=" , "1",
"EoY:=" , "0",
"EoZ:=" , "0",
Python Example "kX:=" , "0",
"kY:=" , "0",
"kZ:=" , "1",
"OriginX:=" , "0mm",
"OriginY:=" , "0mm",
"OriginZ:=" , "0mm",
"CylinderRadius:=" , "0.25in"
])
Boundary and
Excitation Module Script Commands 14-47
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"EoX:=", "1",
"EoY:=", "0",
"EoZ:=", "0",
"kX:=", "0",
"kY:=", "0",
"kZ:=", "1",
"OriginX:=", "0mm",
"OriginY:=", "0mm",
"OriginZ:=", "0mm",
"CylinderRadius:=", "0.25in"
)
AssignDielectricCavity
Assigns a Hybrid Region as a Dielectric Cavity.
UI Access HFSS > Hybrid > Assign Hybrid > Dielectric Cavity.
Boundary and
Excitation Module Script Commands 14-48
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignFarFieldWave
Assigns far field wave as excitation.
UI Access HFSS > Excitations > Assign > Linked Field > Far Field Wave.
Boundary and
Excitation Module Script Commands 14-49
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
empty string>,
"Project:=" <string path to linked project file>,
"Product:=" <string product name for source design>,
"Design:=" <string name for source design>,
"Soln:="<string name for source solution>, <ParametersArray>,
"ForceSourceToSolve:=" <boolean True to force source design to
solve in the absence of linked data in the target design; else,
False>,
"PreservePartnerSoln:=" <boolean True to save source design;
else False>,
"PathRelativeTo:=" <string "TargetProject",>,
"SourceCoordSystem:=" <string coordinate system name>]
<ParametersArray> Array Structured array containing parameters to define the linked source
solution.
Boundary and
Excitation Module Script Commands 14-50
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ExternalDataFile:=", "",
"Project:=", "C:/HFSS/Antennas/Dish_FEBI.aedt",
"Product:=", "HFSS",
"Design:=", "Horn_Source_Project_for_PO_Solver",
"Soln:=", "8430MHz : LastAdaptive",[
"NAME:Params",
"xfactor:=", "1.2",
"yfactor:=", "1.6"],
"ForceSourceToSolve:=", False,
"PreservePartnerSoln:=", False,
"PathRelativeTo:=", "TargetProject",
"SourceCoordSystem:=", "Global"])
VB Syntax AssignFarFieldWave<FarFieldWaveOptions>
oModule.AssignFarFieldWave Array(
"NAME:IncNFWave2",
"IsFarField:=", true,
VB Examples "UseDataLink:=", true,
"ExternalDataFile:=", "",
"Project:=", "C:/HFSS/Antennas/Dish_FEBI.aedt",
"Product:=", "HFSS",
Boundary and
Excitation Module Script Commands 14-51
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Design:=", "Horn_Source_Project_for_PO_Solver",
"Soln:=", "8430MHz : LastAdaptive", Array(
"NAME:Params",
"xfactor:=", "1.2",
"yfactor:=", "1.6"),
"ForceSourceToSolve:=", false,
"PreservePartnerSoln:=", false,
"PathRelativeTo:=", "TargetProject",
"SourceCoordSystem:=", "Global")
AssignFEBI
Assigns a Hybrid Region as a FEBI.
Boundary and
Excitation Module Script Commands 14-52
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignFiniteCond
Assigns a single finite conductivity boundary on selected edges.
Boundary and
Excitation Module Script Commands 14-53
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"UseMaterial:=", <boolean>,
"Material:=", "<string material name for coating>",
"Radius:=", <string of double with units of length>,
"Ratio:=", <string of double>)
Boundary and
Excitation Module Script Commands 14-54
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Edges:=", [7],
"UseCoating:=", False,
"Radius:=", "0.5um",
"Ratio:=", "2.9"]
Boundary and
Excitation Module Script Commands 14-55
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Ratio:=", "2.9")
AssignFloquet
Creates a Floquet port.
Boundary and
Excitation Module Script Commands 14-56
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-57
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ThetaStart:=", "<num>deg",
"ThetaStop:=", "<num>deg",
"ThetaStep:=", "<num>deg")
<ModesList> Array Structured array.
Array("NAME:ModesList",
Array("NAME:Mode",
"ModeNumber:=", <ModeID>,
"IndexM:=", <integer index>,
"IndexN:=", <integer index>,
"KC2:=", <integer value>,
"PropagationState:=", "Propagating",
"Attenuation:=", <integer value>,
"PolarizationState:=", <TE or TM>,
"AffectsRefinement:=", <boolean>),
...)
Boundary and
Excitation Module Script Commands 14-58
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Faces:=", [7],
"NumModes:=", 2,
"RenormalizeAllTerminals:=", True,
"DoDeembed:=", False,
["NAME:Modes",
["NAME:Mode1",
"ModeNum:=",1,
"UseIntLine:=", False],
["NAME:Mode2",
"ModeNum:=", 2,
"UseIntLine:=", False]],
"ShowReporterFilter:=", False,
"UseScanAngles:=", True, "Phi:=", "0deg", "Theta:=", "0deg",
["NAME:LatticeAVector",
"Start:=", ["0mm", "0mm", "0.8mm"],
"End:=", ["0mm", "0.6mm", "0.8mm"]],
["NAME:LatticeBVector",
"Start:=", ["0mm", "0mm", "0.8mm"],
"End:=", ["0.8mm", "0mm", "0.8mm"]],
["NAME:ModesCalculator",
"Frequency:=", "1GHz",
Boundary and
Excitation Module Script Commands 14-59
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"FrequencyChanged:=", False,
"PhiStart:=", "0deg",
"PhiStop:=", "0deg",
"PhiStep:=","0deg",
"ThetaStart:=", "0deg",
"ThetaStop:=", "0deg",
"ThetaStep:=", "0deg"],
["NAME:ModesList",
["NAME:Mode",
"ModeNumber:=", 1,
"IndexM:=", 0,
"IndexN:=", 0,
"KC2:=", 0,
"PropagationState:=", "Propagating",
"Attenuation:=", 0,
"PolarizationState:=", "TE",
"AffectsRefinement:=", False],
["NAME:Mode",
"ModeNumber:=", 2,
"IndexM:=", 0,
Boundary and
Excitation Module Script Commands 14-60
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"IndexN:=", 0,
"KC2:=", 0,
"PropagationState:=", "Propagating",
"Attenuation:=", 0,
"PolarizationState:=", "TM",
"AffectsRefinement:=", False]
]])
Boundary and
Excitation Module Script Commands 14-61
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-62
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignFresnel
Assigns a Fresnel boundary condition, allows specifying either a perfect absorber or to import a Fresnel table file that describes reflec-
tion and transmission coefficients.
Boundary and
Excitation Module Script Commands 14-63
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignGaussianBeam
Assigns a Gaussian Beam type of incident wave excitation.
UI Access HFSS > Excitations > Assign > Incident Wave > Gaussian Beam...
Boundary and
Excitation Module Script Commands 14-64
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"PhiStart:=",<value>,
"PhiStop:=", <value>,
"PhiPoints:=", <int>,
"ThetaStart:=", <value>,
"ThetaStop:=", <value>,
"ThetaPoints:=", <int>,
"EoPhi:=", <value>,
"EoTheta:=", <value>,
"OriginX:=" , "<numUnit>",
"OriginY:=" , "<numUnit>",
"OriginZ:=" , "<numUnit>",
"BeamWidth:=" , "<numUnit>"
)
IsCartesian
If true, provide the EoX, EoY, EoZ, kX, kY, kZ parameters.
If false, provide the PhiStart, PhiStop, PhiPoints, ThetaStart, Thet-
Stop, ThetaPoints, EoPhi, EoTheta parameters.
Boundary and
Excitation Module Script Commands 14-65
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
["NAME:IncGBeam1",
"Faces:=" , [9],
"IsCartesian:=" , True,
"EoX:=" , "1",
"EoY:=" , "0",
"EoZ:=" , "0",
"kX:=" , "0",
"kY:=" , "0",
"kZ:=" , "1",
"OriginX:=" , "0mm",
"OriginY:=" , "0mm",
"OriginZ:=" , "0mm",
"BeamWidth:=" , "10mm"
])
oModule.AssignGaussianBeam(
["NAME:IncGBeam2",
"Faces:=" , [9],
"IsCartesian:=" , False,
"PhiStart:=" , "0deg",
"PhiStop:=" , "0deg",
Boundary and
Excitation Module Script Commands 14-66
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"PhiPoints:=" , 1,
"ThetaStart:=" , "0deg",
"ThetaStop:=" , "0deg",
"ThetaPoints:=" , 1,
"EoPhi:=" , "1",
"EoTheta:=" , "0",
"OriginX:=" , "0mm",
"OriginY:=" , "0mm",
"OriginZ:=" , "0mm",
"BeamWidth:=" , "10mm"
])
Boundary and
Excitation Module Script Commands 14-67
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Faces:=", Array(9),
"IsCartesian:=", false,
"PhiStart:=","0deg", "PhiStop:=", "90deg", "PhiPoints:=", 2,
"ThetaStart:=", "0deg", "ThetaStop:=", "180deg", "ThetaPoints:=", 3,
"EoPhi:=", "1", "EoTheta:=", "0",
"OriginX:=", "0mm", "OriginY:=", "0mm", "OriginZ:=", "0mm",
"BeamWidth:=", "10mm")
AssignHalfSpace
Assigns a Half Space boundary, dividing the background material at a specified Z axis point. You also assign a material, typically to
the lower half.
Boundary and
Excitation Module Script Commands 14-68
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.AssignHalfSpace(["NAME:HalfSpace1",
Python Example "ZLocation:=", "2mm",
"Material:=", "water_sea"])
AssignHertzianDipoleWave
Assigns an incident Hertzian-Dipole wave as excitation.
UI Access HFSS > Excitations > Assign > Incident Wave > Hertzian-Dipole Wave...
Boundary and
Excitation Module Script Commands 14-69
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-70
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"kZ:=" , "1",
"OriginX:=" , "0mm",
"OriginY:=" , "0mm",
"OriginZ:=" , "0mm",
"SphereRadius:=" , "10mm",
"IsElectricDipole:=" , True
])
VB Syntax AssignHertzianDipoleWave<ArgArray>
oModule.AssignHertzianDipoleWave Array("NAME:IncHDWave2",
"Faces:=", Array(9),
"IsCartesian:=", true,
"EoX:=" , "0", "EoY:=", "0", "EoZ:=", "1",
VB Example
"kX:=", "0", "kY:=", "0", "kZ:=", "1",
"OriginX:=", "0mm", "OriginY:=", "0mm", "OriginZ:=", "0mm",
"SphereRadius:=", "10mm",
"IsElectricDipole:=", true)
AssignHybridRegion
Assigns a Hybrid Region to a conductor, one of IE, PO, or SBR.
UI Access HFSS > Hybrid > Assign Hybrid > IE Region... or PO Region... or SBR+ Region....
Boundary and
Excitation Module Script Commands 14-71
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-72
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignIERegion
Assigns an IE Region to a conductor contained within a FEBI Radiation boundary.
UI Access N/A
AssignImpedance
Creates an impedance boundary for an HFSS design.
Boundary and
Excitation Module Script Commands 14-73
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-74
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignIncidentWave
Creates an incident wave excitation.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-75
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"kZ:=", <value>
"PhiStart:=",<value>,
"PhiStop:=", <value>,
"PhiPoints:=", <int>,
"ThetaStart:=", <value>,
"ThetaStop:=", <value>,
"ThetaPoints:=", <int>,
"EoPhi:=", <value>,
"EoTheta:=", <value>,
"IsPropagating:=", <boolean>,
"IsEvanescent:=", <boolean>,
"IsEllipticallyPolarized:=", <boolean>)
IsCartesian
If true, provide the EoX, EoY, EoZ, kX, kY, kZ parameters.
If false, provide the PhiStart, PhiStop, PhiPoints, ThetaStart, Thet-
Stop, ThetaPoints, EoPhi, EoTheta parameters.
Boundary and
Excitation Module Script Commands 14-76
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Faces:=", [9],
"IsCartesian:=", True,
"EoX:=", "1", "EoY:=", "0", "EoZ:=", "0",
"kX:=", "0", "kY:=", "0", "kZ:=", "1",
"IsPropagating:=", True,
"IsEvanescent:=", False,
"IsEllipticallyPolarized:=", False]
)
oModule.AssignIncidentWave(["NAME:IncWave2",
"Faces:=", [9],
"IsCartesian:=", False,
"PhiStart:=","0deg",
"PhiStop:=", "90deg",
"PhiPoints:=", 2,
"ThetaStart:=", "0deg",
"ThetaStop:=", "180deg",
"ThetaPoints:=", 3,
"EoPhi:=", "1", "EoTheta:=", "0",
"IsPropagating:=", True,
"IsEvanescent:=", False,
"IsEllipticallyPolarized:=", False
Boundary and
Excitation Module Script Commands 14-77
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
])
Boundary and
Excitation Module Script Commands 14-78
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ThetaPoints:=", 3, _
"EoPhi:=", "1", "EoTheta:=", "0", _
"IsPropagating:=", true, _
"IsEvanescent:=", false, _
"IsEllipticallyPolarized:=", false)
AssignLatticePair
Assigns coupled Lattice Pair boundaries.
UI Access HFSS > Boundaries > Assign > Coupled... > Lattice Pair...
Boundary and
Excitation Module Script Commands 14-79
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.AssignLatticePair(
["NAME:LatticePair1",
"Faces:=" , [9,8],
"ReverseV:=" , False,
"PhaseDelay:=" , "UseScanAngle",
"Phi:=" , "0deg",
"Theta:=" , "0deg"]
Python Example )
oModule.AssignLatticePair(
["NAME:LatticePair2",
"Faces:=" , [8,9],
"ReverseV:=" , False,
"PhaseDelay:=" , "InputPhaseDelay",
"Phase:=" , "10deg"]
)
Boundary and
Excitation Module Script Commands 14-80
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ReverseV:=", false,
"PhaseDelay:=", "UseScanAngle",
"Phi:=", "0deg",
"Theta:=", "0deg")
oModule.AssignLatticePair Array("NAME:LatticePair2",
"Faces:=", Array(8,9),
"ReverseV:=", false,
"PhaseDelay:=", "InputPhaseDelay",
"Phase:=", "10deg")
AssignLayeredImp
Creates a layered impedance boundary.
Boundary and
Excitation Module Script Commands 14-81
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>,
"InfGroundPlane:=", <boolean>)
<LayersArray> Array Structured array.
Array("NAME:Layers",
<OneLayerArray>, <OneLayerArray>, ...)
<OneLayerArray> Array Structured array.
Array("NAME:<LayerName>",
"LayerType:=", <LayerType>,
"Thickness:=",<value>,
"Material:=", <string>)
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".
<LayerName> String Specifies the layer number, such as "Layer1" or "Layer2"
<LayerType> String Should be specified for the last layer only.
Possible values: "Infinite", "PerfectE", or "PerfectH"
Boundary and
Excitation Module Script Commands 14-82
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-83
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"InfGroundPlane:=", false)
AssignLinearAntennaWave
Creates an incident linear antenna wave excitation.
UI Access HFSS > Excitations > Assign > Incident Wave > Linear Antenna Wave...
Boundary and
Excitation Module Script Commands 14-84
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ThetaPoints:=", <int>,
"EoPhi:=", <value>,
"EoTheta:=", <value>,
"OriginX:=" , "<numUnit>",
"OriginY:=" , "<numUnit>",
"OriginZ:=" , "<numUnit>",
"AntennaRadius:=" , "<numUnit>",
"AntennaLength:=" , "<numUnit>")
IsCartesian
If true, provide the EoX, EoY, EoZ, kX, kY, kZ parameters.
If false, provide the PhiStart, PhiStop, PhiPoints, ThetaStart, Thet-
Stop, ThetaPoints, EoPhi, EoTheta parameters.
Boundary and
Excitation Module Script Commands 14-85
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"EoZ:=" , "0",
"kX:=" , "0",
"kY:=" , "0",
"kZ:=" , "1",
"OriginX:=" , "0mm",
"OriginY:=" , "0mm",
"OriginZ:=" , "0mm",
"AntennaRadius:=" , "10mm",
"AntennaLength:=" , "10mm"
])
oModule.AssignLinearAntennaWave(
["NAME:IncLWave2",
"Faces:=" , [9],
"IsCartesian:=" , False,
"PhiStart:=" , "0deg",
"PhiStop:=" , "0deg",
"PhiPoints:=" , 1,
"ThetaStart:=" , "0deg",
"ThetaStop:=" , "0deg",
"ThetaPoints:=" , 1,
Boundary and
Excitation Module Script Commands 14-86
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"EoPhi:=" , "1",
"EoTheta:=" , "0",
"OriginX:=" , "0mm",
"OriginY:=" , "0mm",
"OriginZ:=" , "0mm",
"AntennaRadius:=" , "10mm",
"AntennaLength:=" , "10mm"
])
Boundary and
Excitation Module Script Commands 14-87
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignLinkedImpedance
Assigns a linked Impedance boundary.
Boundary and
Excitation Module Script Commands 14-88
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-89
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"PreservePartnerSoln:=", False,
"PathRelativeTo:=", "TargetProject"]
])
Boundary and
Excitation Module Script Commands 14-90
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignLinkedRegion
Assigns a Hybrid Region as a Linked Region.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-91
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignLumpedPort
Creates a lumped port excitation.
UI Access HFSS > Excitations > Assign > Port > Lumped Port...
Boundary and
Excitation Module Script Commands 14-92
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
<OneModeArray>, <OneModeArray>,...)
<OneModeArray> Array Structured array.
Array("NAME:<ModeName>",
"ModeNum:=", <integer>,
"UseIntLine:=", <boolean>,
<IntegerationLineArray>,
"AlignmentGroup:=", <integer, group id>,
"CharImp:=", <string, characteristic impedance>,
"RenormImp:=" , <value, renormalize impedance to>)
< Array Structured array.
IntegerationLineArray>
Array("NAME:<LineName>",
"Coordinate System:=", <string, relative coordinate
system>,
"Start:=" , <array, start location coordinates>,
"End:=" , <array, end location coordinates>)
Boundary and
Excitation Module Script Commands 14-93
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"DoDeembed:=", False,
"RenormalizeAllTerminals:=", True,
["NAME:Modes",
["NAME:Mode1",
"ModeNum:=", 1,
"UseIntLine:=", True,
["NAME:IntLine",
"Coordinate System:=", "Global",
"Start:=", ["-0.4mm","-1mm","0.8mm"],
"End:=" , ["-0.3mm","-1.2mm","0.8mm"]
],
"AlignmentGroup:=", 0,
"CharImp:=", "Zpi",
"RenormImp:=", "50ohm"]],
"ShowReporterFilter:=", False,
"ReporterFilter:=", [True],
"Impedance:=", "50ohm"
])
Boundary and
Excitation Module Script Commands 14-94
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignLumpedRLC
Creates a lumped RLC boundary.
Boundary and
Excitation Module Script Commands 14-95
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"UseResist:=",<boolean>,
"Resistance:=", <value>,
"UseInduct:=", <boolean>,
"Inductance:=", <value>,
"UseCap:=", <boolean>,
"Capacitance:=", <value>,
<CurrentLineArray>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
<CurrentLineArray> Array Structured array.
Array("NAME:CurrentLine", _
"Start:=", <LineEndPoint>,
"End:=", <LineEndPoint>)
Boundary and
Excitation Module Script Commands 14-96
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Objects:=", ["Box1"],
[
"NAME:CurrentLine",
"Start:=", ["0.15mm","-0.2mm","0mm"],
"End:=" , ["0.15mm","0.6mm","0mm"]
],
"RLC Type:=", "Parallel",
"UseResist:=", True,
"Resistance:=", "100ohm",
"UseInduct:=", True,
"Inductance:=", "10nH",
"UseCap:=", True,
"Capacitance:=", "10pF"
])
Boundary and
Excitation Module Script Commands 14-97
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"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
Creates a magnetic bias source.
Boundary and
Excitation Module Script Commands 14-98
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
IsUniformBias
If true, supply the Bias, XAngle, YAngle, and ZAngle parameters.
If false, supply the Project parameter.
Boundary and
Excitation Module Script Commands 14-99
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignMultipactionChargeRegion
Creates a Multipaction Charge Region for HFSS multipaction analysis.
UI Access HFSS > Excitations > Assign > Multipaction Charge Region...
Boundary and
Excitation Module Script Commands 14-100
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-101
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignMultipactionDCBias
Set up DC electric or magnetic bias fields for a multipaction analysis
Boundary and
Excitation Module Script Commands 14-102
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Hx:=", "<value><unit>",
"Hy:=", "<value><unit>",
"Hz:=", "<value><unit>",
<LinkedField>)
UniformE or Uniform H:
l True - provide filed values.
Boundary and
Excitation Module Script Commands 14-103
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-104
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"move_x:=", "-1.5mm",
"sensor_offset_x:=", "0mm",
"sensor_offset_y:=", "0mm",
"sensor_offset_z:=", "0mm",
"sensor_pitch:=", "0deg",
"sensor_roll:=", "0deg",
"sensor_yaw:=", "0deg",
"target_dia:=", "80mm"
],
"ForceSourceToSolve:=", False,
"PreservePartnerSoln:=", False,
"PathRelativeTo:=", "TargetProject"
],
"UniformH:=", True,
"Hx:=", "0A_per_m",
"Hy:=", "0A_per_m",
"Hz:=", "0A_per_m"
])
Boundary and
Excitation Module Script Commands 14-105
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Objects:=", Array("Cylinder1"), _
"UniformE:=", true, _
"Ex:=", "0V_per_meter", "Ey:=", "0V_per_meter", "Ez:=", "0V_per_meter", _
"UniformH:=", true, _
"Hx:=", "0A_per_m", "Hy:=", "0A_per_m", "Hz:=", "0A_per_m")
AssignMultipactionSEE
Creates Secondary Electron Emission (SEE) boundaries for a Multipaction analysis.
Boundary and
Excitation Module Script Commands 14-106
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignNearFieldWave
Assigns near field wave as excitation.
Boundary and
Excitation Module Script Commands 14-107
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
UI Access HFSS > Excitations > Assign > Linked Field > Near Field Wave.
Boundary and
Excitation Module Script Commands 14-108
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-109
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-110
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Type:=", "Incident")
AssignPerfectE
Creates a perfect E boundary.
Boundary and
Excitation Module Script Commands 14-111
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.AssignPerfectE Array("NAME:PerfE1",_
VB Example "InfGroundPlane:=", false,_
"Faces:=", Array(12))
AssignPerfectH
Creates a perfect H boundary.
Parameters Array("NAME:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Boundary and
Excitation Module Script Commands 14-112
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignPlaneWave
Creates an incident plane wave excitation.
UI Access HFSS > Excitations > Assign > Incident Wave > Plane Wave...
Boundary and
Excitation Module Script Commands 14-113
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ThetaStop:=", <value>,
"ThetaPoints:=", <integer>,
"EoPhi:=", <value>,
"EoTheta:=", <value>,
"OriginX:=", "<numUnit>",
"OriginY:=", "<numUnit>",
"OriginZ:=", "<numUnit>",
"IsPropagating:=", <boolean>,
"IsEvanescent:=", <boolean>,
"IsEllipticallyPolarized:=", <boolean>,
"RealPropConst:=", "<value>",
"ImagPropConst:=", "<value>",
"PolarizationAngle:=", "<value>deg",
"PolarizationRatio:=" , "<value>")
IsCartesian:
Boundary and
Excitation Module Script Commands 14-114
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
IsEllipticallyPolarized:
Boundary and
Excitation Module Script Commands 14-115
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"IsEllipticallyPolarized:=", False
])
oModule.AssignPlaneWave(
["NAME:IncPWave2",
"Faces:=" , [8],
"IsCartesian:=" , False,
"PhiStart:=" , "0deg",
"PhiStop:=" , "0deg",
"PhiPoints:=" , 1,
"ThetaStart:=" , "0deg",
"ThetaStop:=" , "0deg",
"ThetaPoints:=" , 1,
"EoPhi:=" , "1",
"EoTheta:=" , "0",
"OriginX:=" , "0mm",
"OriginY:=" , "0mm",
"OriginZ:=" , "0mm",
"IsPropagating:=" , False,
"IsEvanescent:=" , True,
"IsEllipticallyPolarized:=", False,
Boundary and
Excitation Module Script Commands 14-116
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"RealPropConst:=" , "0",
"ImagPropConst:=" , "1"
])
AssignPrimary
Creates a primary boundary.
UI Access HFSS > Boundaries > Assign > Coupled > Primary...
Boundary and
Excitation Module Script Commands 14-117
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("NAME:<BoundName>",
<CoordSysArray>,
"ReverseV:=", <boolean>,
"Faces:=", <AssignmentFaces>)
<CoordSysArray> Array Structured array.
Array("NAME:CoordSysVector",
"Origin:=", <CoordSysPoint>,
"UPos:=", <LineEndPoint>)
Boundary and
Excitation Module Script Commands 14-118
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignRadiation
Creates a radiation boundary.
Boundary and
Excitation Module Script Commands 14-119
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignRFDischargeDCBias
Creates the DC bias for an RF Discharge simulation.
Boundary and
Excitation Module Script Commands 14-120
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-121
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.AssignRFDischargeDCBias _
Array("NAME:RFDischargeDCBias1", _
VB Example
"UniformH:=", True, _
"Hx:=", "795774.71546A_per_m","Hy:=", "0A_per_m","Hz:=", "0A_per_m")
AssignScreeningImpedance
Creates a screening impedance boundary.
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 see the second example.
Boundary and
Excitation Module Script Commands 14-122
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("NAME:XLink",
"Project:=", "<projectName>.aedt",
"Design:=", "<DesignName>",
"Soln:=", "Setup1 : LastAdaptive",
Array("NAME:Params", "<variable>:=", "<value>"),
"ForceSourceToSolve:=", <Boolean>,
"PreservePartnerSoln:=", <Boolean>,
"PathRelativeTo:=", "TargetProject"),
Array("NAME:YLink",
"Project:=", "<projectName>.aedt",
"Design:=", "HFSSDesign1",
"Soln:=", "Setup1 : LastAdaptive",
Array("NAME:Params", "<variable>:=", "<value>"),
"ForceSourceToSolve:=", <Boolean>
"PreservePartnerSoln:=", <Boolean>,
"PathRelativeTo:=", "TargetProject"))
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Boundary and
Excitation Module Script Commands 14-123
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project53")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.AssignScreeningImpedance Array("NAME:Screening1",
"Faces:=", Array(12),
"IsAnisotropic:=", false,
"HasExternalLink:=", false,
"XResistance:=", "377", "XReactance:=", "0")
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Boundary and
Excitation Module Script Commands 14-124
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignSecondary
Creates a secondary boundary.
Boundary and
Excitation Module Script Commands 14-125
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
UI Access HFSS > Boundaries > Assign > Coupled > Secondary...
Boundary and
Excitation Module Script Commands 14-126
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-127
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Faces:=", [11]])
Boundary and
Excitation Module Script Commands 14-128
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"UseScanAngles:=",false,_
"Phase:=", "10deg",_
"Faces:=", Array(11))
AssignSymmetry
Creates a symmetry boundary.
Boundary and
Excitation Module Script Commands 14-129
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignTerminal
Assigns terminals to a port.
Boundary and
Excitation Module Script Commands 14-130
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.AssignTerminal(
["NAME:Rectangle1_T1",
Python Example "Edges:=", [36],
"ParentBndID:=", "WavePort1",
"TerminalResistance:=", "50ohm"])
AssignVoltage
Creates a voltage source.
Boundary and
Excitation Module Script Commands 14-131
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-132
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AssignWavePort
Creates a wave port.
UI Access HFSS > Excitations > Assign > Port > Wave Port...
Boundary and
Excitation Module Script Commands 14-133
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("NAME:Modes",
<OneModeArray>, <OneModeArray>, ...)
<OneModeArray> Array Structured array.
Array("NAME:<ModeName>",
"ModeNum:=", <integer>,
"UseIntLine:=", <boolean>,
<IntLineArray>)
<IntLineArray> Array Structured array.
Array("NAME:IntLine",
"Start:=", <LineEndPoint>,
"End:=", <LineEndPoint>,
"CharImp:=", <string, Characteristic impedance of
the mode. Possible values are "Zpi", "Zpv", or
"Zvi">)
Boundary and
Excitation Module Script Commands 14-134
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"DeembedDist:=", "10mil",
"DoRenorm:=", True,
"RenormValue:=","50Ohm",
["NAME:Modes",
["NAME:Mode1",
"ModeNum:=", 1,
"UseIntLine:=", True,
["NAME:IntLine",
"Start:=", [-0.4, -1.2, 0),
"End:=", [-1.4, 0.4, 0]],
"CharImp:=", "Zpi"),
["NAME:Mode2",
"ModeNum:=", 2,
"UseIntLine:=", False]],
"Faces:=", [7]])
Boundary and
Excitation Module Script Commands 14-135
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"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))
AutoCreatePECCapforWavePort
Use: If the HFSS Option for HFSS>Boundary Assignment>Automatic PEC cap creation for wave port is enabled, HFSS automatically
creates a PEC cap under the following conditions: The general rule is that the dialog for creating wave port PEC backing appears if the
wave port is internal to the design and does not touch any non-solve-inside component. If a project has open region defined, all geo-
metries are considered internal.
Command: None.
Boundary and
Excitation Module Script Commands 14-136
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-137
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AutoCreatePECCapForWavePort(
[
"NAME:AutoCreatePECCapForWavePort",
"Wave Port Name:=" , "2",
Python Example
"Face ID:=" , 280,
"Flip Side:=" , False,
"Thickness:=" , "0.18mm"
])
CircuitPortToLumpedPort
Converts a circuit port to a lumped port for a driven terminal or driven modal design in HFSS.
Boundary and
Excitation Module Script Commands 14-138
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditAnisotropicImpedance
Modifies an Anisotropic Impedance boundary condition.
UI Access Double-click the boundary condition in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-139
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.EditAnisotropicImpedance("Anistropic10",
["NAME:Anisotropic1",
"Faces:=" , [17215],
"UseInfiniteGroundPlane:=", False,
"CoordSystem:=" , "Global",
"HasExternalLink:=" , False,
"ZxxResistance:=" , "377",
Python Example "ZxxReactance:=" , "0",
"ZxyResistance:=" , "0",
"ZxyReactance:=" , "0",
"ZyxResistance:=" , "0",
"ZyxReactance:=" , "0",
"ZyyResistance:=" , "377",
"ZyyReactance:=" , "0"
])
Boundary and
Excitation Module Script Commands 14-140
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditAperture
Modifies an aperture boundary.
UI Access Double-click the boundary condition in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-141
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.EditAperture("Aperture1"
["NAME:Aperture2",
Python Example
"Objects:=", ["Rectangle1"]
])
EditCircuitPort[HFSS]
Edits a circuit port for a driven terminal or driven modal design in HFSS.
UI Access Double-click the excitation in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-142
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-143
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.EditCircuitPort "5" _
Array("NAME:1", _
"Impedance:=", "50ohm", _
VB Example
"DoDeembed:=", false, _
"RenormalizeAllTerminals:=", true, _
"TerminalIDList:=", Array())
EditCurrent
Modifies a current source.
UI Access Double-click the excitation in the project tree to modify its settings.
Parameters <DirectionArray>,
"TerminalIDLit:=", Array() )
<DirectionArray> Array Structured array.
Array("NAME:Direction",
"Start:=", <LineEndPoint>,
"End:=", <LineEndPoint>)
Boundary and
Excitation Module Script Commands 14-144
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-145
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditDielectricCavity
Modifies definitions of a Dielectric Cavity.
UI Access Double-click the cavity under Hybrid Regions in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-146
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditDiffPairs
Edits the properties of differential pairs defined from terminal excitations on wave ports.
Boundary and
Excitation Module Script Commands 14-147
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-148
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"IsActive:=", true))
EditFEBI
Modifies a FE-BI hybrid region.
UI Access Double-click the FE-BI under Hybrid Regions in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-149
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditFiniteCond
Modifies parameters of single finite conductivity boundary.
Boundary and
Excitation Module Script Commands 14-150
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Roughness:=", "2um",
"UseCoating:=", false]
)
EditFloquetPort
Modifies a Floquet port excitation.
Boundary and
Excitation Module Script Commands 14-151
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ShowReporterFilter:=", <boolean>,
"UseScanAngles:=", <boolean>,
"Phi:=", "<numdeg>",
"Theta:=", "<numdeg>",
<LatticeAVector>,
<LatticeBVector>,
<ModesCalculator>,
<ModesList>)
<ModesArray> Array Structured array.
Array("NAME:Modes", Array("NAME:<ModeName>",
"ModeNum:=", <integer>,
"UseIntLine:=", <boolean>),
...)
<LatticeAVector> Array Structured array.
Array("NAME:LatticeAVector",
"Start:=", Array("<num><units>", "<num><units>",
"<num><units>"),
"End:=", Array("<num><units>", "<num><units>",
"<num><units>"))
<LatticeBVector> Array Structured array.
Array("NAME:LatticeBVector",
"Start:=", Array("<num><units>", "<num><units>",
Boundary and
Excitation Module Script Commands 14-152
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"<num><units>"),
"End:=", Array("<num><units>", "<num><units>",
"<num><units>"))
<ModesCalculator> Array Structured array.
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")
<ModesList> Array Structured array.
Array("NAME:ModesList",
Array("NAME:Mode",
"ModeNumber:=", <ModeID>,
"IndexM:=", <integer index>,
"IndexN:=", <integer index>,
"KC2:=", <integer value>,
"PropagationState:=", "Propagating",
"Attenuation:=", <integer value>,
Boundary and
Excitation Module Script Commands 14-153
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-154
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-155
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"KC2:=", 0,
"PropagationState:=", "Propagating",
"Attenuation:=", 0,
"PolarizationState:=", "TE",
"AffectsRefinement:=", False],
["NAME:Mode",
"ModeNumber:=", 2,
"IndexM:=", 0,
"IndexN:=", 0,
"KC2:=", 0,
"PropagationState:=", "Propagating",
"Attenuation:=", 0,
"PolarizationState:=", "TM",
"AffectsRefinement:=", False]
]])
Boundary and
Excitation Module Script Commands 14-156
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"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.5mm"),
"End:=", Array( "0mm", "0.6mm", "0.8mm")),
Array("NAME:LatticeBVector", "Start:=", Array("0mm", "0mm", "0.5mm"),
"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),
Boundary and
Excitation Module Script Commands 14-157
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("NAME:Mode", "ModeNumber:=", 2,
"IndexM:=", 0, "IndexN:=", 0,
"KC2:=", 0,
"PropagationState:=", "Propagating",
"Attenuation:=", 0,
"PolarizationState:=", "TM", "AffectsRefinement:=", false)))
EditFresnel
Modifies a Fresnel boundary condition.
Parameters Array("NAME:<FresnelName>",
"Fresnel Boundary Type:=", <PerfectAbsorber or
ImportFromTableFile>,
"RTTable Path:=", <string path to table file>)
Boundary and
Excitation Module Script Commands 14-158
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
["NAME:Fresnel2",
"Fresnel Boundary Type:=", "PerfectAbsorber"
])
EditGlobalMatEnv
Modifies global material environment setting to tell HFSS what material properties to use when calculating far fields.
Boundary and
Excitation Module Script Commands 14-159
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditHalfSpace
Modifies a Half Space boundary name, Z location, and or materials.
Boundary and
Excitation Module Script Commands 14-160
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.EditHalfSpace "HalfSpace1", _
Array("NAME:HalfSpace1After", _
VB Example
"ZLocation:=", "2mm", _
"Material:=", "tungsten")
EditHybridRegion
Modifies settings of an assigned hybrid region.
Boundary and
Excitation Module Script Commands 14-161
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
])
EditImpedance
Modifies an impedance boundary definitions.
Boundary and
Excitation Module Script Commands 14-162
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditIncidentWave
Modifies an incident wave excitation.
UI Access Double-click the excitation in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-163
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("NAME:<BoundName>",
"IsCartesian:=",<boolean>,
"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>,
"IsPropagating:=", <boolean>,
"IsEvanescent:=", <boolean>,
"IsEllipticallyPolarized:=", <boolean>)
IsCartesian
Boundary and
Excitation Module Script Commands 14-164
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-165
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditLatticePair
Modifies coupled Lattice Pair boundaries.
UI Access Double-click on a lattice pair under Boundaries in the project history tree.
Boundary and
Excitation Module Script Commands 14-166
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.EditLatticePair("LatticePair1",
["NAME:LatticePair1After",
"ReverseV:=", False,
Python Example "PhaseDelay:=", "UseScanAngle",
"Phi:=", "10deg",
"Theta:=", "0deg"]
)
EditLayeredImp
Modifies a layered impedance boundary.
UI Access Double-click on a layered impedance under Boundaries in the project history tree.
Boundary and
Excitation Module Script Commands 14-167
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-168
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Material assigned on the layer. For the last layer, do not specify a
material if the LayerType is "PerfectE" or "PerfectH".
<LayerName> String Specifies the layer number, such as "Layer1" or "Layer2"
<LayerType> String Should be specified for the last layer only.
Possible values: "Infinite", "PerfectE", or "PerfectH"
Boundary and
Excitation Module Script Commands 14-169
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Frequency:=", "10GHz", _
"Roughness:=", "0um", _
"IsTwoSided:=", true, _
"IsShellElement:=", true, _
Array("NAME:Layers", Array("NAME:Layer1", _
"Thickness:=", "1um", "Material:=", "vacuum")), _
"InfGroundPlane:=", false)
EditLinkedImpedance
Edits a linked Impedance boundary.
Boundary and
Excitation Module Script Commands 14-170
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-171
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"PreservePartnerSoln:=", False,
"PathRelativeTo:=", "TargetProject"]
])
Boundary and
Excitation Module Script Commands 14-172
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditLinkedRegion
Edits a Linked Region.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-173
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.EditLinkedRegion "Linked1", _
Array("NAME:Linked1After", _
VB Example
"Type:=", "PO", _
"IsLinkedRegion:=", true)
EditLumpedPort
Modifies a lumped port.
UI Access Double-click the excitation in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-174
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("NAME:<ModeName>",
"ModeNum:=", <integer>,
"UseIntLine:=", <boolean>,
<IntegerationLineArray>,
"AlignmentGroup:=", <integer, group id>,
"CharImp:=", <string, characteristic impedance>,
"RenormImp:=" , <value, renormalize impedance to>)
< Array Structured array.
IntegerationLineArray>
Array("NAME:<LineName>",
"Coordinate System:=", <string, relative coordinate
system>,
"Start:=" , <array, start location coordinates>,
"End:=" , <array, end location coordinates>)
Boundary and
Excitation Module Script Commands 14-175
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
["NAME:Mode1",
"ModeNum:=", 1,
"UseIntLine:=", True,
["NAME:IntLine",
"Coordinate System:=", "Global",
"Start:=", ["-0.4mm","-1mm","0.8mm"],
"End:=" , ["-0.3mm","-1.2mm","0.8mm"]
],
"AlignmentGroup:=", 0,
"CharImp:=", "Zpi",
"RenormImp:=", "50ohm"]],
"ShowReporterFilter:=", False,
"ReporterFilter:=", [True],
"Impedance:=", "50ohm"
])
Boundary and
Excitation Module Script Commands 14-176
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditLumpedRLC
Modifies a lumped RLC boundary.
UI Access Double-click the boundary in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-177
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("NAME:CurrentLine",
"Start:=", <LineEndPoint>,
"End:=", <LineEndPoint>)
Boundary and
Excitation Module Script Commands 14-178
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditMagneticBias
Modifies a magnetic bias excitation.
UI Access Double-click on the magnetic bias under Excitations in the project tree.
Boundary and
Excitation Module Script Commands 14-179
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Bias:=", <value>,
"XAngle:=", <value>,
"YAngle:=", <value>,
"ZAngle:=", <value>,
"Project:=",<string>)
IsUniformBias
If true, supply the Bias, XAngle, YAngle, and ZAngle parameters.
If false, supply the Project parameter.
Boundary and
Excitation Module Script Commands 14-180
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditMultipactionChargeRegion
Modifies settings for a Multipaction Charge Region.
Boundary and
Excitation Module Script Commands 14-181
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Vz:=", "<num><unit>")
Boundary and
Excitation Module Script Commands 14-182
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditMultipactionDCBias
Edits settings for a multipaction DC bias boundary.
UI Access Double-click on the excitation in the project tree to edit its settings.
Boundary and
Excitation Module Script Commands 14-183
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-184
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Design:=", "3_Maxwell3D",
"Soln:=", "Setup1 : Transient",
["NAME:Params",
"angle:=", "0deg",
"cell_spacing:=", "2.5mm",
"die_thickness:=", "2mm",
"gap:=", "1.5mm",
"magnet_center_y:=", "0mm",
"magnet_center_z:=", "0mm",
"magnet_x:=", "3mm",
"magnet_y:=", "6mm",
"magnet_z:=", "5mm",
"move_x:=", "-1.5mm",
"sensor_offset_x:=", "0mm",
"sensor_offset_y:=", "0mm",
"sensor_offset_z:=", "0mm",
"sensor_pitch:=", "0deg",
"sensor_roll:=", "0deg",
"sensor_yaw:=", "0deg",
"target_dia:=", "80mm"
],
Boundary and
Excitation Module Script Commands 14-185
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ForceSourceToSolve:=", False,
"PreservePartnerSoln:=", False,
"PathRelativeTo:=", "TargetProject"
],
"UniformH:=", True,
"Hx:=", "0A_per_m",
"Hy:=", "0A_per_m",
"Hz:=", "0A_per_m"
])
EditMultipactionSEE
Edits a Secondary Electron Emission (SEE) boundary settings.
Boundary and
Excitation Module Script Commands 14-186
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
UI Access Double-click on the boundary in the project tree to edit its settings.
Boundary and
Excitation Module Script Commands 14-187
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditRFDischargeDCBias
Edits settings for an RF discharge DC bias excitation.
UI Access Double-click on the excitation in the project tree to edit its settings.
Boundary and
Excitation Module Script Commands 14-188
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditPerfectE
Modifies a perfect E boundary.
Boundary and
Excitation Module Script Commands 14-189
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-190
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditPerfectH
Modifies a perfect H boundary.
UI Access Double-click on the boundary in the project tree to edit its settings.
EditPrimary
Modifies a primary boundary.
UI Access Double-click on a primary boundary in the project tree to edit its settings.
Boundary and
Excitation Module Script Commands 14-191
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-192
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
])
EditRadiation
Modifies a radiation boundary.
UI Access Double-click the boundary in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-193
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"IsForPML:=", <boolean>,
"UseAdaptiveIE:=", <boolean>,
"IncludeInPostproc:=", <boolean>)
Boundary and
Excitation Module Script Commands 14-194
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"IsIncidentField:=", true, _
"IsEnforcedField:=", false, _
"IsFssReference:=", false, _
"IsForPML:=", false, _
"UseAdaptiveIE:=", false, _
"IncludeInPostproc:=", true)
EditSecondary
Modifies a secondary boundary.
UI Access Double-click the boundary in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-195
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-196
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
])
EditSymmetry
Modifies a symmetry boundary.
UI Access Double-click the symmetry boundary in the project tree to edit its settings.
Boundary and
Excitation Module Script Commands 14-197
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"IsPerfectE:=", <boolean>)
EditTerminal
Modifies properties of a terminal
Boundary and
Excitation Module Script Commands 14-198
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditVoltage
Modifies a voltage source.
Boundary and
Excitation Module Script Commands 14-199
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
UI Access Double-click the excitation in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-200
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
]
)
EditVoltageDrop
Use: Edits a voltage drop excitation.
Command: Double-click the excitation in the project tree to edit it.
Syntax:EditVoltageDrop <BoundName> <VoltageDropArray>
Return Value: None
EditWavePort
Modifies a wave port.
UI Access Double-click the excitation in the project tree to modify its settings.
Boundary and
Excitation Module Script Commands 14-201
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-202
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-203
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"UseIntLine:=", True,
["NAME:IntLine",
"Start:=", [-0.4, -1.2, 0),
"End:=", [-1.4, 0.4, 0]],
"CharImp:=", "Zpi"),
["NAME:Mode2",
"ModeNum:=", 2,
"UseIntLine:=", False]
]
])
Boundary and
Excitation Module Script Commands 14-204
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"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)))
LumpedPortToCircuitPort
Converts a lumped port to a circuit port for a driven terminal or driven modal design in HFSS.
UI Access Right-click on a lumped port excitation in the project tree, then select Convert to Circuit Port.
Boundary and
Excitation Module Script Commands 14-205
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetAllHybridRegionsToOneWayCoupled
Specifies one-way coupling for all hybrid regions.
UI Access Right-click Hybrid Regions > Set Regions > All Regions Are One Way Coupled.
Parameters None.
Return Value None.
VB Syntax SetAllHybridRegionsToOneWayCoupled
VB Example oModule.SetAllHybridRegionsToOneWayCoupled
SetAllHybridRegionsToTwoWayCoupled
Specifies two-way coupling for all hybrid regions.
Boundary and
Excitation Module Script Commands 14-206
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
UI Access Right-click Hybrid Regions > Set Regions > All Regions Are Two Way Coupled.
Parameters None.
Return Value None.
VB Syntax SetAllHybridRegionsToTwoWayCoupled
VB Example oModule.SetAllHybridRegionsToTwoWayCoupled
SetHybridRegionCoupledGroup
Use: To set coupling for hybrid regions.
Command: HFSS>HybridRegions>Set Coupling
Syntax: SetHybridRegionCoupledGroup <value>
Return Value: None
Parameters: <value>
Type: <string>
"OneWayCoupled" or "TwoWayCoupled" for all regions or "Advanced", Array("One Way:= <hybridregionname>, Array(Two
Way:=", Array("<hybridregionname>" , )))
VB Example:
Setting All Hybrid Regions to One Way Coupled
Boundary and
Excitation Module Script Commands 14-207
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project35")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.SetHybridRegionCoupledGroup "OneWayCoupled"
Setting All Hybrid Regions to Two Way Coupled
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Boundary and
Excitation Module Script Commands 14-208
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-209
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Hybrid1", "Hybrid2")))
SetHybridRegionsCoupling
Sets coupling for hybrid regions.
Boundary and
Excitation Module Script Commands 14-210
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetScatteredFieldFormulation
Sets incident wave to scattered field formulation. Note: Incident field formulation is only applicable in a driven terminal/modal design
with incident wave.
UI Access Right-click on Excitations, then select Set Incident Field Formulation > Scattered.
Parameters None.
Return Value None.
VB Syntax SetScatteredFieldFormulation
VB Example oModule.SetScatteredFieldFormulation
SetSBRCreepingWaveSettings
Sets creeping wave settings for SBR+ solutions.
Boundary and
Excitation Module Script Commands 14-211
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-212
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.SetSBRCreepingWaveSettings _
Array("NAME:SBRCreepingWaveSettings", _
"CWRaySampleDensity:=", 10, _
VB Example
"CWRayCutoffDb:=", 40, _
"CWCurvatureSensitivity:=", 50, _
"CWAngularRayInterval:=", 2)
SetSBRSources
Designs containing SBR+ regions will always be set to All One-Way and the Set Coupling menu is replaced by the Set SBR+ Source
Regions command. Non-SBR+ regions will serve as sources, and interact with each other through the SBR+ regions. All source
regions interact as one-way links to SBR+ and coupling between the source regions are handled by SBR+ using reciprocity theory. If
Global Setting is selected, Current Source Conformance, Thin Sources, and Power Fraction are not recorded.
UI Access Right-click on Hybrid Regions in the project tree, then select Set SBR+ Source Regions.
Boundary and
Excitation Module Script Commands 14-213
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-214
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-215
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetSBRSourcesBlockage
For HFSS Driven Modal Terminal or Driven Terminal Designs containing SBR+ regions the Set Coupling menu is replaced by the Set
SBR+ Source Regions command. The dialog also contains a Blockage List button. You can create object lists containing objects to
treat as blockages. Such object lists must contain at least one conducting object and have no SBR+ Regions. Enable those lists to
treat the objects as blockages.
UI Access Click Blockage List in the Set SBR+ Source Regions dialog window.
Boundary and
Excitation Module Script Commands 14-216
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.SetSBRSourcesBlockage(
[
Python Example "NAME:SBRBlockageSettings",
"ListsForBlockage:=", ["Objectlist1"]
])
SetSBRTxRxSettings
Assigns Transmit and Receive assignments for antennas in SBR+ solutions.
Boundary and
Excitation Module Script Commands 14-217
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-218
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetSBRWedgeSettings
For designs with an SBR+ Region, sets SBR wedge settings.
Boundary and
Excitation Module Script Commands 14-219
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("Name:SBRWedgeSettings",
"MaxWedgeAngle:=" "<integer with deg>",
"IncludeSheetEdges:=" <boolean>,
"ApplySourceDistFilter:="<boolean>,
"SourceX:=" <x coord>,
"SourceY:=" <Y coord>,
"SourceZ:=" <Z coord>,
"CS:=" "<CS Name>,
"DistFromSource:=", "<integer with units>",
"ApplyBoxFilter:=", <boolean>,
If False, no additional parameters. If True:
"Box:=" <BoxID>)
Boundary and
Excitation Module Script Commands 14-220
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"ApplySourceDistFilter:=", True,
"SourceX:=", 0,
"SourceY:=", 0,
"SourceZ:=", 0,
"CS:=", "Global",
"DistFromSource:=", "1000mm",
"ApplyBoxFilter:=", True,
"Box:=", "Box1"
])
Boundary and
Excitation Module Script Commands 14-221
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetTerminalReferenceImpedances
Sets the reference impedance for all terminals within a specified port.
Boundary and
Excitation Module Script Commands 14-222
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SetTotalFieldFormulation
Sets incident wave to total field formulation. Note: Incident field formulation is only applicable in a driven terminal/modal design with
incident wave.
UI Access Right-click on Excitations, then select Set Incident Field Formulation > Total.
Parameters None.
Return Value None.
VB Syntax SetTotalFieldFormulation
VB Example oModule.SetTotalFieldFormulation
SwapCircuitPortDirection
Swaps the direction of a circuit port.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-223
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
SwapLatticePair
Swaps the faces defined in a lattice pair.
UI Access Right-click on a lattice pair in the project tree, then select Swap Faces.
Boundary and
Excitation Module Script Commands 14-224
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
UnassignIERegions
Use: Unassign one or more IE Regions assigned to conducting objects.
Command: Unassign IE Regions
Syntax: UnassignIERegion Array (<"geometryName">)
Return Value: None
Parameters: <GeometryName>
Type: String
Name of one or more geometries assigned as an IE Region.
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project58")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Boundary and
Excitation Module Script Commands 14-225
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-226
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"UserDrawnGroup:=", true,
"PMLObj:=", <string, name of the object to use as the
PML cover.>,
"BaseObj:=", <string, name of the base object touching
the PML cover object>,
"Thickness:=", <value>,
"Orientation:=", <string, orientation of the PML. Poss-
ible values are: "XAxis", "YAxis", and "ZAxis">,
"RadDist:=", <value>,
"UseFreq:=", <boolean, If true, provide the MinFreq
parameter. If false, provide the MinBeta parameter.>,
"MinFreq:=", <value>,
"MinBeta:=", <double>)
For automatically created PMLs:
Array("NAME:PMLCreationSettings",
"UserDrawnGroup:=", false,
"PMLFaces:=", <AssignmentFaces>,
"CreateJoiningObjs:=", <bool>,
"Thickness:=", <value>,
"RadDist:=", <value>,
"UseFreq:=", <boolean, If true, provide the MinFreq
parameter. If false, provide the MinBeta parameter.>,
"MinFreq:=", <value>,
Boundary and
Excitation Module Script Commands 14-227
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"MinBeta:=", <double>)
Boundary and
Excitation Module Script Commands 14-228
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
VB Example
oModule.CreatePML Array("NAME:PMLCreationSettings", _
"UserDrawnGroup:=", true,_
"PMLObj:=", "Box1", "BaseObj:=", "Box2", _
"Thickness:=", "0.3mm", "Orientation:=", "ZAxis", _
"RadDist:=", "1.6mm", "UseFreq:=", false, _
"MinBeta:=", "2")
ModifyPMLGroup
Modifies a PML group.
UI Access N/A
Parameters Array("NAME:<GroupName>",
"RadDist:=", <value>,
"UseFreq:=", <boolean>,
Boundary and
Excitation Module Script Commands 14-229
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"MinFreq:=", <value>,
"MinBeta:=", <double>)
UseFreq
If true, provide the MinFreq argument.
If false, provide the MinBeta argument.
Boundary and
Excitation Module Script Commands 14-230
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
oModule.ModifyPMLGroup Array("NAME:PMLGroup1", _
VB Example "RadDist:=", "1.166666667mm", _
"UseFreq:=", false, "MinBeta:=", 2)
PMLGroupCreated
Command added by HFSS after a PML has been created. It is not responsible for creating the PML objects and materials. It just con-
tains 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.
UI Access N/A
Boundary and
Excitation Module Script Commands 14-231
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"BaseObj:=", 15,
"Orientation:=", "ZAxis",
"UseFreq:=", True,
"MinFreq:=", "1GHz",
"MinBeta:=", 20,
"RadDist:=", "0.3mm"
])
PMLGroupModified
Modifies a defined PML Group.
Boundary and
Excitation Module Script Commands 14-232
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Array("NAME:<GroupName>",
"RadDist:=", <value>,
"UseFreq:=", <boolean>,
"MinFreq:=", <value>,
"MinBeta:=", <double>)
UseFreq
If true, provide the MinFreq argument.
If false, provide the MinBeta argument.
Boundary and
Excitation Module Script Commands 14-233
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
RecalculatePMLMaterials
Updates the PML materials to match the current state of the PML Setup wizard data.
VB Syntax RecalculatePMLMaterials
Boundary and
Excitation Module Script Commands 14-234
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
VB Example oModule.RecalculatePMLMaterials
AssignMultiFloatingLine
Use: Assigns multiple "Floating Line" on selected objects (each per object).
Command: Click 2D Extractor>Conductor>Assign>Floating Line
Syntax: AssignMultiFloatingLine <MultiAssignmentParameters>
Return Value: None
Parameters: <MultiAssignmentParameters>
Array(<ConductorName>,<ConductorName>..), <AssignmentParameters>
<ConductorName>
Type:<String>
Name of the assigned conductors.
<AssignmentParameters>
Array("NAME:<SourceName>", "Objects:=", <AssignmentObjects>)
"SolveOptions:=<SolveOptions>", "Thickness:=<Thickness>")
<SourceName>
Type:<String>
Name of the conductor
<AssignmentObjects>
Type:<String>
Name of the object or body in geometry.
<SolveOptions>
Boundary and
Excitation Module Script Commands 14-235
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Type: <String>
Value: one of the following - "SolveInside", "SolveOnBoundary", "Automatic".
<Thickness>
Type: String
Value: a double value with units of length.
VB Example: oModule.AssignMultiSignalLine Array("Rectangle3", "Rectangle4"), Array("NAME:Rect-
angle1", "Objects:=", Array( _ "Rectangle1"), "SolveOption:=", "Boundary", "Thickness:=",
"0.171428571428571mm")
AssignMultiSignalLine
Use: Assigns multiple "Signal Line" on selected objects (each per object).
Command: 2D Extractor>Conductor>Assign>Signal Line
Syntax: AssignMultiSignalLine <MultiAssignmentParameters>
Return Value: None
Parameters: <MultiAssignmentParameters>
Array(<ConductorName>,<ConductorName>..), <AssignmentParameters>
<ConductorName>
Type:<String>
Name of the assigned conductors.
<AssignmentParameters>
Array("NAME:<SourceName>", "Objects:=", <AssignmentObjects>)
"SolveOptions:=<SolveOptions>", "Thickness:=<Thickness>")
Boundary and
Excitation Module Script Commands 14-236
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
<SourceName>
Type:<String>
Name of the conductor
<AssignmentObjects>
Type:<String>
Name of the object or body in geometry.
<SolveOptions>
Type: <String>
Value: one of the following - "SolveInside", "SolveOnBoundary", "Automatic".
<Thickness>
Type: String
Value: a double value with units of length.
VB Example: oModule.AssignMultiFloatingLine Array("Rectangle3", "Rectangle4"), Array("NAME:Rect-
angle1", "Objects:=", Array( _ "Rectangle1"), "SolveOption:=", "Boundary", "Thickness:=",
"0.171428571428571mm")
AssignMultiNonIdealGround
Use: Assigns multiple "Non Ideal Ground" on selected objects (each per object).
Command: 2D Extractor>Conductor>Assign>Non Ideal Ground
Syntax: AssignMultiNonIdealGround <MultiAssignmentParameters>
Return Value: None
Parameters: <MultiAssignmentParameters>
Array(<ConductorName>,<ConductorName>..), <AssignmentParameters>
Boundary and
Excitation Module Script Commands 14-237
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
<ConductorName>
Type:<String>
Name of the assigned conductors.
<AssignmentParameters>
Array("NAME:<SourceName>", "Objects:=", <AssignmentObjects>)
"SolveOptions:=<SolveOptions>", "Thickness:=<Thickness>")
<SourceName>
Type:<String>
Name of the conductor
<AssignmentObjects>
Type:<String>
Name of the object or body in geometry.
<SolveOptions>
Type: <String>
Value: one of the following - "SolveInside", "SolveOnBoundary", "Automatic".
<Thickness>
Type: String
Value: a double value with units of length.
Boundary and
Excitation Module Script Commands 14-238
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-239
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EditSurfaceGround
Use: Edits the properties of a surface ground conductor.
Command: Double-click a conductor.
Syntax: EditSurfaceGround <ConductorName> , <ConductorParameters>
Return Value: None
Boundary and
Excitation Module Script Commands 14-240
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Parameters: <ConductorName>
Type: <string>
Conductor name that is selected.
<ConductorParameters>
Array(("Name:=<NewName>", "SolveOptions:=<SolveOptions>", "Thickness:=<Thickness>"))
<SolveOptions>
Type: <String>
Value: one of the following, "SolveInside", "SolveOnBoundary", "Automatic"
<Thickness>
Type: String
Value: a double value with units of length.
<NewName>
Type: <String>
New name of conductor to be toggled.
VB Example: oModule.EditSurfaceGround "Rectangle6", Array("NAME:Rectangle6_1", "SolveOption:=",
"Automatic", "Thickness:=", "0.179464285714286mm")
EditFloatingLine
Use: Edits the properties of a floating line conductor.
Command: Double-click a conductor.
Syntax: EditFloatingLine <ConductorName> , <ConductorParameters>
Return Value: None
Parameters: <ConductorName>
Boundary and
Excitation Module Script Commands 14-241
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Type: <string>
Conductor name that is selected.
<ConductorParameters>
Array(("Name:=<NewName>", "SolveOptions:=<SolveOptions>", "Thickness:=<Thickness>"))
<SolveOptions>
Type: <String>
Value: one of the following, "SolveInside", "SolveOnBoundary", "Automatic"
<Thickness>
Type: String
Value: a double value with units of length.
<NewName>
Type: <String>
New name of conductor to be toggled.
VB Example: oModule.EditFloatingLine "Rectangle6", Array("NAME:Rectangle6_1") "SolveOption:=",
"Automatic", "Thickness:=", "0.179464285714286mm")
AssignFiniteCond
Assigns a single finite conductivity boundary on selected edges.
Boundary and
Excitation Module Script Commands 14-242
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-243
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"UseMaterial:=", True,
"Material:=", "Copper"]
Example for the Hurray surface roughness model
oModule.AssignFiniteCond
["NAME:FiniteCond1",
"Edges:=", [7],
"UseCoating:=", False,
"Radius:=", "0.5um",
"Ratio:=", "2.9"]
Boundary and
Excitation Module Script Commands 14-244
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Material:=", "Copper")
Example for the Hurray surface roughness model
oModule.AssignFiniteCond
Array("NAME:FiniteCond1",
"Edges:=", Array(7),
"UseCoating:=", false,
"Radius:=", "0.5um",
"Ratio:=", "2.9")
EditFiniteCond
Modifies parameters of single finite conductivity boundary.
Boundary and
Excitation Module Script Commands 14-245
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ing.>")
AssignThinConductor
Use:Assign a thin conductor boundary on a 2D object.
Command:Q3D Extractor>Boundary>Assign>Thin Conductor
Boundary and
Excitation Module Script Commands 14-246
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Boundary and
Excitation Module Script Commands 14-247
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ToggleTerminal
Use:Toggles between source and sink.
Command:Click a terminal in the project tree, and then click Toggle on the shortcut menu.
Syntax:ToggleTerminal <TerminalName>
Return Value:None
Boundary and
Excitation Module Script Commands 14-248
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
"Length2")
GetMeshOpAssignment
Find a list of objects that are associated with a mesh operation.
UI Access N/A
Return Value Array of IDs containing body/face assignments for this mesh operation.
GetOperationNames
Gets the names of mesh operations defined in a design.
UI Access N/A
ReassignOp
Reassigns a mesh operation
[
"Faces:=", [16]
])
oModule.ReassignOp("Length1",
[
"Objects:=", ["Box1"]
])
RenameOp
Renames a mesh operation.
UI Access Right-click the mesh operation in the project tree, and then click Rename on the shortcut menu.
EditSkinDepthOp
EditTrueSurfOp
"InitialMeshSettings " on page 15-50
AssignApplyCurvilinearElementsOp
Applies a curvilinear elements mesh operation to the selection.
UI Access HFSS > Mesh > Assign Mesh Operation > On Selection > Apply Curvlinear Meshing...
AssignCloneOp
Uses the mesh data from a user-specified parent region to apply identical meshes to its cloned regions
UI Access Maxwell 2D > Mesh > Assign Mesh Operation > Clone Mesh...
oModule.AssignCloneOp _
Array("NAME:Clone1", _
"Enabled:=", true, _
"InnerRadius:=", "55mm", _
"OuterRadius:=", "175mm", _
VB Example
"StartAngle:=", "0deg", _
"EndAngle:=", "15deg", _
"GapAngle:=", "0deg", _
"NumberofClones:=", "6", _
"ParentRegionSymmetry:=", true)
AssignCurvatureExtractionOp (Beta)
Assigns a curvature extraction operation to the selection for a faceted SBR+ object or face.
UI Access HFSS > Mesh > Assign Mesh Operation > SBR+ Curvature Extraction for Faceted Surfaces...
AssignCylindricalGapOp
3D Designs
For 3D designs, assigns a cylindrical gap 3D mesh operation to enable use of Clone Mesh and associated Band Mapping Angle.
=======
Assigns a cylindrical gap 3D mesh operation to enable use of Clone Mesh and associated Band Mapping Angle.
UI Access HFSS > Mesh > Assign Mesh Operation > Cylindrical Gap Treatment
])
AssignDensityControlOp
Assigns a density control mesh operation to specify refinement of clone mesh.
UI Access HFSS > Mesh > Assign Mesh Operation > Inside Selection > Clone Mesh Density
oModule.AssignDensityControlOp _
Array("NAME:Clone Mesh Density3", _
"RefineInside:=", true, _
"Objects:=", Array("Inner_arm"), _
VB Example
"RestrictMaxElemLength:=", true, _
"MaxElemLength:=", "0.015mm", _
"RestrictLayersNum:=", true, _
"LayersNum:=", "15")
AssignEdgeCutLayerOp
Assigns the edge cut mesh operation to specify refinement of layer mesh.
UI Access HFSS > Mesh > Assign Mesh Operation > Inside Selection > Edge Cut Based
Parameters Array("NAME:<OpName>",
"Objects:=", <AssignmentObjects>,
"Layer Thickness:=", <value>)
AssignLengthOp
Assigns length-based operations to the selection.
UI Access HFSS > Mesh > Assign Mesh Operation > On Selection | Inside Selection > Length Based
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>,
"RestrictElem:=", <bool>
"NumMaxElem:=", <integer>
"RestrictLength:=", <bool>
"MaxLength:=", <value>)
RefineInside
If true, Objects should be specified. Implies apply restrictions to tet-
rahedra inside the object.
If false, Faces and/or Objects can be specified. Implies apply restric-
tions to triangles on the surface of the face or object.
RestrictElem
If true, NumMaxElem should be specified.
RestrictLength
If true, MaxLength should be specified.
"NAME:Length1",
"RefineInside:=", True,
"Objects:=", ["Box1"],
"RestrictElem:=", True,
"NumMaxElem:=", 1000,
"RestrictLength:=", True,
"MaxLength:=", "1mm"
])
AssignMeshRegion
Assigns a mesh region to selection.
"Enabled:=", true, _
"Objects:=", Array("Polyline1"))
AssignModelResolutionOp
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.
UI Access HFSS > Mesh > Assign Mesh Operation > Model Resolution
"DefeatureLength:=", "71.5891053163818mil"
])
AssignRotationalLayerOp
Assigns a rotational layer mesh operation.
Right-click to open the context menu, and select Assign Mesh Operation > Inside Selection > Rotational
UI Access
Layer Mesh.
AssignSkinDepthLayerSetting
Use: Assigns a skin-depth layer settings to the selected edges.
Command: Click Mesh > Assign Mesh Operation > On Selection > Skin Depth Based
Syntax: AssignSkinDepthLayerSetting Array("NAME:<LayerSettingName>", "Enabled:=", <SettingEnabled>, "Edges:=", Array
(<EdgeIDArray>), "SkinDepth:=", "<SkinDepthValue>", "NumLayers:=", "<LayerNumber>")
Return Value: None
Parameters: <LayerSettingName>
The name of the skin depth layer setting.
<SettingEnabled>
Boolean: "Enabled:=", true
<EdgeIDArray>
Array of edge IDs. "Edges:=", Array(10, 12, 13)
<SkinDepthValue>
Skin depth value with unit. "SkinDepth:=", "1mm"
<LayerNumber>
Integer, the number of layers. "NumLayers:=", "2"
Example: oModule.AssignSkinDepthLayerSetting Array("NAME:SkinDepthLayer1",
"Enabled:=", true
"Edges:=", Array(10, 12, 13),
"SkinDepth:=", "1mm",
"NumLayers:=", 2)
AssignSkinDepthOp
Assigns a skin-depth based operations to the selection.
UI Access HFSS > Mesh > Assign Mesh Operation > On Selection > Skin Depth Based
"Faces:=", [7],
"RestrictElem:=", True,
"NumMaxElem:=", 1000,
"SkinDepth:=", "1mm",
"SurfTriMaxLength:=", "1mm",
"NumLayers:=", 2
])
AssignSurfPriorityForTauOp
Sets the mesh operation surface representation priority for TAU mesh.
UI Access Right-click to open the context menu, and select Assign Mesh Operation > Surface Priority for TAU....
"Faces:=", Array(15), _
"SurfaceRepPriority:=", 1)
AssignTrueSurfOp
Assigns a true surface-based mesh operation on the selection.
UI Access HFSS > Mesh > Assign Mesh Operation > Surface Approximation
<RadioOption>
Type: <int>
0: Ignore
1: Use defaults
"NormalDevChoice:=", 2, _
"NormalDev:=", "15deg", _
"AspectRatioChoice:=", 1)
EditApplyCurvilinearElementsOp
Edits a curvilinear elements mesh operation to the selection.
"Apply:=", False
]
)
EditCloneOp
Modifies an existing clone mesh operation.
"EndAngle:=", "<value><unit>",
"GapAngle:=", "<value angular spacing between
clones><unit>",
"NumberofClones:=", "<integer number of periodic
regions (including the parent)>",
"ParentRegionSymmetry:=", <boolean>)
])
EditCurvatureExtractionOp (Beta)
Edits a curvature extraction operation.
"DisableForFacetedSurfaces:=", <bool>)
EditCylindricalGapOp
Modifies an existing cylindrical gap 3D mesh operation to enable/disable use of Clone Mesh and associated Band Mapping Angle.
UI Access Double-click the operation in the project tree to modify its settings.
oModule.EditCylindricalGapOp "CylindricalGap1", _
Array("NAME:CylindricalGap1", _
"CloneMesh:=", true, _
VB Example
"BandMappingAngle:=", 3deg, _
"MovingSideLayers:=", 1, _
"StaticSideLayers:=", 3)
EditDensityControlOp
Edits an existing density control operation. This cannot be used to modify assignments. Instead, the mesh operation should be deleted
and a new one created.
UI Access Double-click the operation in the project tree to modify its settings.
EditEdgeCutLayerOp
Edits an existing edge cut operation. This cannot be used to modify assignments. Instead, the mesh operation should be deleted and
a new one created.
UI Access Double-click the operation in the project tree to modify its settings.
EditLengthOp
Edits an existing length-based operation. This cannot be used to modify assignments. Instead, the mesh operation should be deleted
and a new one created.
UI Access Double-click the operation in the project tree to modify its settings.
"NumMaxElem:=", <integer>,
"RestrictLength:=", <bool>,
"MaxLength:=", <value>)
RefineInside
If true, Objects should be specified. Implies apply restrictions to tet-
rahedra 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
If true, MaxLength should be specified.
"RestrictLength:=", True,
"MaxLength:=", "2mm"
])
EditMeshRegion
Modifies an existing mesh region settings.
UI Access Right-click on a mesh region in the project tree, then select Properties...
EditModelResolutionOp
Assigns a model resolution name, value and unit for mesh operations. If UseAutoLength is true, the Defeature length is not used.
UI Access Double-click the operation in the project tree to modify its settings.
"DefeatureLength:=", "<value><units>")
EditRotationalLayerOp
Modifies a existing rotational layer mesh operation.
UI Access Right-click on a rotational layer mesh in the project tree, then select Properties...
EditSBRCurvatureExtractionOp (Beta)
Edits a curvature extraction operation to the selection for an SBR+ object or face.
Command: Edit Propeties
Syntax: EditSBRCurvatureExtractionOp <CurvilinearElementsOpParams>
Return Value: None
Parameters: <CurvilinearnElementsOpParams>
Array("NAME:<OpName>",
"Faces:=", <AssignmentFaces>, | "Objects:=", Array("objectID")
"Apply:=", <bool>)
VB Example:
oModule.EditSBRApplyCurvlinearElementsOp Array("NAME:ApplyCurvilinear1", "Objects:=", Array( "Sphere1"), "Apply:=", true)
EditSkinDepthOp
Modifies an existing skin-depth based mesh operation. Assignments cannot be changed using this command. To change the assign-
ment, you must delete operation and create it using a new assignment.
UI Access Double-click the operation in the project tree to modify its settings.
"NAME:SkinD",
"RestrictElem:=", False,
"SkinDepth:=", "2mm",
"SurfTriMaxLength:=", "1mm",
"NumLayers:=", 2
])
EditSurfPriorityOp
Modifies an existing surface representation priority for TAU mesh.
UI Access Right-click on a surface priority in the project tree, then select Properties...
Array("NAME:<SurfPriorityName>",
"SurfaceRepPriority:=", <0 - normal priority, 1 - high
priority>)
EditTrueSurfOp
Modifies an existing true surface approximation-based mesh operation. Assignments cannot be changed using this command. To
change the assignment, delete this operation and create it using a new assignment.
UI Access Double-click the operation in the project tree to modify its settings.
<RadioOption>
Type: <int>
0: Ignore
1: Use defaults
2: Specify the value
[
"NAME:trusurf",
"SurfDevChoice:=", 2,
"SurfDev:=","0.03mm",
"NormalDevChoice:=", 1,
"AspectRatioChoice:=", 2,
"AspectRatio:=", 10
])
InitialMeshSettings
Assigns a true surface-based mesh operation to the selection.
"NAME:GlobalSurfApproximation",
"CurvedSurfaceApproxChoice:=", "UseSlider",
"SliderMeshSettings:=" , 5
],
[
"NAME:GlobalCurvilinear",
"Apply:=" , False
],
[
"NAME:GlobalModelRes",
"UseAutoLength:=" , True
],
"MeshMethod:=" , "Auto",
"UseLegacyFaceterForTAUVolumeMesh:=", False,
"DynamicSurfaceResolution:=", False,
"UseFlexMeshingForTAUvolumeMesh:=", False,
"UseAlternativeMeshMethodsAsFallBack:=", False,
"AllowPhiForLayeredGeometry:=", True
])
RenameDrivenSweep
RenameSetup
RevertAllToInitial
RevertAllToInitialTemperature
RevertSetupToInitial
RevertSetupToInitialTemperature
ClearLinkedData (Module)
Clear the linked data of all the solution setups. Similar to the ClearLinkedData command for the design level.
Right-click menu of individual setups under the Analysis item.
UI Access Project Manager > Design name > Analysis > right-click Setup name > Clear Linked Data
CopySetup
Copy the specified Optimetrics setup.
UI Access NA
CopyDrivenSetup
Copies a driven setup.
UI Access N/A
CopyEigenSetup
Copies an eigen-analysis setup.
UI Access N/A
CopySweep
Copies a frequency sweep from an analysis setup.
DeleteDrivenSweep
Deletes a driven frequency sweep.
UI Access N/A
DeleteSetups
Deletes one or more solution setups, which are specified by an array of solution setup names.
Right-click a solution setup in the project tree and then click Delete on the shortcut menu, or delete selected solu-
UI Access
tion setups in the List dialog box.
DoesSweepSetupExists
Determines whether a specified sweep exists.
UI Access N/A
Integer:
EditCircuitSettings
Use: Exports equivalent circuit data.
Command: Right-click the Analysis folder, and then choose Edit Circuit Settings.
Syntax: EditCircuitSettings <ExportSettings>
Return Value: None
Parameters: <ExportSettings>
See ExportCircuit for details.
VB Example: oModule.EditCircuitSettings Array("NAME:CircuitData", "MatrixName:=", "Original", _
"NumberOfCells:=", "1", "UserHasChangedSettings:=", true, "IncludeCap:=", true, "IncludeCond:=",
_
true, Array("NAME:CouplingLimits", "CouplingLimitType:=", "By Fraction", "CapFraction:=", 0.01, _
"IndFraction:=", 0.01, "ResFraction:=", 0.01, "CondFraction:=", 0.01), "IncludeDCR:=", false, _
"IncudeDCL:=", false, "IncludeACR:=", false, "IncludeACL:=", false, "ADDResistance:=", true)
EditDrivenSweep
Modifies a driven frequency sweep.
UI Access N/A.
"SetupType:=", "SinglePoints",
"ValueList:=", ["1GHz", "2GHz", "3GHz"],
"Type:=", "Discrete",
"SaveFieldsList:=", [False, False, False],
"ExtrapToDC:=", False])
EditFrequencySweep
Modifies an existing frequency sweep. For HFSS-IE use EditSweep [HFSS-IE]
UI Access Double-click a frequency sweep in the Project Manager to modify its settings.
EditSetup
Modifies an existing solution setup.
UI Access Double-click a solution setup in the project tree to modify its settings.
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30),
["NAME:Mult",
"MaxPass:=", 1,
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30]],
["NAME:AC",
"MaxPass:=", 10,
"MinPass:=", 1,
"MinConvPass:=", 2,
"PerError:=", 1,
"PerRefine:=", 30]]
)
oModule.InsertSetup("HfssDrivenAuto",
["NAME:Setup1",
"IsEnabled:=", True,
"AutoSolverSetting:=", "Balanced",
["NAME:Sweeps",
["NAME:Sweep",
"RangeType:=", "LinearStep",
"RangeStart:=", "1GHz",
"RangeEnd:=", "10GHz",
"RangeStep:=", "1GHz"
]
],
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"Type:=", "Discrete"
])
oModule.InsertSetup("HfssDrivenAuto",
[
"NAME:Setup2",
"SolveType:=" , "Auto",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"AutoSolverSetting:=" , "Balanced",
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearCount",
"RangeStart:=" , "0GHz",
"RangeEnd:=" , "10GHz",
"RangeCount:=" , 501
]
],
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"ListsForFields:=" , ["Objectlist2"],
"Type:=" , "Interpolating"
])
oModule.InsertSetup("HfssDriven",
["NAME:Setup3",
"AdaptMultipleFreqs:=", False,
"Frequency:=", "5GHz",
"MaxDeltaS:=", 0.02,
"PortsOnly:=", False,
"UseMatrixConv:=", False,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", True,
"BasisOrder:=", 1,
"DoLambdaRefine:=", True,
"DoMaterialLambda:=", True,
"SetLambdaTarget:=", False,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", False,
"PortAccuracy:=", 2,
"UseABCOnPort:=", False,
"SetPortMinMaxTri:=", False,
"UseDomains:=", True,
"UseIterativeSolver:=", False,
"IterativeResidual:=", 1E-06,
"DDMSolverResidual:=", 0.0001,
"EnhancedLowFreqAccuracy:=", True,
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"IESolverType:=", "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"SkipIERegionSolveDuringAdaptivePasses:=", True
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"SkipSBRSolveDuringAdaptivePasses:=", True,
"PTDUTDSimulationSettings:=", "PTD Correction + UTD Rays",
"PTDEdgeDensity:=" , 20
])
### Edit an SBR+ Setup with Fast Frequency Looping
oModule.EditSetup("HfssDriven",
[
"NAME:Setup1",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"IsSbrRangeDoppler:=" , False,
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"IsMonostaticRCS:=" , True,
"EnableCWRays:=" , False,
"RadiationSetup:=" , "",
"PTDUTDSimulationSettings:=", "None",
"FastFrequencyLooping:=", True,
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True
"UseSBREnhancedRadiatedPowerCalculation:=", True,
"IsGOBlockageEnabled:=" , False,
"GOBlockageSurfaceSelfBlock:=", False
])
#### Edit and RF Discharge Setup for HFSS
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oProject = oDesktop.SetActiveProject("coaxbend_discharge_r212")
oDesign = oProject.SetActiveDesign("HFSSDesign60degBendTeflon")
oModule = oDesign.GetModule("AnalysisSetup")
oModule.EditSetup("RFDischarge1",
[
"NAME:RFDischarge1",
"Enabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "HFSS",
"Design:=" , "This Design*",
"Soln:=" , "Setup1 : Sweep",
[
"NAME:Params",
"bend_angle:=" , "bend_angle"
],
"ForceSourceToSolve:=" , True,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "SourceProduct",
"ApplyMeshOp:=" , True
],
[
"NAME:Excitations",
[
"NAME:1:1",
"Magnitude:=" , "1",
"Phase:=" , "0deg"
],
[
"NAME:2:1",
"Magnitude:=" , "0",
"Phase:=" , "0deg"
]
],
[
"NAME:Frequencies",
"10GHz"
],
"Minimum Power:=" , "0.01",
"Maximum Power:=" , "1000000",
"Minimum Pressure:=" , "100pascal",
"Maximum Pressure:=" , "101325pascal",
"Postproc Sampling:=" , 500,
"Temperature:=" , "0cel",
"BuiltInGas:=" , "Helium"
])
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30),
Array("NAME:Mult",
"MaxPass:=", 1,
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30)),
Array("NAME:AC",
"MaxPass:=", 10,
"MinPass:=", 1,
"MinConvPass:=", 2,
"PerError:=", 1,
"PerRefine:=", 30))
ExportCircuit
Use:Export equivalent circuit data.
Command:Right-click a setup in the project tree or the Analysis folder and choose Export Circuit.
Syntax:ExportCircuit <Solution>, <Variation>, <FileName>, <ExportSettings>, <ModelName>, <Freq>
Return Value: none
Parameters: <Solution>
<SetupName>:<SolutionName>
<SetupName>
Type: <string>
Name of the setup where circuit is being exported
<SolutionName>
Type: <String>
Name of the solution.
<Variation>
Type: <string>
The variation where circuit is being exported
<FileName>
Type: <string>
The name of the file where circuit is being exported
<ModelName>
Type: <String>
Model name or name of the sub circuit (Optional). If not specified then <FileName> is con-
sidered as model name.
<Freq>
Type: <double>
Sweep frequecny in hz.
<ExportSettings>
Array("NAME:CircuitData", "MatrixName:=", _
<ReduceMatrix>, "NumberOfCells:=", <NumCell>, "UserHasChangedSettings:=", <User-
ChangedSettings>, "IncludeCap:=", <IncludeCap>, "IncludeCond:=", <IncludeCond>, Array
("NAME:CouplingLimits", <CouplingLimitsArray>, "IncludeDCR:=", <IncludeDCR>, "IncludeDCL:=",
<IncludeDCL>, "IncludeACR:=", <IncludeACR>, "IncludeACL:=", <IncludeACL>, "ADDResistance:=",
<AddResistance>)
Parameters:
<ReduceMatrix>
Type: <string>
One of the reduced matrix setup or "Original"
<NumCell>
Type: <string>
Number of cells in export. Can be a variable.
<UserChangedSettings>
Type: <bool>
Whether user changed settings or use default settings.
<IncludeCap>
Type: <bool>
Flag indicates whether to export Capacitance matrix.
<IncludeCond>
Type: <bool>
Flag indicates whether to export Conductance matrix.
<IncludeDCR>
Type: <bool>
Flag indicates whether to export DC resistance matrix.
<IncludeDCL>
Type: <bool>
Flag indicates whether to export DC Inductance matrix.
<IncludeACR>
Type: <bool>
Flag indicates whether to export AC resistance matrix.
<IncludeACL>
Type: <bool>
Flag indicates whether to export AC inductance matrix.
<AddResistance>
Type: <bool>
Adds the DC and AC resistance.
Note:
<CouplingLimitsArray>
Array("NAME:CouplingLimits", "CouplingLimitType:=", <CouplingLimitType>, _
<CouplingLimitsParameters>, 0.01, "CondFraction:=", 0.01)
<CouplingLimitType> = "None"
Argument not needed
<CouplingLimitType> = "ByFraction"
<CouplingLimitsParameters>
"CapFraction:=", <Fraction>, "IndFraction:=", <Fraction>,
"ResFraction:=", <Fraction>,"CondFraction:=",<Fraction>,
Parameters:
<Fraction>
Type: <double>
Fraction of the self term
<CouplingLimitType> = "ByValue"
<CouplingLimitsParameters>
"CapLimit:=", <Limit>, "IndLimit:=", <Limit>, "ResLimit:=", <Limit>,
"CondLimit:=", <Limit>,
Parameters:
<Limit>
Type: <string>
Value of the limit.
VB Example:
oModule.ExportCircuit
"Setup1 : LastAdaptive", "", "C:/Project/Q3D/FourNets.cir", Array("NAME:CircuitData", _
"MatrixName:=", "Original", "NumberOfCells:=", "1", "UserHasChangedSettings:=", true, _
"IncludeCap:=", true, "IncludeCond:=", true, Array("NAME:CouplingLimits", "CouplingLimitType:=",
_
"By Fraction", "CapFraction:=", 0.01, "IndFraction:=", 0.01, "ResFraction:=", 0.01, _
"CondFraction:=", 0.01), "IncludeDCR:=", false, IncudeDCL:=", false, "IncludeACR:=", false, _
"IncludeACL:=", false, "ADDResistance:=", true), "", 2000000000000
GetSetupCount
Gets the number of analysis setups in a design.
UI Access N/A
Parameters None.
Return Value Integer containing number of setups.
VB Syntax GetSetupCount
VB Example oModule.GetSetupCount
GetSetups
Gets the names of analysis setups in a design.
UI Access N/A
Parameters None.
Return Value Array of analysis setup names
VB Syntax GetSetups
VB Example oModule.GetSetups
GetSetupNames
Gets the names of far field and near field radiation setups in a design.
UI Access N/A
GetSweepCount
Gets the number of sweeps in a specified analysis setup.
UI Access N/A
Return Value Integer containing number of sweeps for the named setup.
GetSweeps
Gets the names of all sweeps in a given analysis setup.
UI Access N/A
InsertDrivenSweep
Adds a frequency sweep to a Driven solution-type setup.
UI Access N/A.
<LinearStepArray>
"RangeStart:=", "<real>GHz",
"RangeEnd:=", "<real>GHz",
"RangeStep:=", "<real>GHz",
<LinearCountArray>
"RangeStart:=", "<real>GHz",
"RangeEnd:=", "<real>GHz",
"RangeCount:=", <int>,
<LogScaleArray>
RangeStart:=", "<real>GHz",
"RangeEnd:=", "<real>GHz",
"RangeCount:=", <int>,
"RangeSamples:=", <int>,
<SweepTypeArray>
"Type:=", <"Interpolating" |"Fast" | "Discrete">,
<InterpolatingParametersArray>
"SaveFields:=", <boolean>,
"SaveRadFields:=", <boolean>,
"InterpTolerance:=", <real>,
"InterpMaxSolns:=", <int>,
"InterpMinSolns:=", <int>,
"InterpMinSubranges:=", <int>,
"ExtrapToDC:=", <boolean>,
"InterpUseS:=", <boolean>,
"InterpUsePortImped:=", <boolean>,
"InterpUsePropConst:=", <boolean>,
"UseDerivativeConvergence:=", true,
"InterpDerivTolerance:=", <real>,
"UseFullBasis:=", <boolean>,
"EnforcePassivity:=", <boolean>,
"PassivityErrorTolerance:=", <real>)
"EnforceCausality:=", <boolean>,
"UseQ3DForDCSolve:=" , <boolean>,
"SMatrixOnlySolveMode:=", <"Manual">|"Auto">,
"SMatrixOnlySolveAbove:=", "<real><units>"
<FastParametersArray>
"SaveFields:=", <boolean>,
"SaveRadFields:=", <boolean>,
"GenerateFieldsForAllFreqs:=", <boolean>,
"ExtrapToDC:=", <boolean>)
<DiscreteParametersArray>
"SaveFields:=", <boolean>,
SaveRadFields:=", <boolean>,
"ExtrapToDC:=", <boolean>)
"InterpMinSolns:=" , 0,
"InterpMinSubranges:=" , 1,
"InterpUseS:=" , True,
"InterpUsePortImped:=" , False,
"InterpUsePropConst:=" , True,
"UseDerivativeConvergence:=", False,
"InterpDerivTolerance:=", 0.2,
"UseFullBasis:=" , True,
"EnforcePassivity:=" , True,
"PassivityErrorTolerance:=", 0.0001,
"SMatrixOnlySolveMode:=", "Manual",
"SMatrixOnlySolveAbove:=", "1MHz"
])
"SaveFields:=", false,
"SaveRadFields:=", false,
"ExtrapToDC:=", false)
Fast Sweep:
oModule.InsertDrivenSweep "Setup1",
Array("NAME:Sweep2", "IsEnabled:=", false,
"RangeType:=", "LinearStep",
"RangeStart:=", "1GHz",
"RangeEnd:=", "10GHz",
"RangeStep:=", "0.1GHz",
"Type:=", "Fast",
"SaveFields:=", true,
"SaveRadFields:=", false,
"GenerateFieldsForAllFreqs:=", false,
"ExtrapToDC:=", false)
Interpolating Sweep with additional setups:
oModule.InsertDrivenSweep "Setup1", Array("NAME:Sweep3", _
"IsEnabled:=", true, "SetupType:=", _
"LinearStep", "StartValue:=", "0GHz", _
"StopValue:=", "2.5GHz", "StepSize:=", "0.005GHz", _
"Type:=", "Interpolating", _
"SaveFields:=", false, _
"InterpTolerance:=", 0.5, _
"InterpMaxSolns:=", 50, "InterpMinSolns:=", 0, _
"InterpMinSubranges:=", 1, _
InsertFrequencySweep
Adds a frequency sweep to a Driven solution-type setup.
"RangeStart:=", "<real>GHz",
"RangeEnd:=", "<real>GHz",
"RangeCount:=", <int>,
<LogScaleArray>
RangeStart:=", "<real>GHz",
"RangeEnd:=", "<real>GHz",
"RangeCount:=", <int>,
"RangeSamples:=", <int>,
<SweepTypeArray>
"Type:=", <"Interpolating" |"Fast" | "Discrete">,
<InterpolatingParametersArray>
"SaveFields:=", <boolean>,
"SaveRadFields:=", <boolean>,
"InterpTolerance:=", <real>,
"InterpMaxSolns:=", <int>,
"InterpMinSolns:=", <int>,
"InterpMinSubranges:=", <int>,
"ExtrapToDC:=", <boolean>,
"InterpUseS:=", <boolean>,
"InterpUsePortImped:=", <boolean>,
"InterpUsePropConst:=", <boolean>,
"UseDerivativeConvergence:=", true,
"InterpDerivTolerance:=", <real>,
"UseFullBasis:=", <boolean>,
"EnforcePassivity:=", <boolean>,
"PassivityErrorTolerance:=", <real>)
"EnforceCausality:=", <boolean>,
"UseQ3DForDCSolve:=" , <boolean>,
"SMatrixOnlySolveMode:=", <"Manual">|"Auto">,
"SMatrixOnlySolveAbove:=", "<real><units>"
<FastParametersArray>
"SaveFields:=", <boolean>,
"SaveRadFields:=", <boolean>,
"GenerateFieldsForAllFreqs:=", <boolean>,
"ExtrapToDC:=", <boolean>)
<DiscreteParametersArray>
"SaveFields:=", <boolean>,
SaveRadFields:=", <boolean>,
"ExtrapToDC:=", <boolean>)
"UseFullBasis:=" , True,
"EnforcePassivity:=" , True,
"PassivityErrorTolerance:=", 0.0001,
"SMatrixOnlySolveMode:=", "Manual",
"SMatrixOnlySolveAbove:=", "1MHz"
])
"RangeEnd:=", "10GHz",
"RangeStep:=", "0.1GHz",
"Type:=", "Fast",
"SaveFields:=", true,
"SaveRadFields:=", false,
"GenerateFieldsForAllFreqs:=", false,
"ExtrapToDC:=", false)
Interpolating Sweep with additional setups:
oModule.InsertFrequencySweep "Setup1", Array("NAME:Sweep3", _
"IsEnabled:=", true, "SetupType:=", _
"LinearStep", "StartValue:=", "0GHz", _
"StopValue:=", "2.5GHz", "StepSize:=", "0.005GHz", _
"Type:=", "Interpolating", _
"SaveFields:=", false, _
"InterpTolerance:=", 0.5, _
"InterpMaxSolns:=", 50, "InterpMinSolns:=", 0, _
"InterpMinSubranges:=", 1, _
"ExtrapToDC:=", true, "MinSolvedFreq:=", "0.005GHz", _
"InterpUseS:=", true, _
"InterpUseT:=", false, "InterpUsePortImped:=", false, _
"InterpUsePropConst:=", true, "UseFullBasis:=", true) _
Array( "SetupType:=", "LogScale", "StartValue:=", "11GHz", "StopValue:=", _
"12GHz", "Count:=", 91, _
"SetupType:=", "LinearCount", "StartValue:=", "13GHz", _
InsertSetup
Adds a new solution setup.
"PortAccuracy:=", <integer>,
SaveRadFieldsOnly:=", <boolean>,
"SaveAnyFields:=", <boolean>,
"ListsForFields:=", <array of string>,
"IESolverType:=", <string>,
"LambdaTargetForIESolver:=", <float>,
"UseDefaultLambdaTgtForIESolver:=", <boolean>
oModule.InsertSetup("HfssDrivenAuto",
["NAME:Setup1",
"IsEnabled:=", True,
"AutoSolverSetting:=", "Balanced",
["NAME:Sweeps",
Python
["NAME:Sweep",
Example
"RangeType:=", "LinearStep",
"RangeStart:=", "1GHz",
"RangeEnd:=", "10GHz",
"RangeStep:=", "1GHz"
]
],
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"Type:=", "Discrete"
])
oModule.InsertSetup("HfssDrivenAuto",
[
"NAME:Setup2",
"SolveType:=" , "Auto",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"AutoSolverSetting:=" , "Balanced",
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearCount",
"RangeStart:=" , "0GHz",
"RangeEnd:=" , "10GHz",
"RangeCount:=" , 501
]
],
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"ListsForFields:=" , ["Objectlist2"],
"Type:=" , "Interpolating"
])
oModule.InsertSetup("HfssDriven",
["NAME:Setup3",
"AdaptMultipleFreqs:=", False,
"Frequency:=", "5GHz",
"MaxDeltaS:=", 0.02,
"PortsOnly:=", False,
"UseMatrixConv:=", False,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", True,
"BasisOrder:=", 1,
"DoLambdaRefine:=", True,
"DoMaterialLambda:=", True,
"SetLambdaTarget:=", False,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", False,
"PortAccuracy:=", 2,
"UseABCOnPort:=", False,
"SetPortMinMaxTri:=", False,
"UseDomains:=", True,
"UseIterativeSolver:=", False,
"IterativeResidual:=", 1E-06,
"DDMSolverResidual:=", 0.0001,
"EnhancedLowFreqAccuracy:=", True,
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"IESolverType:=", "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"SkipIERegionSolveDuringAdaptivePasses:=", True
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"SkipSBRSolveDuringAdaptivePasses:=", True,
"PTDUTDSimulationSettings:=", "PTD Correction + UTD Rays",
"PTDEdgeDensity:=" , 20
])
"NAME:Setup1",
"SolveType:=" , "Single",
"Frequency:=" , "5GHz",
"MaxDeltaE:=" , 0.1,
"MaximumPasses:=" , 6,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"DrivenSolverType:=" , "Direct Solver",
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"RadiationSetup:=" , "Infinite Sphere1",
"PTDUTDSimulationSettings:=", "None",
"EnableSBRSelfCoupling:=", False,
"UseSBRAdvOptionsGOBlockage:=", False,
"UseSBRAdvOptionsWedges:=", False,
"SkipSBRSolveDuringAdaptivePasses:=", False,
"UseSBREnhancedRadiatedPowerCalculation:=", True
])
"NAME:Setup1",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"IsSbrRangeDoppler:=" , False,
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"IsMonostaticRCS:=" , True,
"EnableCWRays:=" , False,
"RadiationSetup:=" , "",
"PTDUTDSimulationSettings:=", "None",
"FastFrequencyLooping:=", True,
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True
])
"PTDUTDSimulationSettings:=", "None",
"FastFrequencyLooping:=", False,
"UseSBRAdvOptionsGOBlockage:=", False,
"UseSBRAdvOptionsWedges:=", False,
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True,
"UseSBREnhancedRadiatedPowerCalculation:=", True,
"IsGOBlockageEnabled:=" , False,
"GOBlockageSurfaceSelfBlock:=", False
])
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oProject = oDesktop.SetActiveProject("coaxbend_discharge_r212")
oDesign = oProject.SetActiveDesign("HFSSDesign60degBendTeflon")
oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup("HfssRFDischarge",
[
"NAME:RFDischarge1",
"Enabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "HFSS",
"Design:=" , "This Design*",
"Soln:=" , "Setup1 : Sweep",
[
"NAME:Params",
"bend_angle:=" , "bend_angle"
],
"ForceSourceToSolve:=" , False,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "SourceProduct",
"ApplyMeshOp:=" , True
],
[
"NAME:Excitations",
[
"NAME:1:1",
"Magnitude:=" , "1",
"Phase:=" , "0deg"
],
[
"NAME:2:1",
"Magnitude:=" , "0",
"Phase:=" , "0deg"
]
],
[
"NAME:Frequencies",
"10GHz"
],
"Minimum Power:=" , "0.01",
"Maximum Power:=" , "1000000",
"Minimum Pressure:=" , "100pascal",
"Maximum Pressure:=" , "101325pascal",
"Postproc Sampling:=" , 500,
"Temperature:=" , "0cel",
"BuiltInGas:=" , "Argon"
])
#### Setup with UseMatrixConv is True and Matrix Convergence Entry Specified as All
###
oModule.InsertSetup("Setup1",
[
"NAME:Setup1",
"SolveType:=" , "Single",
"Frequency:=" , "10GHz",
"MaxDeltaS:=" , 0.02,
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
"AllEntries:=" , True,
"MagLimit:=" , "0.01",
"PhaseLimit:=" , "2deg",
"MagMinThreshold:=" , 0.01
],
"MaximumPasses:=" , 12,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
"DrivenSolverType:=" , "Direct Solver",
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"IESolverType:=" , "ACA",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"InfiniteSphereSetup:=" , ""
])
### Setup with UseMatrixConv as Entries and MeshLink
oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup("Setup1",
[
"NAME:Setup1",
"SolveType:=" , "Single",
"Frequency:=" , "10GHz",
"MaxDeltaS:=" , 0.02,
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "A[1,1]P1",
"Port2:=" , "A[1,1]P1",
"MagLimit:=" , "0.011",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "A[4,4]P2",
"Port2:=" , "A[1,1]P2",
"MagLimit:=" , "0.041",
"PhaseLimit:=" , "5deg"
]
]
],
"MaximumPasses:=" , 1,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "",
"Design:=" , "unit",
"Soln:=" , "Setup1 : LastAdaptive",
[
"NAME:Params",
"Airbox_dist:=" , "9.9931mm",
"Scan_Theta:=" , "0deg",
"Scan_phi:=" , "0deg",
"VirtualObject_dist:=" , "2.9979mm",
"coax_inner_rad:=" , "0.125mm",
"coax_outer_rad:=" , "0.425mm",
"cut_off:=" , "1.7mm",
"feedX:=" , "-0.4mm",
"feedY:=" , "2mm",
"feed_length:=" , "1mm",
"patchX:=" , "9.65mm",
"rot:=" , "45deg",
"subH:=" , "0.8mm",
"subX:=" , "15mm",
"subY:=" , "15mm"
],
"ForceSourceToSolve:=" , False,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "TargetProject",
"ApplyMeshOp:=" , True,
"AdaptPort:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , False,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
"DrivenSolverType:=" , "Domain Decomposition",
"IterativeResidual:=" , 0.0001,
"DDMSolverResidual:=" , 0.0001,
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"InfiniteSphereSetup:=" , ""
])
### Example from design with UseMatrixConv True for AllDiagEntries
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
"AllDiagEntries:=" , True,
"DiagonalMag:=" , "0.03",
"DiagonalPhase:=" , "4rad",
"MagMinThreshold:=" , 0.01,
"AllOffDiagEntries:=" , True,
"OffDiagonalMag:=" , "0.05",
"OffDiagonalPhase:=" , "6deg",
"MagMinThreshold:=" , 0.01
],
### Example from Modal design with UseMatrixConv True for Entries
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "Port1",
"Port2:=" , "Port1",
"MagLimit:=" , "0.02",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "Port3",
"Port2:=" , "Port2",
"MagLimit:=" , "0.03",
"PhaseLimit:=" , "5deg"
]
]
],
#### Example from Design with Periodic Ports and UseMaxtrixConv is True
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "Incident_Port1",
"Port2:=" , "Incident_Port1",
"MagLimit:=" , "0.11",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "Incident_Port2",
"Port2:=" , "Incident_Port2",
"MagLimit:=" , "0.22",
"PhaseLimit:=" , "5deg"
]
]
],
#### Example Terminal Design with UseMatrixConv = True and Expression Cache
oProject = oDesktop.SetActiveProject("term-2x2_1_parasolid")
oDesign = oProject.SetActiveDesign("unit")
oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup("Setup1",
[
"NAME:Setup1",
"SolveType:=" , "Single",
"Frequency:=" , "10GHz",
"MaxDeltaS:=" , 0.02,
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "P2",
"Port2:=" , "P1",
"MagLimit:=" , "0.05",
"PhaseLimit:=" , "10deg"
]
]
],
"MaximumPasses:=" , 15,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
"DrivenSolverType:=" , "Iterative Solver",
"IterativeResidual:=" , 0.0001,
"DDMSolverResidual:=" , 0.0001,
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
[
"NAME:ExpressionCache",
[
"NAME:CacheItem",
"Title:=" , "dB_AxialRatioValue_1",
"Expression:=" , "dB(AxialRatioValue)",
"Intrinsics:=" , "Phi=\'0deg\' Theta=\'0deg\'",
"ReportType:=" , "Far Fields",
[
"NAME:ExpressionContext",
"Context:=" , "Infinite Sphere1"
]
],
[
"NAME:CacheItem",
"Title:=" , "dB_St_Diff1_Diff1__1",
"Expression:=" , "dB(St(Diff1,Diff1))",
"Intrinsics:=" , "",
"ReportType:=" , "Terminal Solution Data",
[
"NAME:ExpressionContext",
"Diff:=" , "Differential Pairs"
]
],
[
"NAME:CacheItem",
"Title:=" , "dB_St_P1_P1__1",
"Expression:=" , "dB(St(P1,P1))",
"Intrinsics:=" , "",
"ReportType:=" , "Terminal Solution Data",
[
"NAME:ExpressionContext",
"Diff:=" , "Terminals"
]
]
],
"CacheSaveKind:=" , "Delta",
"ConstantDelta:=" , "0s",
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", true,
Array("NAME:MeshLink",
"Project:=", "Tee.aedt",
"Design:=", "TeeModel",
"Soln:=", "Setup1 : LastAdaptive",
Array("NAME:Params", "offset:=", "0in"),
"ForceSourceToSolve:=", false,
"PreservePartnerSoln:=", false,
"PathRelativeTo:=", "SourceProduct",
"ApplyMeshOp:=", true),
"BasisOrder:=", 1,
"UseIterativeSolver:=", false,
"DoLambdaRefine:=", false,
"DoMaterialLambda:=", true,
"SetLambdaTarget:=", false,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", false,
"MaxTetIncrease:=", 1000000,
"EnableSolverDomains:=", false,
"ThermalFeedback:=", false,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
A Driven solution type with ports:
oModule.InsertSetup "HfssDriven",
Array("NAME:Setup2",
"Frequency:=", "1GHz",
"PortsOnly:=", false,
"MaxDeltaS:=", 0.02,
"UseMatrixConv:=", false,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", true,
"BasisOrder:=", 1,
"UseIterativeSolver:=", true,
"IterativeResidual:=", 0.0001,
"DoLambdaRefine:=", true,
"DoMaterialLambda:=", false,
"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)
An Eigenmode solution type:
oModule.InsertSetup "HfssEigen",
Array("NAME:Setup2",
"MinimumFrequency:=", "1.77347GHz",
"NumModes:=", 1,
"MaxDeltaFreq:=", 10,
"ConvergeOnRealFreq:=", true,
"MaximumPasses:=", 3,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", true,
"BasisOrder:=", 1,
"UseIterativeSolver:=", false,
"DoLambdaRefine:=", true,
"DoMaterialLambda:=", true,
"SetLambdaTarget:=", false,
"Target:=", 0.2,
"UseMaxTetIncrease:=", false,
"MaxTetIncrease:=", 1000000,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
A Driven solution type with ports and matrix convergence:
oModule.InsertSetup "HfssDriven",
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)
A Driven solution type with Multi-Frequencies specified:
oModule.InsertSetup "HfssDriven", Array("NAME:Setup2", "AdaptMultipleFreqs:=", true, _
Array("NAME:MultipleAdaptiveFreqsSetup", "1.1GHz:=", Array( _
0.02), "10GHz:=", Array(0.02), "11GHz:=", Array(0.02), "12.5GHz:=", Array(0.02),
"15GHz:=", Array( _
0.02), "20GHz:=", Array(0.02)), "MaximumPasses:=", 6, "MinimumPasses:=", 1, "Min-
imumConvergedPasses:=", _
1, "PercentRefinement:=", 30, "IsEnabled:=", true, "BasisOrder:=", 1,
"DoLambdaRefine:=", _
true, "DoMaterialLambda:=", true, "SetLambdaTarget:=", false, "Target:=", _
0.3333, "UseMaxTetIncrease:=", false, "PortAccuracy:=", 2, "UseABCOnPort:=", _
false, "SetPortMinMaxTri:=", false, "UseDomains:=", false, "UseIterativeSolver:=", _
false, "SaveRadFieldsOnly:=", false, "SaveAnyFields:=", true, "IESolverType:=", _
"Auto", "LambdaTargetForIESolver:=", 0.15, "UseDefaultLambdaTgtForIESolver:=", _
true, "RayDensityPerWavelength:=", 4, "MaxNumberOfBounces:=", 5)
0.0001)
InsertSetup [Transient]
Add a new solution setup to a Transient design
Command: HFSS>Analysis Setup>Add Solution Setup
Syntax: InsertSetup <SetupType>, <AttributesArray>
Return Value: None
Parameters: <SetupType>
Type: <string>
"HfssTransient". Must match the HFSS solution type.
<AttributesArray>
Array("NAME:<SetupName>", <Named Parameters>)
<Named Parameters>
The parameters correspond to fields in the Setup dialog box. For example, here is default dialog for an HFSS Transient
driven Composite Excitation setup with one excitation assigned. To see the required parameters for a specific set of para-
meters and their format, use the record script function, and view the resulting script in a text editor.
The first part of a vbs script corresponds to the fields and selections on the General tab:
Set oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup "HfssTransient", Array("NAME:Setup1", "Frequency:=", "5GHz", "MaxDeltaE:=",
0.1, _"MaximumPasses:=", 6, "UseImplicitSolver:=", true, "IsEnabled:=", true,
The next parameters correspond to fields and selections on the Saved Fields tab:
You must create one or more face lists and select them to enable the ability to Save fields at specified intervals.
The next part corresponds to fields on the Duration tab.
The vbs script for this setup includes parameters for this information.
Array("NAME:Transient", "TimeProfile:=", "Broadband Pulse", "HfssFrequency:=", "5GHz", _
"MinFreq:=", "100MHz", "MaxFreq:=", "1GHz", _
"NumFreqsExtracted:=", 401, _
"SweepMinFreq:=", "100MHz", "SweepMaxFreq:=", "1GHz",
To see the parameters for a specific Setup and their format, use the record script function, and view the resulting script in a
text editor. For descriptions of the parameters, see the Online help for the setup. See the examples below.
VB Example: Transient Solution Type
Set oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup "HfssTransient", _
Array("NAME:Setup1", _
"Frequency:=", "1GHz", _
"MaxDeltaE:=", 0.1, _
"MaximumPasses:=", 20, _
"IsEnabled:=", true, _
"BasisOrder:=", -1, _
"NoAdditionalRefinementOnImport:=", true, _
Array("NAME:Transient", _
"UseAutoTermination:=", 1, _
"SteadyStateCriteria:=", 0.001, _
"UseMinimumDuration:=", 0, _
"TerminateOnMaximum:=", 1, _
"UseMaxTime:=", 1, _
"MaxTime:=", "20000ps"))
"UseMinimumDuration:=" , 0,
"TerminateOnMaximum:=" , 0
]
])
PasteDrivenSetup
Pastes a driven setup.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax PasteDrivenSetup
VB Example oModule.PasteDrivenSetup
PasteEigenSetup
Pastes an eigen-analysis setup.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax PasteEigenSetup
VB Example oModule.PasteEigenSetup
PasteSetup
Use: Paste a solve setup.
Syntax: PasteSetup
Return Value: None
VB Example: oModule.PasteSetup
PasteSweep
Pastes a copied sweep.
RenameDrivenSweep
Renames an existing frequency sweep in HFSS. For HFSS-IE use RenameSweep.
UI Access Right-click a frequency sweep in the Project Manager and then click Rename on the shortcut menu.
RenameSetup
Renames an existing solution setup.
UI Access Right-click a solution setup in the Project Manager and then click Rename on the shortcut menu.
ResetToTimeZero
Resets a simulation to time zero.
RevertAllToInitial
Marks the current mesh for all solution setups as invalid. This will force the next simulation to begin with the initial mesh.
VB Syntax RevertAllToInitial
VB Example oModule.RevertAllToInitial
RevertAllToInitialTemperature
Reverts all setups to their initial temperature. Used when coupling with thermal designs.
HFSS > Set Object Temperature > Enable Feedback. Then in the Project Manager, right-click Analysis
UI Access
> Revert to Initial Temperature. Repeat for all setups.
Parameters None.
Return Value None.
VB Syntax RevertAllToInitialTemperature
VB Example oModule.RevertAllToInitialTemperature
RevertAllToZeroDisplacement
Reverts the displacement values of all objects to zero.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax RevertAllToZeroDisplacement
VB Example oModule.RevertAllToZeroDisplacement
RevertSetupToInitial
Marks the current mesh for a solution setup as invalid. This will force the next simulation to begin with the initial mesh.
UI Access Right-click a solution setup in the Project Manager and then click Rename on the shortcut menu.
RevertSetupToInitialTemperature
Reverts a specified setup to its initial temperature. Used when coupling with thermal designs.
HFSS > Set Object Temperature > Enable Feedback. Then in the Project Manager, right-click Analysis
UI Access
> Revert to Initial Temperature.
RevertSetupToZeroDisplacement
Reverts the displacement values of objects for a specified setup to zero.
UI Access N/A
SetMPIVendor
The documented command is applicable for Q3D Extractor.
Use: Specify vendor name.
Syntax: SetMPIVendor <vendorname>, <product name>
Return Value: None
Parameters: <vendorname>
Type: <String>
Name of MPI vendor. Possible values are "Intel", "PlatformComputing"
<product name>
Type: <String>
Valid value is "Q3D Extractor". It is optional input, if not specified the default value is
"Q3D Extractor"
oAnsoftApp.SetMPIVendor "Intel", "Q3D Extractor"
SolveSetup
Solves the specified setup.
UI Access Right-click the setup in the project tree, and then click Analyze on the shortcut menu.
16-100
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Type: <bool>
If true, the embedded parametric setup will be solved before the
analysis begins.
If false, the embedded parametric setup will be solved during each
iteration of the analysis.
<Constraint>
Array("NAME:LCS",
"lc:=", Array("<VarName>:=",
<Coeff>, …"<VarName>:=", <Coeff>, "rel:=", <Cond>, "rhs:=", <Rhs>), ...
"lc:=", Array("<VarName>:=", <Coeff>, ..."
<VarName>:=", <Coeff>, "rel:=", <Cond>, "rhs:=",
<Rhs>))
<Coeff>
Type: <double>
Coefficient for a variable in the linear constraint.
<Cond>
Type: <string>
Inequality condition.
<Rhs>
Type: <double>
Inequality value.
<OptiGoalSpec>
"Solution:=", <Soln>, "Calculation:=", <Calc>,
"Context:=, <Geometry>
Array("NAME:Ranges",
"Range:", Array("Var:=",
<VarName>, "Type:=", <RangeType>, "Start:=",
<StartV>, "Stop:=", <StopV>), ...
"Range:", Array("Var:=", <VarName>, "Type:=",
<RangeType>, "Start:=", <StartV>, "Stop:=",
<StopV>))
<Soln>
Type: <string>
Name of the solution.
<Calc>
Type: <string>
An expression that is composed of a basic solution quantity and an
output variable.
<ContextName>
Type: <string>
Name of context needed in the evaluation of <Calc>.
<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.
if "s", start values specify the single value for the variable.
EditSetup
EditSetup [Optimization]
EditSetup [Sensitivity]
EditSetup [Statistical]
GetPropNames [Optimetrics]
GetPropValue [Optimetrics]
GetSetupNames [Optimetrics]
GetSetupNamesByType [Optimetrics]
InsertSetup [Parametric]
InsertSetup [Optimization]
InsertSetup [Sensitivity]
InsertSetup [Statistical]
PasteSetup [Optimetrics]
RenameSetup [Optimetrics]
SetPropValue [Optimetrics]
SolveSetup [Optimetrics]
The topics for this section include:
General Commands Recognized by the Optimetrics Module
Parametric Script Commands
Optimization Script Commands
Sensitivity Script Commands
Statistical Script Commands
CopySetup
Copy the specified Optimetrics setup.
UI Access NA
DeleteSetups [Optimetrics]
Deletes the specified Optimetrics setups.
UI Access Right-click the setup in the project tree, and then click Delete on the shortcut menu
DistributedAnalyzeSetup
Distributes all variable value instances within a parametric sweep to different machines already specified from within the user inter-
face
UI Access Right-click the parametric setup name in the project tree and select Distribute Analysis.
EditSetup
Modifies an existing solution setup.
UI Access Double-click a solution setup in the project tree to modify its settings.
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30),
["NAME:Mult",
"MaxPass:=", 1,
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30]],
["NAME:AC",
"MaxPass:=", 10,
"MinPass:=", 1,
"MinConvPass:=", 2,
"PerError:=", 1,
"PerRefine:=", 30]]
)
oModule.InsertSetup("HfssDrivenAuto",
["NAME:Setup1",
"IsEnabled:=", True,
"AutoSolverSetting:=", "Balanced",
["NAME:Sweeps",
["NAME:Sweep",
"RangeType:=", "LinearStep",
"RangeStart:=", "1GHz",
"RangeEnd:=", "10GHz",
"RangeStep:=", "1GHz"
]
],
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"Type:=", "Discrete"
])
oModule.InsertSetup("HfssDrivenAuto",
[
"NAME:Setup2",
"SolveType:=" , "Auto",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"AutoSolverSetting:=" , "Balanced",
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearCount",
"RangeStart:=" , "0GHz",
"RangeEnd:=" , "10GHz",
"RangeCount:=" , 501
]
],
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"ListsForFields:=" , ["Objectlist2"],
"Type:=" , "Interpolating"
])
oModule.InsertSetup("HfssDriven",
["NAME:Setup3",
"AdaptMultipleFreqs:=", False,
"Frequency:=", "5GHz",
"MaxDeltaS:=", 0.02,
"PortsOnly:=", False,
"UseMatrixConv:=", False,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", True,
"BasisOrder:=", 1,
"DoLambdaRefine:=", True,
"DoMaterialLambda:=", True,
"SetLambdaTarget:=", False,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", False,
"PortAccuracy:=", 2,
"UseABCOnPort:=", False,
"SetPortMinMaxTri:=", False,
"UseDomains:=", True,
"UseIterativeSolver:=", False,
"IterativeResidual:=", 1E-06,
"DDMSolverResidual:=", 0.0001,
"EnhancedLowFreqAccuracy:=", True,
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"IESolverType:=", "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"SkipIERegionSolveDuringAdaptivePasses:=", True
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"SkipSBRSolveDuringAdaptivePasses:=", True,
"PTDUTDSimulationSettings:=", "PTD Correction + UTD Rays",
"PTDEdgeDensity:=" , 20
])
### Edit an SBR+ Setup with Fast Frequency Looping
oModule.EditSetup("HfssDriven",
[
"NAME:Setup1",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"IsSbrRangeDoppler:=" , False,
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"IsMonostaticRCS:=" , True,
"EnableCWRays:=" , False,
"RadiationSetup:=" , "",
"PTDUTDSimulationSettings:=", "None",
"FastFrequencyLooping:=", True,
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True
"UseSBREnhancedRadiatedPowerCalculation:=", True,
"IsGOBlockageEnabled:=" , False,
"GOBlockageSurfaceSelfBlock:=", False
])
#### Edit and RF Discharge Setup for HFSS
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oProject = oDesktop.SetActiveProject("coaxbend_discharge_r212")
oDesign = oProject.SetActiveDesign("HFSSDesign60degBendTeflon")
oModule = oDesign.GetModule("AnalysisSetup")
oModule.EditSetup("RFDischarge1",
[
"NAME:RFDischarge1",
"Enabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "HFSS",
"Design:=" , "This Design*",
"Soln:=" , "Setup1 : Sweep",
[
"NAME:Params",
"bend_angle:=" , "bend_angle"
],
"ForceSourceToSolve:=" , True,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "SourceProduct",
"ApplyMeshOp:=" , True
],
[
"NAME:Excitations",
[
"NAME:1:1",
"Magnitude:=" , "1",
"Phase:=" , "0deg"
],
[
"NAME:2:1",
"Magnitude:=" , "0",
"Phase:=" , "0deg"
]
],
[
"NAME:Frequencies",
"10GHz"
],
"Minimum Power:=" , "0.01",
"Maximum Power:=" , "1000000",
"Minimum Pressure:=" , "100pascal",
"Maximum Pressure:=" , "101325pascal",
"Postproc Sampling:=" , 500,
"Temperature:=" , "0cel",
"BuiltInGas:=" , "Helium"
])
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30),
Array("NAME:Mult",
"MaxPass:=", 1,
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30)),
Array("NAME:AC",
"MaxPass:=", 10,
"MinPass:=", 1,
"MinConvPass:=", 2,
"PerError:=", 1,
"PerRefine:=", 30))
EnableSetup
Enables and disables a defined optimetrics analysis setup.
UI Access Right-click on a setup in the project tree, select Enable Setup or Disable Setup
ExportDXConfigFile
Create an xml file with the setup information for Design Xplorer
Right click on the Design Xplorer setup in the project tree and choose Export External Connector Addin Con-
UI Access
figuration…
ExportOptimetricsProfile
Export Optimetrics profile data
Right click on the Optimetrics setup in the project tree and choose View Analysis Result… On the Post Ana-
UI Access
lysis Display dialog box, click the Profile tab and click on the Export button.
ExportOptimetricsResult
Export an existing Optimization, Sensitivity, Statistical or DesignXplorer result. (Does not export Parametric results.)
Right click on the desired Optimetrics setup in the project tree and choose View Analysis Result… On the
UI Access
Post Analysis Display dialog box, click the Result tab, then select Table view, and click on the Export button
ExportParametricResults
Export existing Parametric results.
Right click on the desired Parametric setup in the project tree and choose View Analysis Result… On the Post
UI Access
Analysis Display dialog box, click the Result tab, then select Table view, and click on the Export button.
ExportParametricSetupTable
Exports the parametric setup table as a CSV file.
oModule.ExportParametricSetupTable('ParametricSetup1', 'E:/Files/ParametricSetup1_
Python
Table.csv')
Example
ExportRespSurfaceMinMaxTable
Exports min-max table from a response surface to a file
Click on Export... From the Response Surface tab of the Design of Experiments Post Analysis Display dia-
UI Access
log.
ExportRespSurfaceRefinePoints
Exports refinement points table to a file
From the Response Surface tab of the Design of Experiments Post Analysis Display dialog box, select
UI Access
Refinement Points option under View, Click on Export....
ExportRespSurfaceResponsePoints
Exports response points table to a file
From the Response Surface tab of the Design of Experiments Post Analysis Display dialog box, select
UI Access
Response Points option under View, Click on Export....
ExportRespSurfaceVerificationPoints
Exports verification points table to a file
From the Response Surface tab of the Design of Experiments Post Analysis Display dialog box, select Veri-
UI Access
fication Points option under View, Click on Export....
GenerateVariationData [Parametric]
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 the setup.
VB Example:
oModule.GenerateVariationData "ParametricSetup1"
GetChildNames [Optimetrics]
If used without a specific optimization setup name, gets a list of all setups for all types. If a with a specific setup name, returns names
for that optimization setup.
UI Access NA
GetChildObject [Optimetrics]
Gets a Setup Object of the Optimetrics module
UI Access NA
A script object for the setup See discussion of Optimetrics Setup Objects in Object Script Property Function Sum-
Return Value mary.
GetChildTypes [Optimetrics]
Use: Gets child types of queried Optimetrics module.
Syntax: GetChildTypes()
Return Value: Array of text string, it can be an empty array if there is no setup is defined. There are six types of setup, they are
['OptiParametric', 'OptiOptimization', 'OptiSensitivity', 'OptiStatistical', 'OptiDesignExplorer', 'OptiDXDOE'].
GetName
Returns the name of the active design.
UI Access N/A
Parameters None.
Return Value String indicating the name of the active design.
VB Syntax GetName
VB Example design_name = oDesign.GetName
GetObjPath [Design]
Obtains the path to the design.
UI Access N/A
Parameters None.
Return Value String containing the path to the design.
VB Syntax GetObjPath
VB Example oDesign.GetObjPath
GetOptimetricResult
Returns an Optimetric calculation. The specific calculation is determined by the setup.
UI Access N/A
Return Value Calculation result. If the setup contains more than one calculation, the output will be an array of values.
GetOptimetricsResult
Get an existing Optimization, Sensitivity, Statistical, Parametric or DesignXplorer result.
Right click on the desired Optimetrics setup in the project tree and choose View Analysis Result… On the Post
UI Access
Analysis Display dialog box, click the Result tab, then select Table view, and click on the Export button
GetPropNames [Optimetrics]
Use: Always returns the empty set for Optimetrics objects since they do not have properties.
Syntax: GetPropNames(bIncludeReadOnly)
Return Value: Returns empty set.
Parameters: bIncludeReadOnly—optional, default to True.
GetPropValue [Optimetrics]
Returns the property value for a setup property.
UI Access NA
VB Syntax GetPropValue()
GetPropValue(“Optimetrics/OptimizationSetup1/Enabled”)
VB Example
Returns True if Enabled, or False if disabled.
GetSetupNames [Optimetrics]
Gets a list of Optimetrics setup names
UI Access NA
VB Syntax GetSetupNames()
Set oModule_opt = oDesign.GetModule("Optimetrics")
VB Example Set opt_setup_list = oModule.GetSetupNames()
numsetups = setupnames.Count
GetSetupNamesByType [Optimetrics]
Gets a list of Optimetrics setup names by type.
UI Access NA
ImportSetup
Import an Optimetric setup from a file.
UI Access NA
"c:/importdir/mySetupInfoFile")
InsertSetup
Adds a new solution setup.
"SaveAnyFields:=", <boolean>,
"ListsForFields:=", <array of string>,
"IESolverType:=", <string>,
"LambdaTargetForIESolver:=", <float>,
"UseDefaultLambdaTgtForIESolver:=", <boolean>
oModule.InsertSetup("HfssDrivenAuto",
["NAME:Setup1",
"IsEnabled:=", True,
"AutoSolverSetting:=", "Balanced",
["NAME:Sweeps",
["NAME:Sweep",
Python
"RangeType:=", "LinearStep",
Example
"RangeStart:=", "1GHz",
"RangeEnd:=", "10GHz",
"RangeStep:=", "1GHz"
]
],
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"Type:=", "Discrete"
])
oModule.InsertSetup("HfssDrivenAuto",
[
"NAME:Setup2",
"SolveType:=" , "Auto",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"AutoSolverSetting:=" , "Balanced",
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearCount",
"RangeStart:=" , "0GHz",
"RangeEnd:=" , "10GHz",
"RangeCount:=" , 501
]
],
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"ListsForFields:=" , ["Objectlist2"],
"Type:=" , "Interpolating"
])
oModule.InsertSetup("HfssDriven",
["NAME:Setup3",
"AdaptMultipleFreqs:=", False,
"Frequency:=", "5GHz",
"MaxDeltaS:=", 0.02,
"PortsOnly:=", False,
"UseMatrixConv:=", False,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", True,
"BasisOrder:=", 1,
"DoLambdaRefine:=", True,
"DoMaterialLambda:=", True,
"SetLambdaTarget:=", False,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", False,
"PortAccuracy:=", 2,
"UseABCOnPort:=", False,
"SetPortMinMaxTri:=", False,
"UseDomains:=", True,
"UseIterativeSolver:=", False,
"IterativeResidual:=", 1E-06,
"DDMSolverResidual:=", 0.0001,
"EnhancedLowFreqAccuracy:=", True,
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"IESolverType:=", "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"SkipIERegionSolveDuringAdaptivePasses:=", True
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"SkipSBRSolveDuringAdaptivePasses:=", True,
"PTDUTDSimulationSettings:=", "PTD Correction + UTD Rays",
"PTDEdgeDensity:=" , 20
])
"MaxDeltaE:=" , 0.1,
"MaximumPasses:=" , 6,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"DrivenSolverType:=" , "Direct Solver",
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"RadiationSetup:=" , "Infinite Sphere1",
"PTDUTDSimulationSettings:=", "None",
"EnableSBRSelfCoupling:=", False,
"UseSBRAdvOptionsGOBlockage:=", False,
"UseSBRAdvOptionsWedges:=", False,
"SkipSBRSolveDuringAdaptivePasses:=", False,
"UseSBREnhancedRadiatedPowerCalculation:=", True
])
"NAME:MeshLink",
"ImportMesh:=" , False
],
"IsSbrRangeDoppler:=" , False,
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"IsMonostaticRCS:=" , True,
"EnableCWRays:=" , False,
"RadiationSetup:=" , "",
"PTDUTDSimulationSettings:=", "None",
"FastFrequencyLooping:=", True,
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True
])
"UseSBRAdvOptionsWedges:=", False,
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True,
"UseSBREnhancedRadiatedPowerCalculation:=", True,
"IsGOBlockageEnabled:=" , False,
"GOBlockageSurfaceSelfBlock:=", False
])
oDesktop.RestoreWindow()
oProject = oDesktop.SetActiveProject("coaxbend_discharge_r212")
oDesign = oProject.SetActiveDesign("HFSSDesign60degBendTeflon")
oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup("HfssRFDischarge",
[
"NAME:RFDischarge1",
"Enabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "HFSS",
"Design:=" , "This Design*",
"Soln:=" , "Setup1 : Sweep",
[
"NAME:Params",
"bend_angle:=" , "bend_angle"
],
"ForceSourceToSolve:=" , False,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "SourceProduct",
"ApplyMeshOp:=" , True
],
[
"NAME:Excitations",
[
"NAME:1:1",
"Magnitude:=" , "1",
"Phase:=" , "0deg"
],
[
"NAME:2:1",
"Magnitude:=" , "0",
"Phase:=" , "0deg"
]
],
[
"NAME:Frequencies",
"10GHz"
],
"MagMinThreshold:=" , 0.01
],
"MaximumPasses:=" , 12,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "A[1,1]P1",
"Port2:=" , "A[1,1]P1",
"MagLimit:=" , "0.011",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "A[4,4]P2",
"Port2:=" , "A[1,1]P2",
"MagLimit:=" , "0.041",
"PhaseLimit:=" , "5deg"
]
]
],
"MaximumPasses:=" , 1,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "",
"Design:=" , "unit",
"Soln:=" , "Setup1 : LastAdaptive",
[
"NAME:Params",
"Airbox_dist:=" , "9.9931mm",
"Scan_Theta:=" , "0deg",
"Scan_phi:=" , "0deg",
"VirtualObject_dist:=" , "2.9979mm",
"coax_inner_rad:=" , "0.125mm",
"coax_outer_rad:=" , "0.425mm",
"cut_off:=" , "1.7mm",
"feedX:=" , "-0.4mm",
"feedY:=" , "2mm",
"feed_length:=" , "1mm",
"patchX:=" , "9.65mm",
"rot:=" , "45deg",
"subH:=" , "0.8mm",
"subX:=" , "15mm",
"subY:=" , "15mm"
],
"ForceSourceToSolve:=" , False,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "TargetProject",
"ApplyMeshOp:=" , True,
"AdaptPort:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , False,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
"DrivenSolverType:=" , "Domain Decomposition",
"IterativeResidual:=" , 0.0001,
"DDMSolverResidual:=" , 0.0001,
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"InfiniteSphereSetup:=" , ""
])
### Example from design with UseMatrixConv True for AllDiagEntries
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
"AllDiagEntries:=" , True,
"DiagonalMag:=" , "0.03",
"DiagonalPhase:=" , "4rad",
"MagMinThreshold:=" , 0.01,
"AllOffDiagEntries:=" , True,
"OffDiagonalMag:=" , "0.05",
"OffDiagonalPhase:=" , "6deg",
"MagMinThreshold:=" , 0.01
],
### Example from Modal design with UseMatrixConv True for Entries
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "Port1",
"Port2:=" , "Port1",
"MagLimit:=" , "0.02",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "Port3",
"Port2:=" , "Port2",
"MagLimit:=" , "0.03",
"PhaseLimit:=" , "5deg"
]
]
],
#### Example from Design with Periodic Ports and UseMaxtrixConv is True
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "Incident_Port1",
"Port2:=" , "Incident_Port1",
"MagLimit:=" , "0.11",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "Incident_Port2",
"Port2:=" , "Incident_Port2",
"MagLimit:=" , "0.22",
"PhaseLimit:=" , "5deg"
]
]
],
#### Example Terminal Design with UseMatrixConv = True and Expression Cache
oProject = oDesktop.SetActiveProject("term-2x2_1_parasolid")
oDesign = oProject.SetActiveDesign("unit")
oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup("Setup1",
[
"NAME:Setup1",
"SolveType:=" , "Single",
"Frequency:=" , "10GHz",
"MaxDeltaS:=" , 0.02,
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "P2",
"Port2:=" , "P1",
"MagLimit:=" , "0.05",
"PhaseLimit:=" , "10deg"
]
]
],
"MaximumPasses:=" , 15,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
"DrivenSolverType:=" , "Iterative Solver",
"IterativeResidual:=" , 0.0001,
"DDMSolverResidual:=" , 0.0001,
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
[
"NAME:ExpressionCache",
[
"NAME:CacheItem",
"Title:=" , "dB_AxialRatioValue_1",
"Expression:=" , "dB(AxialRatioValue)",
"Intrinsics:=" , "Phi=\'0deg\' Theta=\'0deg\'",
"ReportType:=" , "Far Fields",
[
"NAME:ExpressionContext",
"Context:=" , "Infinite Sphere1"
]
],
[
"NAME:CacheItem",
"Title:=" , "dB_St_Diff1_Diff1__1",
"Expression:=" , "dB(St(Diff1,Diff1))",
"Intrinsics:=" , "",
"ReportType:=" , "Terminal Solution Data",
[
"NAME:ExpressionContext",
"Diff:=" , "Differential Pairs"
]
],
[
"NAME:CacheItem",
"Title:=" , "dB_St_P1_P1__1",
"Expression:=" , "dB(St(P1,P1))",
"Intrinsics:=" , "",
"ReportType:=" , "Terminal Solution Data",
[
"NAME:ExpressionContext",
"Diff:=" , "Terminals"
]
]
],
"CacheSaveKind:=" , "Delta",
"ConstantDelta:=" , "0s",
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"InfiniteSphereSetup:=" , ""
])
"Design:=", "TeeModel",
"Soln:=", "Setup1 : LastAdaptive",
Array("NAME:Params", "offset:=", "0in"),
"ForceSourceToSolve:=", false,
"PreservePartnerSoln:=", false,
"PathRelativeTo:=", "SourceProduct",
"ApplyMeshOp:=", true),
"BasisOrder:=", 1,
"UseIterativeSolver:=", false,
"DoLambdaRefine:=", false,
"DoMaterialLambda:=", true,
"SetLambdaTarget:=", false,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", false,
"MaxTetIncrease:=", 1000000,
"EnableSolverDomains:=", false,
"ThermalFeedback:=", false,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
"PortAccuracy:=", 2,
"UseABCOnPort:=", true,
"SetPortMinMaxTri:=", false,
"EnableSolverDomains:=", false,
"ThermalFeedback:=", false,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
An Eigenmode solution type:
oModule.InsertSetup "HfssEigen",
Array("NAME:Setup2",
"MinimumFrequency:=", "1.77347GHz",
"NumModes:=", 1,
"MaxDeltaFreq:=", 10,
"ConvergeOnRealFreq:=", true,
"MaximumPasses:=", 3,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", true,
"BasisOrder:=", 1,
"UseIterativeSolver:=", false,
"DoLambdaRefine:=", true,
"DoMaterialLambda:=", true,
"SetLambdaTarget:=", false,
"Target:=", 0.2,
"UseMaxTetIncrease:=", false,
"MaxTetIncrease:=", 1000000,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
A Driven solution type with ports and matrix convergence:
oModule.InsertSetup "HfssDriven",
Array("NAME:Setup2",
"Frequency:=", "1GHz",
"PortsOnly:=", false,
"MaxDeltaS:=", 0.02,
"UseMatrixConv:=", true,
Array("NAME:ConvergenceMatrix",
"AllDiagEntries:=", true,
"MagMinThreshold:=", 0.01,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
A Driven solution type with Multi-Frequencies specified:
oModule.InsertSetup "HfssDriven", Array("NAME:Setup2", "AdaptMultipleFreqs:=", true, _
Array("NAME:MultipleAdaptiveFreqsSetup", "1.1GHz:=", Array( _
0.02), "10GHz:=", Array(0.02), "11GHz:=", Array(0.02), "12.5GHz:=", Array(0.02),
"15GHz:=", Array( _
0.02), "20GHz:=", Array(0.02)), "MaximumPasses:=", 6, "MinimumPasses:=", 1, "Min-
imumConvergedPasses:=", _
1, "PercentRefinement:=", 30, "IsEnabled:=", true, "BasisOrder:=", 1,
"DoLambdaRefine:=", _
true, "DoMaterialLambda:=", true, "SetLambdaTarget:=", false, "Target:=", _
0.3333, "UseMaxTetIncrease:=", false, "PortAccuracy:=", 2, "UseABCOnPort:=", _
false, "SetPortMinMaxTri:=", false, "UseDomains:=", false, "UseIterativeSolver:=", _
false, "SaveRadFieldsOnly:=", false, "SaveAnyFields:=", true, "IESolverType:=", _
"Auto", "LambdaTargetForIESolver:=", 0.15, "UseDefaultLambdaTgtForIESolver:=", _
true, "RayDensityPerWavelength:=", 4, "MaxNumberOfBounces:=", 5)
An Driven Solution type with Broadband specified:
oModule.InsertSetup "HfssDriven", Array("NAME:Setup1", "AdaptMultipleFreqs:=", true, _
Array("NAME:MultipleAdaptiveFreqsSetup", Array("NAME:Broadband", "Low:=", _
"2GHz", "High:=", "20GHz")), "MaximumPasses:=", 6, "MinimumPasses:=", 1, "Min-
imumConvergedPasses:=", _
1, "PercentRefinement:=", 30, "IsEnabled:=", true, "BasisOrder:=", 1,
"DoLambdaRefine:=", _
true, "DoMaterialLambda:=", true, "SetLambdaTarget:=", false, "Target:=", _
0.3333, "UseMaxTetIncrease:=", false, "PortAccuracy:=", 2, "UseABCOnPort:=", _
false, "SetPortMinMaxTri:=", false, "UseDomains:=", false, "UseIterativeSolver:=", _
false, "SaveRadFieldsOnly:=", false, "SaveAnyFields:=", true, "IESolverType:=", _
"Auto", "LambdaTargetForIESolver:=", 0.15, "UseDefaultLambdaTgtForIESolver:=", _
true, "RayDensityPerWavelength:=", 4, "MaxNumberOfBounces:=", 5)
oModule.InsertFrequencySweep "Setup1", Array("NAME:Sweep", "IsEnabled:=", true,
"RangeType:=", _
"LinearCount", "RangeStart:=", "2GHz", "RangeEnd:=", "20GHz", "RangeCount:=", _
451, "Type:=", "Interpolating", "SaveFields:=", false, "SaveRadFields:=", _
false, "InterpTolerance:=", 0.5, "InterpMaxSolns:=", 250, "InterpMinSolns:=", _
0, "InterpMinSubranges:=", 1, "ExtrapToDC:=", false, "InterpUseS:=", true, "Inter-
pUsePortImped:=", _
false, "InterpUsePropConst:=", true, "UseDerivativeConvergence:=", false, "Inter-
pDerivTolerance:=", _
0.2, "UseFullBasis:=", true, "EnforcePassivity:=", true, "PassivityErrorTolerance:=",
_
0.0001)
PasteSetup [Optimetrics]
Pastes the specified Optimetrics setup.
UI Access NA
RenameSetup [Optimetrics]
Renames the specified Optimetrics setup.
UI Access Right-click the setup in the project tree, and then click Rename on the shortcut menu.
SetPropValue [Optimetrics]
Sets the property value for the active Optimetrics setup.
Return Value True if the property is found and the new value is valid. Otherwise return False.
SolveAllSetup
Solves all Optimetrics setups
UI Access Right-click on Optimetrics in Project Manager and select Analyze>All from context menu
VB Syntax SolveAllSetup
VB Example oModule.SolveAllSetup
SolveSetup [Optimetrics]
Solves the specified Optimetrics setup.
UI Access Right-click the setup in the project tree, and then click Analyze on the shortcut menu.
ValidateSetup [Parametric]
Performs a validation of all design variations in a parametric setup.
For information on reviewing the output produced by this script command, see: Validating a Parametric Setup
Under Optimetrics in the Project Manager, right-click the <Parametric Setup Name> and then click Validate
UI Access
Parametric Setup on the shortcut menu.
ImportSetup
PasteSetup [Optimetrics]
RenameSetup [Optimetrics]
SetPropValue [Optimetrics]
SolveSetup [Optimetrics]
SolveAllSetup
CopySetup
Copy the specified Optimetrics setup.
UI Access NA
DeleteSetups [Optimetrics]
Deletes the specified Optimetrics setups.
UI Access Right-click the setup in the project tree, and then click Delete on the shortcut menu
DistributedAnalyzeSetup
Distributes all variable value instances within a parametric sweep to different machines already specified from within the user inter-
face
UI Access Right-click the parametric setup name in the project tree and select Distribute Analysis.
EditSetup
Modifies an existing solution setup.
UI Access Double-click a solution setup in the project tree to modify its settings.
oModule.EditSetup("Setup1",
["NAME:NewSetup",
"AdaptiveFreq:=", "1GHz",
"EnableDistribProbTypeOption:=", false,
"SaveFields:=", "true",
"Enabled:=", true,
["NAME:Cap",
"MaxPass:=", 10,
"MinPass:=", 1,
"MinConvPass:=", 2,
Python Example "PerError:=", 1,
"PerRefine:=", 30,
"AutoIncreaseSolutionOrder:=", false,
"SolutionOrder:=", "Normal"],
["NAME:DC",
"Residual:=", 1E-005,
"SolveResOnly:=", false,
["NAME:Cond",
"MaxPass:=", 10,
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30),
["NAME:Mult",
"MaxPass:=", 1,
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30]],
["NAME:AC",
"MaxPass:=", 10,
"MinPass:=", 1,
"MinConvPass:=", 2,
"PerError:=", 1,
"PerRefine:=", 30]]
)
oModule.InsertSetup("HfssDrivenAuto",
["NAME:Setup1",
"IsEnabled:=", True,
"AutoSolverSetting:=", "Balanced",
["NAME:Sweeps",
["NAME:Sweep",
"RangeType:=", "LinearStep",
"RangeStart:=", "1GHz",
"RangeEnd:=", "10GHz",
"RangeStep:=", "1GHz"
]
],
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"Type:=", "Discrete"
])
oModule.InsertSetup("HfssDrivenAuto",
[
"NAME:Setup2",
"SolveType:=" , "Auto",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"AutoSolverSetting:=" , "Balanced",
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearCount",
"RangeStart:=" , "0GHz",
"RangeEnd:=" , "10GHz",
"RangeCount:=" , 501
]
],
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"ListsForFields:=" , ["Objectlist2"],
"Type:=" , "Interpolating"
])
oModule.InsertSetup("HfssDriven",
["NAME:Setup3",
"AdaptMultipleFreqs:=", False,
"Frequency:=", "5GHz",
"MaxDeltaS:=", 0.02,
"PortsOnly:=", False,
"UseMatrixConv:=", False,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", True,
"BasisOrder:=", 1,
"DoLambdaRefine:=", True,
"DoMaterialLambda:=", True,
"SetLambdaTarget:=", False,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", False,
"PortAccuracy:=", 2,
"UseABCOnPort:=", False,
"SetPortMinMaxTri:=", False,
"UseDomains:=", True,
"UseIterativeSolver:=", False,
"IterativeResidual:=", 1E-06,
"DDMSolverResidual:=", 0.0001,
"EnhancedLowFreqAccuracy:=", True,
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"IESolverType:=", "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"SkipIERegionSolveDuringAdaptivePasses:=", True
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"SkipSBRSolveDuringAdaptivePasses:=", True,
"PTDUTDSimulationSettings:=", "PTD Correction + UTD Rays",
"PTDEdgeDensity:=" , 20
])
### Edit an SBR+ Setup with Fast Frequency Looping
oModule.EditSetup("HfssDriven",
[
"NAME:Setup1",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"IsSbrRangeDoppler:=" , False,
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"IsMonostaticRCS:=" , True,
"EnableCWRays:=" , False,
"RadiationSetup:=" , "",
"PTDUTDSimulationSettings:=", "None",
"FastFrequencyLooping:=", True,
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True
"UseSBREnhancedRadiatedPowerCalculation:=", True,
"IsGOBlockageEnabled:=" , False,
"GOBlockageSurfaceSelfBlock:=", False
])
#### Edit and RF Discharge Setup for HFSS
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oProject = oDesktop.SetActiveProject("coaxbend_discharge_r212")
oDesign = oProject.SetActiveDesign("HFSSDesign60degBendTeflon")
oModule = oDesign.GetModule("AnalysisSetup")
oModule.EditSetup("RFDischarge1",
[
"NAME:RFDischarge1",
"Enabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "HFSS",
"Design:=" , "This Design*",
"Soln:=" , "Setup1 : Sweep",
[
"NAME:Params",
"bend_angle:=" , "bend_angle"
],
"ForceSourceToSolve:=" , True,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "SourceProduct",
"ApplyMeshOp:=" , True
],
[
"NAME:Excitations",
[
"NAME:1:1",
"Magnitude:=" , "1",
"Phase:=" , "0deg"
],
[
"NAME:2:1",
"Magnitude:=" , "0",
"Phase:=" , "0deg"
]
],
[
"NAME:Frequencies",
"10GHz"
],
"Minimum Power:=" , "0.01",
"Maximum Power:=" , "1000000",
"Minimum Pressure:=" , "100pascal",
"Maximum Pressure:=" , "101325pascal",
"Postproc Sampling:=" , 500,
"Temperature:=" , "0cel",
"BuiltInGas:=" , "Helium"
])
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30),
Array("NAME:Mult",
"MaxPass:=", 1,
"MinPass:=", 1,
"MinConvPass:=", 1,
"PerError:=", 1,
"PerRefine:=", 30)),
Array("NAME:AC",
"MaxPass:=", 10,
"MinPass:=", 1,
"MinConvPass:=", 2,
"PerError:=", 1,
"PerRefine:=", 30))
EnableSetup
Enables and disables a defined optimetrics analysis setup.
UI Access Right-click on a setup in the project tree, select Enable Setup or Disable Setup
ExportDXConfigFile
Create an xml file with the setup information for Design Xplorer
Right click on the Design Xplorer setup in the project tree and choose Export External Connector Addin Con-
UI Access
figuration…
ExportOptimetricsProfile
Export Optimetrics profile data
Right click on the Optimetrics setup in the project tree and choose View Analysis Result… On the Post Ana-
UI Access
lysis Display dialog box, click the Profile tab and click on the Export button.
ExportOptimetricsResult
Export an existing Optimization, Sensitivity, Statistical or DesignXplorer result. (Does not export Parametric results.)
Right click on the desired Optimetrics setup in the project tree and choose View Analysis Result… On the
UI Access
Post Analysis Display dialog box, click the Result tab, then select Table view, and click on the Export button
"StatisticalSetup1", "c:/exportdir/test.csv",false)
ExportParametricResults
Export existing Parametric results.
Right click on the desired Parametric setup in the project tree and choose View Analysis Result… On the Post
UI Access
Analysis Display dialog box, click the Result tab, then select Table view, and click on the Export button.
ExportParametricSetupTable
Exports the parametric setup table as a CSV file.
oModule.ExportParametricSetupTable('ParametricSetup1', 'E:/Files/ParametricSetup1_
Python
Table.csv')
Example
ExportRespSurfaceMinMaxTable
Exports min-max table from a response surface to a file
Click on Export... From the Response Surface tab of the Design of Experiments Post Analysis Display dia-
UI Access
log.
ExportRespSurfaceRefinePoints
Exports refinement points table to a file
From the Response Surface tab of the Design of Experiments Post Analysis Display dialog box, select
UI Access
Refinement Points option under View, Click on Export....
ExportRespSurfaceResponsePoints
Exports response points table to a file
From the Response Surface tab of the Design of Experiments Post Analysis Display dialog box, select
UI Access
Response Points option under View, Click on Export....
ExportRespSurfaceVerificationPoints
Exports verification points table to a file
From the Response Surface tab of the Design of Experiments Post Analysis Display dialog box, select Veri-
UI Access
fication Points option under View, Click on Export....
GenerateVariationData [Parametric]
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 the setup.
VB Example:
oModule.GenerateVariationData "ParametricSetup1"
GetChildNames [Optimetrics]
If used without a specific optimization setup name, gets a list of all setups for all types. If a with a specific setup name, returns names
for that optimization setup.
UI Access NA
GetChildObject [Optimetrics]
Gets a Setup Object of the Optimetrics module
UI Access NA
Setup Name text string A optimetrics setup name, names returned by the GetChildNames().
A script object for the setup See discussion of Optimetrics Setup Objects in Object Script Property Function Sum-
Return Value mary.
GetChildTypes [Optimetrics]
Use: Gets child types of queried Optimetrics module.
Syntax: GetChildTypes()
Return Value: Array of text string, it can be an empty array if there is no setup is defined. There are six types of setup, they are
['OptiParametric', 'OptiOptimization', 'OptiSensitivity', 'OptiStatistical', 'OptiDesignExplorer', 'OptiDXDOE'].
GetName
Returns the name of the active design.
UI Access N/A
Parameters None.
Return Value String indicating the name of the active design.
VB Syntax GetName
VB Example design_name = oDesign.GetName
GetObjPath [Design]
Obtains the path to the design.
UI Access N/A
Parameters None.
Return Value String containing the path to the design.
VB Syntax GetObjPath
VB Example oDesign.GetObjPath
GetOptimetricResult
Returns an Optimetric calculation. The specific calculation is determined by the setup.
UI Access N/A
Return Value Calculation result. If the setup contains more than one calculation, the output will be an array of values.
GetPropNames [Optimetrics]
Use: Always returns the empty set for Optimetrics objects since they do not have properties.
Syntax: GetPropNames(bIncludeReadOnly)
Return Value: Returns empty set.
Parameters: bIncludeReadOnly—optional, default to True.
GetPropValue [Optimetrics]
Returns the property value for a setup property.
UI Access NA
VB Syntax GetPropValue()
GetPropValue(“Optimetrics/OptimizationSetup1/Enabled”)
VB Example
Returns True if Enabled, or False if disabled.
GetSetupNames [Optimetrics]
Gets a list of Optimetrics setup names
UI Access NA
VB Syntax GetSetupNames()
Set oModule_opt = oDesign.GetModule("Optimetrics")
VB Example Set opt_setup_list = oModule.GetSetupNames()
numsetups = setupnames.Count
GetSetupNamesByType [Optimetrics]
Gets a list of Optimetrics setup names by type.
UI Access NA
ImportSetup
Import an Optimetric setup from a file.
UI Access NA
"c:/importdir/mySetupInfoFile")
InsertSetup
Adds a new solution setup.
Array("NAME:<SetupName>", <NamedParameters>)
<Named Parameters>
"AdaptMultipleFreqs:=", <boolean>,
"Frequency:=", <string>,
"MaxDeltaS:=", <float>,
"PortsOnly:=", <boolean>,
"UseMatrixConv:=", <boolean>,
### If UseMatrixCov is True, ###
[
"NAME:Matrix Convergence",
<Convergence Array>
],
MaximumPasses:=", <integer>,
"MinimumPasses:=", <integer>,
"MinimumConvergedPasses:=", <integer>,
"PercentRefinement:=", <integer>,
"IsEnabled:=", <boolean>,
"BasisOrder:=", <integer>,
"DoLambdaRefine:=", <boolean>,
"DoMaterialLambda:=", <boolean>,
"SetLambdaTarget:=", <boolean>,
"Target:=", <float>,
"PortAccuracy:=", <integer>,
SaveRadFieldsOnly:=", <boolean>,
"SaveAnyFields:=", <boolean>,
"ListsForFields:=", <array of string>,
"IESolverType:=", <string>,
"LambdaTargetForIESolver:=", <float>,
"UseDefaultLambdaTgtForIESolver:=", <boolean>
oModule.InsertSetup("HfssDrivenAuto",
["NAME:Setup1",
"IsEnabled:=", True,
"AutoSolverSetting:=", "Balanced",
["NAME:Sweeps",
["NAME:Sweep",
"RangeType:=", "LinearStep",
"RangeStart:=", "1GHz",
Python
"RangeEnd:=", "10GHz",
Example
"RangeStep:=", "1GHz"
]
],
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"Type:=", "Discrete"
])
oModule.InsertSetup("HfssDrivenAuto",
[
"NAME:Setup2",
"SolveType:=" , "Auto",
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"AutoSolverSetting:=" , "Balanced",
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearCount",
"RangeStart:=" , "0GHz",
"RangeEnd:=" , "10GHz",
"RangeCount:=" , 501
]
],
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"ListsForFields:=" , ["Objectlist2"],
"Type:=" , "Interpolating"
])
oModule.InsertSetup("HfssDriven",
["NAME:Setup3",
"AdaptMultipleFreqs:=", False,
"Frequency:=", "5GHz",
"MaxDeltaS:=", 0.02,
"PortsOnly:=", False,
"UseMatrixConv:=", False,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", True,
"BasisOrder:=", 1,
"DoLambdaRefine:=", True,
"DoMaterialLambda:=", True,
"SetLambdaTarget:=", False,
"Target:=", 0.3333,
"UseMaxTetIncrease:=", False,
"PortAccuracy:=", 2,
"UseABCOnPort:=", False,
"SetPortMinMaxTri:=", False,
"UseDomains:=", True,
"UseIterativeSolver:=", False,
"IterativeResidual:=", 1E-06,
"DDMSolverResidual:=", 0.0001,
"EnhancedLowFreqAccuracy:=", True,
"SaveRadFieldsOnly:=", False,
"SaveAnyFields:=", True,
"IESolverType:=", "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"SkipIERegionSolveDuringAdaptivePasses:=", True
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"InfiniteSphereSetup:=" , "Infinite Sphere1",
"SkipSBRSolveDuringAdaptivePasses:=", True,
"PTDUTDSimulationSettings:=", "PTD Correction + UTD Rays",
"PTDEdgeDensity:=" , 20
])
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"DrivenSolverType:=" , "Direct Solver",
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"RadiationSetup:=" , "Infinite Sphere1",
"PTDUTDSimulationSettings:=", "None",
"EnableSBRSelfCoupling:=", False,
"UseSBRAdvOptionsGOBlockage:=", False,
"UseSBRAdvOptionsWedges:=", False,
"SkipSBRSolveDuringAdaptivePasses:=", False,
"UseSBREnhancedRadiatedPowerCalculation:=", True
])
"IsSbrRangeDoppler:=" , False,
"RayDensityPerWavelength:=", 4,
"MaxNumberOfBounces:=" , 5,
"IsMonostaticRCS:=" , True,
"EnableCWRays:=" , False,
"RadiationSetup:=" , "",
"PTDUTDSimulationSettings:=", "None",
"FastFrequencyLooping:=", True,
[
"NAME:Sweeps",
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True
])
[
"NAME:Sweep",
"RangeType:=" , "LinearStep",
"RangeStart:=" , "1GHz",
"RangeEnd:=" , "10GHz",
"RangeStep:=" , "1GHz"
]
],
"ComputeFarFields:=" , True,
"UseSBREnhancedRadiatedPowerCalculation:=", True,
"IsGOBlockageEnabled:=" , False,
"GOBlockageSurfaceSelfBlock:=", False
])
oModule.InsertSetup("HfssRFDischarge",
[
"NAME:RFDischarge1",
"Enabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "HFSS",
"Design:=" , "This Design*",
"Soln:=" , "Setup1 : Sweep",
[
"NAME:Params",
"bend_angle:=" , "bend_angle"
],
"ForceSourceToSolve:=" , False,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "SourceProduct",
"ApplyMeshOp:=" , True
],
[
"NAME:Excitations",
[
"NAME:1:1",
"Magnitude:=" , "1",
"Phase:=" , "0deg"
],
[
"NAME:2:1",
"Magnitude:=" , "0",
"Phase:=" , "0deg"
]
],
[
"NAME:Frequencies",
"10GHz"
],
"Minimum Power:=" , "0.01",
"Maximum Power:=" , "1000000",
"Minimum Pressure:=" , "100pascal",
"Maximum Pressure:=" , "101325pascal",
"MaximumPasses:=" , 12,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
"DrivenSolverType:=" , "Direct Solver",
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"IESolverType:=" , "ACA",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"InfiniteSphereSetup:=" , ""
])
### Setup with UseMatrixConv as Entries and MeshLink
oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup("Setup1",
[
"NAME:Setup1",
"SolveType:=" , "Single",
"Frequency:=" , "10GHz",
"MaxDeltaS:=" , 0.02,
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "A[1,1]P1",
"Port2:=" , "A[1,1]P1",
"MagLimit:=" , "0.011",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "A[4,4]P2",
"Port2:=" , "A[1,1]P2",
"MagLimit:=" , "0.041",
"PhaseLimit:=" , "5deg"
]
]
],
"MaximumPasses:=" , 1,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , True,
"Project:=" , "This Project*",
"Product:=" , "",
"Design:=" , "unit",
"Soln:=" , "Setup1 : LastAdaptive",
[
"NAME:Params",
"Airbox_dist:=" , "9.9931mm",
"Scan_Theta:=" , "0deg",
"Scan_phi:=" , "0deg",
"VirtualObject_dist:=" , "2.9979mm",
"coax_inner_rad:=" , "0.125mm",
"coax_outer_rad:=" , "0.425mm",
"cut_off:=" , "1.7mm",
"feedX:=" , "-0.4mm",
"feedY:=" , "2mm",
"feed_length:=" , "1mm",
"patchX:=" , "9.65mm",
"rot:=" , "45deg",
"subH:=" , "0.8mm",
"subX:=" , "15mm",
"subY:=" , "15mm"
],
"ForceSourceToSolve:=" , False,
"PreservePartnerSoln:=" , False,
"PathRelativeTo:=" , "TargetProject",
"ApplyMeshOp:=" , True,
"AdaptPort:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , False,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
"DrivenSolverType:=" , "Domain Decomposition",
"IterativeResidual:=" , 0.0001,
"DDMSolverResidual:=" , 0.0001,
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"InfiniteSphereSetup:=" , ""
])
### Example from design with UseMatrixConv True for AllDiagEntries
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
"AllDiagEntries:=" , True,
"DiagonalMag:=" , "0.03",
"DiagonalPhase:=" , "4rad",
"MagMinThreshold:=" , 0.01,
"AllOffDiagEntries:=" , True,
"OffDiagonalMag:=" , "0.05",
"OffDiagonalPhase:=" , "6deg",
"MagMinThreshold:=" , 0.01
],
### Example from Modal design with UseMatrixConv True for Entries
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "Port1",
"Port2:=" , "Port1",
"MagLimit:=" , "0.02",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "Port3",
"Port2:=" , "Port2",
"MagLimit:=" , "0.03",
"PhaseLimit:=" , "5deg"
]
]
],
#### Example from Design with Periodic Ports and UseMaxtrixConv is True
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "Incident_Port1",
"Port2:=" , "Incident_Port1",
"MagLimit:=" , "0.11",
"PhaseLimit:=" , "5deg"
],
[
"NAME:Entry",
"Port1:=" , "Incident_Port2",
"Port2:=" , "Incident_Port2",
"MagLimit:=" , "0.22",
"PhaseLimit:=" , "5deg"
]
]
],
#### Example Terminal Design with UseMatrixConv = True and Expression Cache
oProject = oDesktop.SetActiveProject("term-2x2_1_parasolid")
oDesign = oProject.SetActiveDesign("unit")
oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup("Setup1",
[
"NAME:Setup1",
"SolveType:=" , "Single",
"Frequency:=" , "10GHz",
"MaxDeltaS:=" , 0.02,
"UseMatrixConv:=" , True,
[
"NAME:Matrix Convergence",
[
"NAME:Entries",
[
"NAME:Entry",
"Port1:=" , "P2",
"Port2:=" , "P1",
"MagLimit:=" , "0.05",
"PhaseLimit:=" , "10deg"
]
]
],
"MaximumPasses:=" , 15,
"MinimumPasses:=" , 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"IsEnabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"BasisOrder:=" , 1,
"DoLambdaRefine:=" , True,
"DoMaterialLambda:=" , True,
"SetLambdaTarget:=" , False,
"Target:=" , 0.3333,
"UseMaxTetIncrease:=" , False,
"PortAccuracy:=" , 2,
"UseABCOnPort:=" , False,
"SetPortMinMaxTri:=" , False,
"DrivenSolverType:=" , "Iterative Solver",
"IterativeResidual:=" , 0.0001,
"DDMSolverResidual:=" , 0.0001,
"EnhancedLowFreqAccuracy:=", False,
"SaveRadFieldsOnly:=" , False,
"SaveAnyFields:=" , True,
[
"NAME:ExpressionCache",
[
"NAME:CacheItem",
"Title:=" , "dB_AxialRatioValue_1",
"Expression:=" , "dB(AxialRatioValue)",
"Title:=" , "dB_St_P1_P1__1",
"Expression:=" , "dB(St(P1,P1))",
"Intrinsics:=" , "",
"ReportType:=" , "Terminal Solution Data",
[
"NAME:ExpressionContext",
"Diff:=" , "Terminals"
]
]
],
"CacheSaveKind:=" , "Delta",
"ConstantDelta:=" , "0s",
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True,
"IE Solver Accuracy:=" , "Balanced",
"InfiniteSphereSetup:=" , ""
])
VB Array("NAME:Setup1",
Exampl-
"Frequency:=", "1GHz",
e
"MaxDeltaE:=", 0.1,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", true,
Array("NAME:MeshLink",
"Project:=", "Tee.aedt",
"Design:=", "TeeModel",
Array("NAME:Setup2",
"Frequency:=", "1GHz",
"PortsOnly:=", false,
"MaxDeltaS:=", 0.02,
"UseMatrixConv:=", false,
"MaximumPasses:=", 6,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", true,
"BasisOrder:=", 1,
"UseIterativeSolver:=", true,
"IterativeResidual:=", 0.0001,
"DoLambdaRefine:=", true,
"DoMaterialLambda:=", false,
"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)
An Eigenmode solution type:
oModule.InsertSetup "HfssEigen",
Array("NAME:Setup2",
"MinimumFrequency:=", "1.77347GHz",
"NumModes:=", 1,
"MaxDeltaFreq:=", 10,
"ConvergeOnRealFreq:=", true,
"MaximumPasses:=", 3,
"MinimumPasses:=", 1,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"IsEnabled:=", true,
"BasisOrder:=", 1,
"UseIterativeSolver:=", false,
"DoLambdaRefine:=", true,
"DoMaterialLambda:=", true,
"SetLambdaTarget:=", false,
"Target:=", 0.2,
"UseMaxTetIncrease:=", false,
"MaxTetIncrease:=", 1000000,
"UsingConstantDelta:=", 0,
"ConstantDelta:=", "0s",
"NumberSolveSteps:=", 1)
A Driven solution type with ports and matrix convergence:
oModule.InsertSetup "HfssDriven",
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)
PasteSetup [Optimetrics]
Pastes the specified Optimetrics setup.
UI Access NA
RenameSetup [Optimetrics]
Renames the specified Optimetrics setup.
UI Access Right-click the setup in the project tree, and then click Rename on the shortcut menu.
SetPropValue [Optimetrics]
Sets the property value for the active Optimetrics setup.
Return Value True if the property is found and the new value is valid. Otherwise return False.
SolveAllSetup
Solves all Optimetrics setups
UI Access Right-click on Optimetrics in Project Manager and select Analyze>All from context menu
VB Syntax SolveAllSetup
VB Example oModule.SolveAllSetup
SolveSetup [Optimetrics]
Solves the specified Optimetrics setup.
UI Access Right-click the setup in the project tree, and then click Analyze on the shortcut menu.
ValidateSetup [Parametric]
Performs a validation of all design variations in a parametric setup.
For information on reviewing the output produced by this script command, see: Validating a Parametric Setup
Under Optimetrics in the Project Manager, right-click the <Parametric Setup Name> and then click Validate
UI Access
Parametric Setup on the shortcut menu.
UI Access Right-click the setup in the project tree, and then click Properties on the shortcut menu.
ExportParametricSetupTable
Exports the parametric setup table as a CSV file.
oModule.ExportParametricSetupTable('ParametricSetup1', 'E:/Files/ParametricSetup1_
Python
Table.csv')
Example
tax
GenerateVariationData [Parametric]
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 the setup.
VB Example:
oModule.GenerateVariationData "ParametricSetup1"
InsertSetup [Parametric]
Inserts a new parametric setup.
UI Access Right-click the Optimetrics folder in the project tree, and then click Add> Parametric on the shortcut menu.
Array("NAME:Goals", Array("NAME:Goal",
<OptiGoalSpec>), ... Array("NAME:Goal",
<OptiGoalSpec>))
<SetupName> String Name of the parametric setup.
<SimSetups> Array of An array of Twin Builder solution setup names.
Strings
<SweepDefs> Array Array("NAME:Sweeps",
Array("NAME:SweepDefinition", "Variable:=",
<VarName>, "Data:=", <SweepData>,
"Synchronize:=", <SyncNum>), ...
Array("NAME:SweepDefinition", "Variable:=",
<VarName>, "Data:=", <SweepData>,
"Synchronize:=", <SyncNum>))
<SweepData> String "<SweepType>, <StartV>, <StopV>, <StepV>"
<SweepType> String The type of sweep data.
<SyncNum> Integer SweepDatas with the same value are synchronized.
<SweepOps> Array("NAME:Sweep Operations", "<OpType>:=,
Array(<VarValue>, …, <VarValue>), ...
<OpType>:=, Array(<VarValue>, …, <VarValue>))
<OpType> String The sweep operation type.
oModule.InsertSetup(
"OptiParametric",
["NAME:ParametricSetup1", _
"SaveFields:=", true, _
["NAME:StartingPoint"], _
"Sim. Setups:=", ["Setup1"],_
["NAME:Sweeps", _
["NAME:SweepDefinition", _
"Variable:=", "$width", _
["NAME:Goal", _
"Solution:=", "Setup1 : LastAdaptive", _
"Calculation:=", "returnloss", _
"Context:=", "",_
["NAME:Ranges", _
"Range:=", ["Var:=", "Freq", "Type:=","s", _
"Start:=", "8GHz", "Stop:=", "8GHz"]], _
["NAME:Goal", _
"Solution:=", "Setup1 : LastAdaptive",_
"Calculation:=", "reflect", _
"Context:=", "", _
["NAME:Ranges", _
"Range:=", ["Var:=", "Freq", "Type:=","s", _
"Start:=", "8GHz", "Stop:=", "8GHz"]]]]]])
Array("NAME:StartingPoint"), _
"Sim. Setups:=", Array("Setup1"),_
Array("NAME:Sweeps", _
Array("NAME:SweepDefinition", _
"Variable:=", "$width", _
"Data:=", "LIN 12mm 17mm 2.5mm", _
"OffsetF1:=", false, _
"Synchronize:=", 0),
Array("NAME:SweepDefinition", _
"Variable:=", "$length", _
"Data:=", "LIN 8mm 12mm 2mm", _
"OffsetF1:=", false, _
"Synchronize:=", 0)),
Array("NAME:Sweep Operations"), _
Array("NAME:Goals", _
Array("NAME:Goal", _
"Solution:=", "Setup1 : LastAdaptive", _
"Calculation:=", "returnloss", _
"Context:=", "",_
Array("NAME:Ranges", _
"Range:=", Array("Var:=", "Freq", "Type:=","s", _
"Start:=", "8GHz", "Stop:=", "8GHz"))), _
Array("NAME:Goal", _
"Solution:=", "Setup1 : LastAdaptive",_
"Calculation:=", "reflect", _
"Context:=", "", _
Array("NAME:Ranges", _
"Range:=", Array("Var:=", "Freq", "Type:=","s", _
"Start:=", "8GHz", "Stop:=", "8GHz")))))
ValidateSetup [Parametric]
Performs a validation of all design variations in a parametric setup.
For information on reviewing the output produced by this script command, see: Validating a Parametric Setup
Under Optimetrics in the Project Manager, right-click the <Parametric Setup Name> and then click Validate
UI Access
Parametric Setup on the shortcut menu.
UI Access Right-click the setup in the project tree, and then click Properties on the shortcut menu
"NAME:OptimizationSetup1",
"UseFastCalculationUpdateAlgo:=", False,
"FastCalcOptCtrledByUser:=", False,
"IsEnabled:=", True,
"SaveSolutions:=", False,
[
"NAME:StartingPoint"
],
"Optimizer:=", "Quasi Newton",
[
"NAME:AnalysisStopOptions",
"StopForNumIteration:=" , True,
"StopForElapsTime:=", False,
"StopForSlowImprovement:=", False,
"StopForGrdTolerance:=", False,
"MaxNumIteration:=",1000,
"MaxSolTimeInSec:=",3600,
"RelGradientTolerance:=", 0,
"MinNumIteration:=", 10
],
"CostFuncNormType:=", "L2",
"PriorPSetup:=", "",
"PreSolvePSetup:=", True,
[
"NAME:Variables"
],
[
"NAME:LCS"
],
[
"NAME:Goals",
[
"NAME:Goal",
"ReportType:=", "Standard",
"Solution:=", "TR",
[
"NAME:SimValueContext",
"SimValueContext:=", [1,0,2,0,False,False,-1,1,0,1,1,"",0,0
]
],
"Calculation:=", "acosh(Time)",
"Name:=", "Time",
[
"NAME:Ranges",
"Range:=", ["Var:=", "Time","Type:=", "a"]
],
"Condition:=", "==",
[
"NAME:GoalValue",
"GoalValueType:=", "Independent",
"Format:=", "Real/Imag",
"bG:=", ["v:=", "[1;]"]
],
"Weight:=", "[1;]"
]
],
"Acceptable_Cost:=" , 0,
"Noise:=", 0.0001,
"UpdateDesign:=", False,
"UpdateIteration:=", 5,
"KeepReportAxis:=", True,
"UpdateDesignWhenDone:=", True
])
"SimValueContext:=", Array( _
1, 0, 2, 0, false, false, -1, 1, 0, 1, 1, "", 0, 0)),
"Calculation:=", "Time", "Name:=", _
"Time", Array("NAME:Ranges", "Range:=",
Array("Var:=", "Time", "Type:=", "a")), "Condition:=", _
"==", Array("NAME:GoalValue", "GoalValueType:=",
"Independent", "Format:=", _
"Real/Imag", "bG:=", Array("v:=", "[1;]")),
"Weight:=", "[1;]")), "Acceptable_Cost:=", _
0, "Noise:=", 0.0001, "UpdateDesign:=", false,
"UpdateIteration:=", 5, "KeepReportAxis:=", _
true, "UpdateDesignWhenDone:=", true)
InsertSetup [Optimization]
Use: Inserts a new optimization setup.
UI Access Right-click the Optimetrics folder in the project tree, and then click Add>Optimization on the shortcut menu.
<OptimizationVars>, <Constraint>,
Array("NAME:Goals", Array("NAME:Goal",
<OptiGoalSpec>, <OptimizationGoalSpec>), ...
Array("NAME:Goal", <OptiGoalSpec>,
<OptimizationGoalSpec>)),
"Acceptable_Cost:=", <AcceptableCost>, "Noise:=",
<Noise>, "UpdateDesignWhenDone:=", <UpdateDesign"
<OptimizationVars> Array Array("NAME:Variables", "VarName:=", Array("i:=",
<IncludeVar>, "Min:=", <MinV>, "Max:=", <MaxV>,
"MinStep:=", <MinStepV>, "MaxStep:=", <MaxStepV>),
………………. "VarName:=", Array("i:=", <IncludeVar>,
"Min:=", <MinV>, "Max:=", <MaxV>,
"MinStep:=", <MinStepV>, "MaxStep:=", <MaxStepV>))
<MinStepV> VarValue The minimum step of the variable.
<MaxStepV> VarValue The maximum step of the variable.
<AcceptableCost> Double The acceptable cost value for the optimizer to stop.
<Noise> Double The noise of the design.
<UpdateDesign> Boolean Specifies whether or not to apply the optimal variation to the design after
the optimization is done.
<OptimizationGoalSpec> Array "Condition:=", <OptimizationCond>,
Array("NAME:GoalValue", "GoalValeType:=",
<GoalValueType>,
"Format:=", <GoalValueFormat>, "bG:=",
Command: Right-click the Optimetrics folder in the project tree, and then click Add>Optimization on the shortcut menu.
Syntax: InsertSetup "OptiOptimization", <OptimizationParams>
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>),
………………. "VarName:=", Array("i:=", <IncludeVar>, "Min:=", <MinV>, "Max:=", <MaxV>,
"MinStep:=", <MinStepV>, "MaxStep:=", <MaxStepV>))
<MinStepV>
Type : <VarValue>
The minimum step of the variable.
<MaxStepV>
Type: <VarValue>
The maximum step of the variable.
<AcceptableCost>
Type: <double>
The acceptable cost value for the optimizer to stop.
<Noise>
Type: <double>
The noise of the design.
<UpdateDesign>
Type: <bool>
Specifies whether or not to apply the optimal variation to the design after the optimization is done.
<OptimizationGoalSpec>
"Condition:=", <OptimizationCond>,
Array("NAME:GoalValue", "GoalValueType:=",
<GoalValueType>,
"Format:=", <GoalValueFormat>, "bG:=",
Array("v:=", <GoalValue>)), "Weight:=", <Weight>)
<OptimizationCond>
Type: <string>
Either "<=", "==", or ">="
<GoalValueType>
Type: <string>
<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.
VB Example:
oModule.InsertSetup "OptiOptimization",_
Array("NAME:OptimizationSetup1", _
"SaveFields:=", false, _
Array("NAME:StartingPoint", "$length:=", "8mm", _
"$width:=", "14.5mm"), _
"Optimizer:=", "Quasi Newton", _
"MaxIterations:=", 100, _
"PriorPSetup:=", "ParametricSetup1", _
"PreSolvePSetup:=", true, _
Array("NAME:Variables", _
"Format:=", "Real/Imag", _
"bG:=", Array("v:=", "[0.0001]")), _
"Weight:=", "[1]")),
"Acceptable_Cost:=", 0.0002, _
"Noise:=", 0.0001, _
"UpdateDesign:=", true, _
"UpdateIteration:=", 5, _
"KeepReportAxis:=", true, _
"UpdateDesignWhenDone:=", true)
"PriorPSetup:=", "ParametricSetup1", _
"PreSolvePSetup:=", true, _
["NAME:Variables", _
"$length:=", ["i:=", true, "Min:=", "6mm",_
"Max:=", "18mm", _
"MinStep:=", "0.001mm", "MaxStep:=", _
"1.2mm"], _
"$width:=", ["i:=", true, "Min:=", _
"6.5mm", "Max:=", "19.5mm", _
"MinStep:=", "0.001mm", "MaxStep:=", _
"1.3mm"]], _
["NAME:LCS"], _
["NAME:Goals", _
["NAME:Goal", _
"Solution:=", "Setup1 : LastAdaptive", _
"Calculation:=", "reflect", _
"Context:=", "", _
["NAME:Ranges", _
"Range:=", ["Var:=", "Freq", _
"Type:=", "s", _
"Context:=", "", _
Array("NAME:Ranges", _
"Range:=", Array("Var:=", "Freq", _
"Type:=", "s", _
"Start:=", "8GHz", "Stop:=", "8GHz")), _
"Condition:=", "<=", _
Array("NAME:GoalValue", _
"GoalValueType:=", "Independent", _
"Format:=", "Real/Imag", _
"bG:=", Array("v:=", "[0.0001]")), _
"Weight:=", "[1]")),
"Acceptable_Cost:=", 0.0002, _
"Noise:=", 0.0001, _
"UpdateDesign:=", true, _
"UpdateIteration:=", 5, _
"KeepReportAxis:=", true, _
"UpdateDesignWhenDone:=", true)
InsertSetup [Sensitivity]
EditSetup [Sensitivity]
Modifies an existing sensitivity setup.
UI Access Right-click the setup in the project tree, and then click Properties on the shortcut menu
"NAME:LCS"
],
[
"NAME:Goals",
[
"NAME:Goal",
"ReportType:=", "Standard",
"Solution:=", "TR3",
[
"NAME:SimValueContext",
"SimValueContext:=", [1,0,2,0,False,False,-1,1,0,1,1,"",0,0]
],
"Calculation:=", "mag(DIFF1.VAL)",
"Name:=", "DIFF1.VAL",
[
"NAME:Ranges",
"Range:=", [
"Var:=", "Time","Type:=", "a"]
],
"Condition:=", "==",
[
"NAME:GoalValue",
"GoalValueType:=", "Independent",
"Format:=", "Real/Imag",
"bG:=", ["v:=", "[1;]"]
],
"Weight:=", "[1;]"
]
],
"Acceptable_Cost:=", 0,
"Noise:=", 0.0001,
"UpdateDesign:=", False,
"UpdateIteration:=", 5,
"KeepReportAxis:=", True,
"UpdateDesignWhenDone:=", True
])
"NAME:OptimizationSetup1",
"UseFastCalculationUpdateAlgo:=", False,
"FastCalcOptCtrledByUser:=", False,
"IsEnabled:=", True,
"SaveSolutions:=", False,
Array(
"NAME:StartingPoint"
),
"Optimizer:=", "Quasi Newton",
Array(
"NAME:AnalysisStopOptions",
"StopForNumIteration:=" , True,
"StopForElapsTime:=", False,
"StopForSlowImprovement:=", False,
"StopForGrdTolerance:=", False,
"MaxNumIteration:=", 1001,
"MaxSolTimeInSec:=", 3600,
"RelGradientTolerance:=", 0,
"MinNumIteration:=" , 10
),
"CostFuncNormType:=", "L2",
"PriorPSetup:=", "",
"PreSolvePSetup:=", True,
Array(
"NAME:Variables"
),
Array(
"NAME:LCS"
),
Array(
"NAME:Goals",
Array(
"NAME:Goal",
"ReportType:=", "Standard",
"Solution:=", "TR3",
Array(
"NAME:SimValueContext",
"SimValueContext:=",
Array(1,0,2,0,False,False,-1,1,0,1,1,"",0,0)
),
"Calculation:=", "mag(DIFF1.VAL)",
"Name:=", "DIFF1.VAL",
Array(
"NAME:Ranges",
"Range:=", Array("Var:=", "Time","Type:=", "a")
),
"Condition:=", "==",
Array(
"NAME:GoalValue",
"GoalValueType:=", "Independent",
"Format:=", "Real/Imag",
"bG:=", Array("v:=", "Array(1;]")
),
"Weight:=", "Array(1;]"
)
),
"Acceptable_Cost:=", 0,
"Noise:=", 0.0001,
"UpdateDesign:=", False,
"UpdateIteration:=", 5,
"KeepReportAxis:=", True,
"UpdateDesignWhenDone:=", True
))
InsertSetup [Sensitivity]
Inserts a new sensitivity setup.
UI Access Right-click Optimetrics in the project tree, and then click Add>Sensitivity on the shortcut menu.
"Context:=", "",_
["NAME:Ranges",_
"Range:=", ["Var:=", "Freq", "_
Type:=", "s",_
"Start:=", "8GHz", "Stop:=", "8GHz"]]],_
["NAME:Goal",_
"Solution:=", "Setup1 : LastAdaptive",_
"Calculation:=", "reflect",_
"Context:=", "",_
["NAME:Ranges",_
"Range:=", ["Var:=","Freq",_
"Type:=", "s",_
"Start:=", "8GHz", "Stop:=", "8GHz"]]]],_
"Primary Goal:=", 1,_
"PrimaryError:=", 0.001])
Array("NAME:SensitivitySetup1",_
"SaveFields:=", true,_
Array("NAME:StartingPoint"), _
"MaxIterations:=", 20,_
"PriorPSetup:=", "",_
"PreSolvePSetup:=", true, _
Array("NAME:Variables"), _
Array("NAME:LCS"),_
Array("NAME:Goals",_
Array("NAME:Goal", _
"Solution:=", "Setup1 : LastAdaptive",_
"Calculation:=", "returnloss",_
"Context:=", "",_
Array("NAME:Ranges",_
"Range:=", Array("Var:=", "Freq", "_
Type:=", "s",_
"Start:=", "8GHz", "Stop:=", "8GHz"))),_
Array("NAME:Goal",_
"Solution:=", "Setup1 : LastAdaptive",_
"Calculation:=", "reflect",_
"Context:=", "",_
Array("NAME:Ranges",_
"Range:=", Array("Var:=","Freq",_
"Type:=", "s",_
"Start:=", "8GHz", "Stop:=", "8GHz")))),_
"Primary Goal:=", 1,_
"PrimaryError:=", 0.001)
UI Access Right-click the setup in the project tree, and clickProperties on the shortcut menu.
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("optiguides")
Set oDesign = oProject.SetActiveDesign("HFSSModel1")
Set oModule = oDesign.GetModule("Optimetrics")
oModule.EditSetup "StatisticalSetup1", Array("NAME:StatisticalSetup1",
Array("NAME:ProdOptiSetupData",
Array("NAME:Goals", Array("NAME:Goal",
"ReportType:=", "Modal Solution Data",
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]
Inserts a new statistical setup.
UI Access Right-click Optimetrics in the project tree, and then click Add>Statistical on the shortcut menu.
Array("NAME:Goals", Array("NAME:Goal",
<OptiGoalSpec>), …, Array("NAME:Goal",
<OptiGoalSpec>)))
<StatisticalVars> Array Array("NAME:Variables",
"VarName:=", Array("i:=", <IncludeVar>, "Dist:=",
<DistType>, "Tol:=", <Tolerance>,
"StdD:=", <StdD>, "Min:=", <MinCutoff>, "Max:=",
<MaxCutoff>, ...
"VarName:=", Array("i:=", <IncludeVar>, "Dist:=",
<DistType>, "Tol:=", <Tolerance>, "StdD:=",
<StdD>, "Min:=", <MinCutoff>, "Max:=",
<MaxCutoff>))
<DistType> String Distrbution can be "Gaussian" or "Uniform".
<Tolerance> VarValue The tolerance for the variable when distribution is Uniform
<StdD> VarValue The standard deviation for the variable when distribution is Gaussian.
<MinCutoff> Double The minimum cut-off for the variable when distribution is Gaussian.
<MaxCutoff> Double The maximum cut-off for the variable when distribution is Gaussian.
"OptiStatistical", _
["NAME:StatisticalSetup1", _
"SaveFields:=", true, _
["NAME:StartingPoint"],_
"MaxIterations:=", 50,_
"PriorPSetup:=", "", _
["NAME:Variables"], _
["NAME:Goals", _
["NAME:Goal", _
"Solution:=", "Setup1 : LastAdaptive", _
"Calculation:=", "returnloss", _
"Context:=", "", _
["NAME:Ranges", _
"Range:=", ["Var:=", "Freq", _
"Type:=", "s",_
"Start:=", "8GHz", "Stop:=", "8GHz"]]],_
["NAME:Goal",_
"Solution:=", "Setup1 : LastAdaptive",_
"Calculation:=", "reflect",_
"Context:=", "", _
["NAME:Ranges",_
"Range:=", ["Var:=", "Freq", "Type:=",_
"s", "Start:=", "8GHz", "Stop:=", "8GHz"]]]])
Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("OptimTee")
Set oDesign = oProject.SetActiveDesign("TeeModel")
oDesign.ChangeProperty Array("NAME:AllTabs",
Array("NAME:LocalVariableTab",
Array("NAME:PropServers", "LocalVariables"),
Array("NAME:ChangedProps",
Array("NAME:offset",
Array("NAME:Statistical", "Included:=", true)))))
Set oModule = oDesign.GetModule("Optimetrics")
oModule.InsertSetup "OptiStatistical", Array("NAME:StatisticalSetup1",
Array("NAME:ProdOptiSetupData",
"SaveFields:=", false, "CopyMesh:=", false),
Array("NAME:StartingPoint", "offset:=", "0in"),
"MaxIterations:=", 50, "PriorPSetup:=", "",
Array("NAME:Variables",
"offset:=", Array("i:=", true,
"int:=", false,
"Dist:=", "Gaussian",
"Tol:=", "10%",
"StdD:=", ".5in",
"Min:=", "-3",
"Max:=", "3",
"Shape:=", "1",
"Scale:=", "0in",
"Location:=", "0in",
"Dataset:=", "",
"LatinHypercube:=", "true",
"VarMin:=", "-1in",
"VarMax:=", "1in",
"Prob:=", "0.01",
"Mean:=", "0in")),
Array("NAME:Goals", Array("NAME:Goal",
"ReportType:=", "Modal Solution Data",
"Solution:=", "Setup1 : LastAdaptive", Array("NAME:SimValueContext"),
"Calculation:=", "Power11",
"Name:=", "Power11",
Array("NAME:Ranges",
"Range:=", Array("Var:=", "Freq", "Type:=", "d",
"DiscreteValues:=", "10GHz")))))
For Q3D Extractor and Circuit the command details are as follows:
Inserts a new statistical setup.
Command: Right-click Optimetrics in the project tree, and then click Add>Statistical on the shortcut menu.
Syntax: InsertSetup "OptiStatistical", <StatisticalParams>
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",
"VarName:=", Array("i:=", <IncludeVar>, "Dist:=",
<DistType>, "Tol:=", <Tolerance>,
"StdD:=", <StdD>, "Min:=", <MinCutoff>, "Max:=",
<MaxCutoff>, ...
"VarName:=", Array("i:=", <IncludeVar>, "Dist:=",
<DistType>, "Tol:=", <Tolerance>, "StdD:=",
<StdD>, "Min:=", <MinCutoff>, "Max:=",
<MaxCutoff>))
Parameters:
<DistType>
Type : <string>
Distrbution can be "Gaussian" or "Uniform".
<Tolerance>
Type: <VarValue>
The tolerance for the variable when distribution is Uniform.
<StdD>
Type: <VarValue>
"Type:=", "s",_
"Start:=", "8GHz", "Stop:=", "8GHz"))),_
Array("NAME:Goal",_
"Solution:=", "Setup1 : LastAdaptive",_
"Calculation:=", "reflect",_
"Context:=", "", _
Array("NAME:Ranges",_
"Range:=", Array("Var:=", "Freq", "Type:=", _
"s", "Start:=", "8GHz", "Stop:=", "8GHz"))))
ImportSolution
ImportTable
IsFieldAvailableAt
ListMatchingVariations
ListValuesOfVariables
ListVariations
DeleteImportData
Deletes imported solution or table data in HFSS. Not in HFSS-IE
UI Access Right-click on Results > Import Solutions, click Delete Selections button.
DeleteSolutionVariation
Deletes all solution data for specific solutions and design variations. This is obsolete and is supported only for backward compatibility.
You should use DeleteFullVariation, DeleteFieldVariation, and DeleteLinked Variation.
UI Access Right-click on Results, select Browse Solutions..., click Delete button in the dialog.
DeleteVariation [HFSS]
Obsolete. Replaced by DeleteFullVariation, DeleteFieldVariation, and DeleteLinked Variation.
EditSources
Indicates which source excitations should be used for fields post-processing.
IncidentFields
NoIncidentWave
EigenPeakElecticField
EigenStoredEnergy
IncludePortPostProcessing - boolean
For Driven Terminal designs, a terminal may be terminated
UseIncidentVoltage - boolean - otherwise use total voltage
For CMA problems:
ExciteModes - boolean. If true use modal excitations, otherwise use terminals. Terminal excitations are specified by their
name, magnitude, and phase
For Eigen problems:
The special excitation "Modes" specifies the modal excitations. These are then set with the keywords
For all unit quantities, expressions ( "3 * my_var", "pwl( freq, ds1 )") are permitted as well.
ExportEigenmodes
Exports a tab delimited table of Eigenmodes in HFSS. Not in HFSS-IE.
UI Access N/A
ExportForHSpice
Exports matrix solution data to a file in a format suitable for HSpice 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.
UI Access N/A
ExportNetworkData
Exports matrix solution data to a file. Available only for Driven solution types with ports.
UI Access N/A
<RenormImped> Double Real impedance value in ohms, for renormalization. Required in syn-
tax, but ignored if DoRenorm is false.
<DataType> String Optional. Type: "S", "Y", or "Z". The matrix to export.
<pass> Integer Optional. 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> Integer Optional. Type: "0", "1", or "2"
The format to use for the exported data.
0 = Magnitude/Phase.
1= Real/Imaginary.
2= db/Phase.
<Precision> Integer Optional. Touchstone number of digits precision. Default if not spe-
cified is 15.
<UseExportFreqs> Boolean Specifies whether to use export frequencies.
<IncludeGammaComments> Boolean Specifies whether to include Gamma and Impedance comments.
<SupportNonStdExport> Boolean Specifies whether to support non-standard Touchstone extensions
for mixed reference impedance.
ExportNMFData [HFSS]
Exports matrix solution data to a file in neutral model format. Available only for Driven solution types with ports. Variables can be held
constant by setting their values in the variation field. For example: "length='50mm' width='30mm'". All other independent variables will
be treated as NMF parameters.
UI Access N/A
ExportTransientData
Exports transient solution data to a file.
UI Access HFSS > Results > Solution Data..., then click Export.
FFTOnReport
Performs an FFT on a selected report.
UI Access Right-click on Results in the project tree, select Perform FFT On Report...
GetAdaptiveFreq
Obtains an adaptive frequency for a specified setup.
UI Access N/A
GetAdaptiveSettings
Obtains the adaptive frequency settings of a specified setup.
UI Access N/A
GetAllSourceMagnitudes
Obtains the magnitude values of all defined sources.
UI Access N/A
Parameters None.
Return Value Array of strings containing magnitude values.
VB Syntax GetAllSourceMagnitudes
VB Example oModule.GetAllSourceMagnitudes
GetAllSourceModes
Obtains mode information of all defined sources.
UI Access N/A
Parameters None.
Return Value Array of strings containing mode information.
VB Syntax GetAllSourceModes
VB Example oModule.GetAllSourceModes
GetAllSourcePhases
Obtains the phase values of all defined sources.
UI Access N/A
Parameters None.
Return Value Array of strings containing phase values.
VB Syntax GetAllSourcePhases
VB Example oModule.GetAllSourcePhases
GetAllSources
Retrieves all sources defined in the current solution setup.
UI Access N/A
Parameters None.
Return Value Array of strings containing source names.
VB Syntax GetAllSources
VB Example oModule.GetAllSources
GetAntennaParameters
Retrieves antenna parameters defined in a specified setup.
UI Access N/A
GetAvailableVariations
Returns the available variation for a solution.
UI Access N/A
GetEditSourcesCount
For Characteristic Mode Analysis (CMA), returns the number of sources listed in the Edit Sources panel.
UI Access N/A
Parameters None.
Return Value Integer number of sources.
VB Syntax GetEditSourcesCount
Dim count
VB Example
count = oModule.GetEditSourcesCount
GetExcitationScaling
Gets source scaling parameters.
UI Access N/A
GetFieldType
Gets the field type of a driven modal design solution.
UI Access N/A
Parameters None.
Return Value String containing field type.
VB Syntax GetFieldType
VB Example oModule.GetFieldType
GetIncludePortPostProcessing
Determines whether the Include Port Post Processing Effects option is enabled.
UI Access N/A
Parameters None.
Integer.
VB Syntax GetIncludePortPostProcessing
VB Example oModule.GetIncludePortPostProcessing
GetMultipactionBreakdown
Gets multipaction breakdown from the specified setup.
UI Access N/A
GetNetworkDataSolution
Gets matrix data solution from a specified setup.
UI Access N/A
GetNetworkDataSolutionDefinition
Gets definition of network data solution from a specified setup.
UI Access N/A
GetNetworkPostprocSetup
Obtains network post-processing setup.
UI Access N/A
Parameters None.
Return Value String containing post-processing setup.
VB Syntax GetNetworkPostprocSetup
VB Example oModule.GetNetworkPostprocSetup
GetISolutionVersionID
Use: To obtain the solution ID to help track solution validity.
Syntax: GetISolutionVersionID(BSTR fullSolutionName)
Return Value: Returns a solution ID.
Parameters: None
VB Example:
versionID = oModule.GetISolutionVersionID(BSTR fullSolutionName)
GetSolveRangeInfo
Determines the frequency range of a particular simulation setup. For fast sweeps and interpolating sweeps this command returns the
start and stop frequencies. For discrete sweeps, it returns a list of frequencies. For an adaptive solution, it returns the adaptive fre-
quency.
UI Access N/A
GetSourceContexts
Obtains sources currently enabled as context in the Edit Sources dialog Source Context tab.
UI Access N/A
Parameters None.
Return Value Array of enabled source names
VB Syntax GetSourceContexts
VB Example oModule.GetSourceContexts
GetTerminalExcitationType
Obtains the type for terminal excitation in a driven terminal design.
UI Access N/A
Parameters None.
Return Value String containing excitation type.
VB Syntax GetTerminalExcitationType
VB Example oModule.GetTerminalExcitationType
GetTransientSolveTimes
Gets the transient solution solve time.
UI Access N/A
GetValidISolutionList
Gets all available solution names that exist in a design.
UI Access N/A
HasFields
Determines if fields exist for a particular solution.
UI Access N/A
HasMatrixData
Determines if matrix data exists for a particular solution.
UI Access N/A
HasMesh
Determines if a current mesh exists for a particular simulation setup, not including the initial mesh.
UI Access N/A
ImportSolution
Imports a matrix solution in HFSS, which can then be used in creating reports or in the display of matrix data. The imported solution
need not have the same characteristics as the current design. Imported terminal data that meets the required criteria can be used for
full-wave Spice export. Not used in HFSS-IE.
UI Access Right-click on Results > Import Solutions..., click on Import Solution... in the opened dialog window.
oModule.ImportSolution _
VB Example "c:\mydir\in.s2p", _
"MeasuredData", Array("Sweep1")
ImportTable
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 delim-
ited 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.
UI Access Right-click on Results > Import Solutions..., click on Import Table... in the opened dialog window.
IsFieldAvailableAt
Determines if a field solution exists for a particular frequency in a simulation.
UI Access N/A
ListMatchingVariations
Gets a list of solved variations that include the specified variable values.
UI Access N/A
Array of strings corresponding to solved variations. The match variables may be a partial set of design variables
Return Value
and the match values are one per variable in the same order as the variables.
ListValuesOfVariable
Gets the values of a specified variable corresponding to the solved variations.
UI Access N/A
Array of double precision values in SI units interpreted as the specified variable corresponding to the solved vari-
Return Value
ations.
ListVariations
Gets a list of solved variations.
UI Access N/A
SetSourceContexts
For Near or Far Field projects for Driven Modal or Driven Terminal Network Analysis Solutions, specifies the port name and all mod-
es/terminals of that port to be enabled as Source Context.
TDROnReport
Performs a time-domain reflectometry (TDR) analysis on a specified report.
18-40
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EnterPoint
EnterQty
EnterScalar
EnterScalarFunc
EnterSurf
EnterVector
EnterVectorFunc
EnterVol
ExportOnGrid [Fields Calculator]
ExportToFile [Fields Calculator]
GetTopEntryValue
LoadNamedExpressions
SaveNamedExpressions
AddNamedExpression
Creates a named expression using the expression at the top of the stack.
AddNamedExpr
Creates a named expression using the expression at the top of the stack.
CalcOp
Performs a calculator operation.
CalcRead(deprecated)
Reads a file that is written out by the CalcWrite command, and puts the result into a calculator numeric.
CalculatorRead
Gets a register file and applies it to the calculator stack.
CalcStack
Performs an operation on the stack.
CalculatorWrite
Writes contents of top register to file.
CalcWrite
Writes contents of top register to file.
UI Access N/A
ChangeGeomSettings
Changes the line discretization setting.
ClcEval
Evaluates the expression at the top of the stack using the provided solution name and variable values.
ClcMaterial
Performs a material operation on the top stack element.
ClcMaterialValue
Shows the value of the material property without performing any operation.
ClearAllNamedExpr
Clears all user-defined named expressions from the list.
VB Syntax ClearAllNamedExpr
VB Example oModule.ClearAllNamedExpr
CopyNamedExprToStack
Copies the named expression selected to the calculator stack.
DeleteNamedExpr
Deletes the selected named expression from the list.
DoesNamedExpressionExists
Determines whether specified named expression exists.
UI Access N/A
Boolean:
EnterComplex
Enters a complex number onto the stack.
UI Access Click Number, and then click Scalar. Complex option is selected.
EnterComplexVector
Enters a complex vector onto the stack.
UI Access Click Number, and then click Vector. Complex option is selected.
"1 + 2 j",_
"1 + 2 j")
EnterCoord
Enters a coordinate system defined in the 3D Modeler editor.
EnterEdge
Enters an edge defined in the 3D Modeler editor.
UI Access N/A
EnterLine
Enters a line defined in the 3D Modeler editor.
EnterOutputVar
Enters Output Vars, only valid for Eigenmode problems.
EnterPoint
Enters a point defined in the 3D Modeler editor.
EnterQty
Enters a field quantity.
EnterScalar
Enters a scalar onto the stack.
UI Access Click Number and then click Scalar. Complex option not selected.
EnterScalarFunc
Enters a scalar function.
EnterSurf
Enters a surface defined in the 3D Modeler editor.
EnterVector
Enters a vector onto the stack.
UI Access Click Number, and then click Vector. Complex option not selected.
EnterVectorFunc
Enters a vector function.
EnterVol
Enters a volume defined in the 3D Modeler editor.
<Offsets> Array Optional. Origin for the offset coordinate system. For Cartesian, x, y, z, for
Cylindrical, R, Phi, Z, for Spherical, Rho, Theta, Phi.
<ByCount> Boolean Optional.
Note:Regarding the ExportOnGrid legacy script which only has “IncludePtInOutput” argument (the last Boolean one), AEDT can still
read it and assign other new arguments as default values. Those default values are RefCSName = “global”, PtInSI = “True”, FieldInRe-
fCS = “False”
"FieldInRefCS:=" , True
],
"Cartesian", ["0mm", "0mm", "0mm"], False
)
oModule.ExportOnGrid("C:\offset_grid_model_unit_ref.fld",
Array("-1mm", "16mm", "0mm"),
Array("1mm", "18mm", "1mm"),
Array("2mm", "2mm", "1mm"),
"4500MHz : LastAdaptive",
Array("Freq:=", "4.5GHz","Phase:=" , "0deg"),
[
"NAME:ExportOption",
"IncludePtInOutput:=" , True,
"RefCSName:=" , "offset",
"PtInSI:=" , False,
"FieldInRefCS:=" , True
],
"Cartesian", Array("0mm", "0mm", "0mm"), False
)
Note:
Regarding to legacy ExportToFile script which only has “IncludePtInOutput” argument (the last Boolean one), AEDT can
still read it and assign other new arguments as default values. Those default values are RefCSName = “global”, PtInSI =
“True”, FieldInRefCS = “False”
oModule.ExportToFile("C:\\offset_file_model_unit_ref.fld", "C:\\offset_SI.pts",
"4500MHz : LastAdaptive",
Python [
Exampl-
"Freq:=" , "4.5GHz",
e
"Phase:=" , "0deg"
],
[
"NAME:ExportOption",
"IncludePtInOutput:=" , True,
"RefCSName:=" , "offset",
"PtInSI:=" , False,
"FieldInRefCS:=" , True
])
oModule.ExportToFile("C:\\offset_file_model_unit_ref.fld", "C:\\offset_SI.pts",
"4500MHz : LastAdaptive",
[
"Freq:=" , "4.5GHz",
VB "Phase:=" , "0deg"
Exampl-
],
e
[
"NAME:ExportOption",
"IncludePtInOutput:=" , True,
"RefCSName:=" , "offset",
"PtInSI:=" , False,
"FieldInRefCS:=" , True
])
GetTopEntryValue
Gets the value of the top entry of the calculator stack.
UI Access N/A
oModule.GetTopEntryValue "Setup1:LastAdaptive", _
VB Example Array("Freq:=", "1GHz", "Phase:=", "0deg", _
"x_size:=", "2mm")
LoadNamedExpressions
Loads a named expression definition from a saved file.
UI Access In the Fields Calculator, click Load From... in the Library area.
oModule.LoadNamedExpressions _
VB Example "C:\Ansoft\PersonalLib\smth.clc", _
"Fields", Array("smoothedtemp")
SaveNamedExpressions
Saves a named expression definition to a file.
UI Access In the Fields Calculator, click Save To... in the Library area.
"C:\Ansoft\PersonalLib\smth.clc", _
Array("smoothedtemp"), true
UI Access N/A
DeleteFarFieldSetup
Deletes an existing far-field setup.
UI Access Right-click on a far field setup under Radiation in the project tree, select Delete.
VB Syntax
oModule.DeleteFarFieldSetup _
VB Example
Array("Infinite Sphere1")
DeleteNearFieldSetup
Deletes an existing near-field line radiation setup.
UI Access Project Manager > Radiation. Right-click a setup and click Delete.
VB Syntax DeleteNearFieldSetup(NameArray)
VB Example oModule.DeleteNearFieldSetup Array("Line1", "Sphere1", "Box2", "Rectangle1")
DeleteSetup
Deletes specified radiation field setup(s).
EditRadiatedPowerCalculationMethod
Selects the method used to calculate radiated power.
UI Access Right-click Radiation in the project tree, select Radiated Power Calculation Method.
GetChildNames [Radiation]
Use: Gets setupup names .
Syntax: GetChildNames()
Return Value: All setup names.
Parameters: Optional, this parameter is ignored.
GetChildObject [Radiation]
Gets a Setup Object of the Radiation module.
GetChildTypes [Radiation]
Use: Gets child types of queried Radiation module object.
Syntax: GetChildTypes()
Return Value: Returns empty array.
GetPropNames [Radiation]
Use: Radiation module does not have its own property, this function always returns empty array.
Syntax: GetPropNames(bIncludeReadOnly)
Return Value: Returns empty set.
Parameters: bIncludeReadOnly—optional, default to True.
GetPropValue [Radiation]
Get the property value for a setup object.
UI Access NA
GetSetupNames
Gets the names of far field and near field radiation setups in a design.
UI Access N/A
PasteRadFieldSetup
Pastes a copied radiation field setup.
UI Access N/A
Parameters None.
Return Value String name of pasted setup.
VB Syntax PasteRadFieldSetup
VB Example oModule.PasteRadFieldSetup
RenameSetup [Radiation]
Renames an existing radiation setup.
UI Access Right-click a radiation setup in the project tree, and then click Rename on the shortcut menu.
SetPropValue [Radiation]
Sets the property value for the active Radiation property object.
Return Value True if the property is found and the new value is valid. Otherwise return False.
Python Example oRadModule.SetPropValue('Line1/Num Points', 100) ; Set the Line1 setups’ “Num
"UseNominalDesign:=", False,
"DesignVariation:=", "",
"Calculations:=", "Max U,Peak Directivity,Peak Gain,Radiation Efficiency,
Front To Back Ratio,Total Efficiency,System Efficiency"
])
oModule.AddAntennaOverlay _
Array("NAME:Antenna Parameter Overlay1", _
"Setup:=", "Infinite Sphere1", _
VB "Solution:=", "Setup1 : LastAdaptive", _
Example
"IntrinsicVariation:=", "Freq=1.8GHz", _
"UseNominalDesign:=", true, _
"Calculations:=","Max U,Peak Directivity,Peak Gain,Radiation Efficiency,Front To Back
Ratio")
AddRadFieldSourceGroup
Adds source group definitions for radiation field setup.
UI Access Right-click on Radiation in the project tree, select Insert Far Field Setup > Source Group...
Array("NAME:<SourceGroupName>",
Array("NAME:Sources",
<SourceName>, <SourceName>...))
oModule.AddRadFieldSourceGroup _
Array("NAME:Source Group1", _
VB Example
Array("NAME:Sources", _
"feedpin1_T1", "feedpin1_T2"))
EditAntennaOverlay
Edits parameters in an existing antenna overlay.
UI Access N/A
"UseNominalDesign:=", true, _
"Calculations:=","Max U,Peak Directivity,Peak Gain,Radiation Efficiency,Front To Back
Ratio")
EditBoxSetup
Edits a near-field box radiation setup.
UI Access Project Manager > Radiation > Box. Double-click and edit information.
VB Syntax EditBoxSetup(<BoxParams>)
oModule.EditBoxSetup Array("NAME:MyBox", _
VB Example "UseCustomRadiationSurface:=", false, _
"Length:=", "20mm", _
"Width:=", "20mm", _
"LengthSamples:=", 21 _
"WidthSamples:=", 21 _
"CoordSystem:=", "Global" _
"Height:=", "20mm" _
"HeightSamples:=", 21)
EditFarFieldSphereSetup
Modifies an existing far-field sphere setup.
UI Access Double-click a radiation setup in the project tree to modify its settings.
"PhiStep:=", "<value><unit>",
"UseLocalCS:=", boolean)
EditInfiniteSphereSetup
Modifies an infinite sphere radiation field setup.
"ThetaStep:=", "<value><unit>",
"PhiStart:=", "<value><unit>",
"PhiStop:=", "<value><unit>",
"PhiStep:=", "<value><unit>",
"UseLocalCS:=", boolean)
"PhiStep:=" , "2deg",
"UseLocalCS:=" , False
])
EditLineSetup
Modifies a near field line setup.
Array("NAME:<LineName>",
"UseCustomRadiationSurface:=", <boolean>,
"Line:=", <string, name of specified line>,
"NumPts:=", "<integer, number of points>")
EditNearFieldBoxSetup
Modifies a near field box radiation field setup.
UI Access N/A
[
"NAME:Box1",
"UseCustomRadiationSurface:=", False,
"Length:=" , "20meter",
"Width:=" , "20meter",
"LengthSamples:=" , 21,
"WidthSamples:=" , 21,
"CoordSystem:=" , "Global",
"Height:=" , "20meter",
"HeightSamples:=" , 21
])
EditNearFieldLineSetup
Modifies a near field line setup.
UI Access N/A
])
EditNearFieldRectangleSetup
Modifies a near field rectangle radiation setup.
UI Access N/A.
EditNearFieldSphereSetup
Modifies a near field sphere radiation setup.
UI Access N/A
"Radius:=", "20meter", _
"ThetaStart:=", "0deg", "ThetaStop:=", "180deg", "ThetaStep:=", "2deg", _
"PhiStart:=", "-180deg", "PhiStop:=", "180deg", "PhiStep:=", "2deg", _
"UseLocalCS:=", false)
EditRadFieldSourceGroup
Modifies an existing source group definitions for radiation field setup.
UI Access Double-click on a source group setup under Radiation in the project tree.
["NAME:Sources",
"IncPWave1",
"IncPWave2"]
])
EditRectangleSetup
Modifies a near field rectangle radiation setup.
"LengthSamples:=", <value>,
"WidthSamples:=", <value>,
"CoordSystem:=", <string name of coordinate sys-
tem>)
oModule.EditRectangleSetup "Rectangle1", _
Array("NAME:Rectangle1", _
"UseCustomRadiationSurface:=", false, _
VB Example
"Length:=", "20meter", "Width:=", "20meter", _
"LengthSamples:=", 41, "WidthSamples:=", 41, _
"CoordSystem:=", "Global")
EditSphereSetup
Modifies a near field sphere radiation setup.
"UseLocalCS:=", <boolean>)
oModule.EditSphereSetup "Sphere1", _
Array("NAME:Sphere2", _
"UseCustomRadiationSurface:=", false, _
VB Example "Radius:=", "20meter", _
"ThetaStart:=", "0deg", "ThetaStop:=", "180deg", "ThetaStep:=", "2deg", _
"PhiStart:=", "-180deg", "PhiStop:=", "180deg", "PhiStep:=", "2deg", _
"UseLocalCS:=", false)
InsertBoxSetup
Inserts a near-field box radiation setup.
UI Access HFSS > Radiation > Insert Near Field Setup > Box.
"Height:=", <string>,
"HeightSamples:=", <int>)
For UseCustomRadiationSurface parameter, provide value if
True. If False, radiation boundary/PML boundaries will be used
as radiation surfaces.
InsertFarFieldSphereSetup
Inserts a far field infinite sphere setup.
UI Access N/A
"ThetaStop:=", "<value><unit>",
"ThetaStep:=", "<value><unit>",
"PhiStart:=", "<value><unit>",
"PhiStop:=", "<value><unit>",
"PhiStep:=", "<value><unit>",
"UseLocalCS:=", boolean)
"PhiStop:=" , "180deg",
"PhiStep:=" , "2deg",
"UseLocalCS:=" , False
])
VB Syntax InsertFarFieldSphereSetup<SphereParams>
oModule.InsertFarFieldSphereSetup _
Array("NAME:Infinite Sphere1", _
"UseCustomRadiationSurface:=", false, _
"CSDefinition:=", "Theta-Phi", _
VB Example "Polarization:=", "Linear", _
"ThetaStart:=", "0deg", "ThetaStop:=", "180deg", _
"ThetaStep:=", "2deg", "PhiStart:=", "-180deg", _
"PhiStop:=", "180deg", "PhiStep:=", "2deg", _
"UseLocalCS:=", false)
InsertInfiniteSphereSetup
Inserts an infinite sphere radiation field setup.
UI Access Right-click on Radiation in the project tree, select Insert Far Field Setup > Infinite Sphere...
Array("NAME:<InfSphereName>",
"UseCustomRadiationSurface:=", <boolean>,
"CSDefinition:=", <string, "Theta-Phi" | "Az Over EI"
| "EI Over AS">,
"Polarization:=", <string, "Linear" | "Slant">,
"ThetaStart:=", "<value><unit>",
"ThetaStop:=", "<value><unit>",
"ThetaStep:=", "<value><unit>",
"PhiStart:=", "<value><unit>",
"PhiStop:=", "<value><unit>",
"PhiStep:=", "<value><unit>",
"UseLocalCS:=", boolean)
"Polarization:=" , "Linear",
"ThetaStart:=" , "0deg",
"ThetaStop:=" , "180deg",
"ThetaStep:=" , "2deg",
"PhiStart:=" , "-180deg",
"PhiStop:=" , "180deg",
"PhiStep:=" , "2deg",
"UseLocalCS:=" , False
])
InsertLineSetup
Inserts a near field line setup.
UI Access Right-click on Radiation in the project tree, select Insert Near Field Setup > Line...
InsertNearFieldBoxSetup
Inserts a near field box radiation field setup.
UI Access N/A
"UseCustomRadiationSurface:=", false, _
"Length:=", "20meter", "Width:=", "20meter", _
"LengthSamples:=", 21, "WidthSamples:=", 21, _
"CoordSystem:=", "Global", _
"Height:=", "20meter", "HeightSamples:=", 21)
InsertNearFieldLineSetup
Inserts a near field line setup.
UI Access N/A
"UseCustomRadiationSurface:=", False,
"Line:=" , "Polyline1",
"NumPts:=" , "1000"
])
VB Syntax InsertNearFieldLineSetup<LineParams>
oModule.InsertNearFieldLineSetup _
Array("NAME:Line1", _
VB Example
"UseCustomRadiationSurface:=", false, _
"Line:=", "Polyline1", "NumPts:=", "1000")
InsertNearFieldRectangleSetup
Inserts a near field rectangle radiation setup.
UI Access N/A
"LengthSamples:=", <value>,
"WidthSamples:=", <value>,
"CoordSystem:=", <string name of coordinate sys-
tem>)
Array("NAME:Rectangle1", _
"UseCustomRadiationSurface:=", false, _
"Length:=", "20meter", "Width:=", "20meter", _
"LengthSamples:=", 41, "WidthSamples:=", 41, _
"CoordSystem:=", "Global")
InsertNearFieldSphereSetup
Inserts a near field sphere radiation setup.
UI Access N/A
"UseCustomRadiationSurface:=", false, _
"Radius:=", "20meter", _
"ThetaStart:=", "0deg", "ThetaStop:=", "180deg", "ThetaStep:=", "2deg", _
"PhiStart:=", "-180deg", "PhiStop:=", "180deg", "PhiStep:=", "2deg", _
"UseLocalCS:=", false)
InsertRectangleSetup
Inserts a near field rectangle radiation setup.
UI Access Right-click on Radiation in the project tree ,select Insert Near Field Setup > Rectangle...
InsertSphereSetup
Inserts a near field sphere radiation setup.
UI Access Right-click on Radiation in the project tree ,select Insert Near Field Setup > Sphere...
[
"NAME:Sphere2",
"UseCustomRadiationSurface:=", False,
"Radius:=" , "20meter",
"ThetaStart:=" , "0deg",
"ThetaStop:=" , "180deg",
"ThetaStep:=" , "2deg",
"PhiStart:=" , "-180deg",
"PhiStop:=" , "180deg",
"PhiStep:=" , "2deg",
"UseLocalCS:=" , False
])
UI Access Right-click on Radiation in the project tree, select Antenna Array Setup...
"WidthSpacingInWavelength:=", "<value>",
"Width:=", "<value><unit>",
"WidthInWavelength:=", "<value>",
"LengthSpacing:=", "<value><unit>",
"LengthSpacingInWavelength:=", "<value>",
"Length:=", "<value><unit>",
"LengthInWavelength:=", "<value>",
"SymmetryType:=", <integer>,
"StaggerAngle:=", "<value><unit>",
"StaggerType:=", <integer>,
"UDirnX:=", "<integer>",
"UDirnY:=", "<integer>",
"UDirnZ:=", "<integer>",
"VDirnX:=", "<integer>",
"VDirnY:=", "<integer>",
"VDirnZ:=", "<integer>",
"WeightType:=", <integer>,
"EdgeTaperX_db:=", "<integer>",
"CosineExp:=", "<integer>",
"DifferentialType:=", <integer>,
"Behavior:=", <string>,
"ScanAnglePhi:=", "<value><unit>",
"ScanAngleTheta:=", "<value><unit>",
"UDirnPhaseShift:=", "<value><unit>",
"VDirnPhaseShift:=", "<value><unit>")
<CustomArrayParams> Array Structured array.
Array("NAME:CustomArray",
"NumCells:=", <int>,
<CellsParamsArray>)
<CellsParamsArray> Array Structured array.
Array("NAME:Cell",
<CellParams>, <CellParams>, ...)
<CellParams> Array Structured array.
Array("Name:<CellName>",
"XCoord:=", <double>,
"YCoord:=", <double>,
"ZCoord:=", <double>,
"Amplitude:=", <double>,
"Phase:=", <double>)
"StaggerAngle:=" , "0deg",
"StaggerType:=" , 0,
"UDirnX:=" , "0",
"UDirnY:=" , "0",
"UDirnZ:=" , "-1",
"VDirnX:=" , "1",
"VDirnY:=" , "0",
"VDirnZ:=" , "0",
"WeightType:=" , 3,
"EdgeTaperX_db:=" , "-200",
"CosineExp:=" , "1",
"DifferentialType:=" , 0,
"Behavior:=" , "UseSlaveSettings",
"ScanAnglePhi:=" , "135deg",
"ScanAngleTheta:=" , "45deg",
"UDirnPhaseShift:=" , "0deg",
"VDirnPhaseShift:=" , "0deg"]
])
Script Commands for Exporting Antenna Parameters and Max Field Parameters
ExportRadiationParametersToFile
ExportElementPatternToFile
ExportElementPatternToFile
Exports far field data for specified elements to a file.
ExportFieldsToFile
Exports fields to a file.
UI Access From the Antenna Parameters dialog box, Export Fields to .ffd file.
"DesignVariationKey:=", "",
"SolutionName:=", "4500MHz : LastAdaptive",
"Quantity:=", ""
])
ExportParametersToFile
Exports antenna parameters to a file.
VB Syntax ExportParametersToFile(<DefParams>
oModule.ExportParametersToFile _
Array("ExportFileName:=", "C:/exportparams.txt", _
"SetupName:=", "Infinite Sphere1", _
VB Example "IntrinsicVariationKey:=", "Freq=\'4.5GHz\'", _
"DesignVariationKey:=", "", _
"SolutionName:=", "4500MHz : LastAdaptive", _
"Quantity:=", "")
ExportRadiationFieldsToFile
Exports radiation fields to a file.
UI Access N/A
"IntrinsicVariationKey:=", "Freq=" & Chr(39) & "6GHz" & Chr(39) & "", _
"DesignVariationKey:=", "",
"SolutionName:=", "Setup1 : LastAdaptive", _
"SourceGroupName:=", "Source Group1", _
"Quantity:=", "")
ExportRadiationParametersToFile
Exports radiation parameters to a file. This command can be used to export the max quantities of a near-field setup and, in the case of
far fields, the antenna parameters to the specified file.
[
"ExportFileName:=", "C:\projects\exportantparams.txt",
"SetupName:=", "Infinite Sphere1",
"IntrinsicVariationKey:=", "Freq='10GHz'",
"DesignVariationKey:=", "",
"SolutionName:=", "LastAdaptive"
])
Note: Only Name and Type are required parameters. If you set a custom Theta or Phi parameter, then you must set all
Theta and Phi parameters. If you have a local coordinate system, then you must set the CS and UseLocalCS parameters.
In the Project Manager under the design name, right click Radiation and in the right-click menu, click Insert Far
UI Access
Field Setup>Infinite Sphere.
oModule.Add(
[
"NAME:<Name>",
"Type:=" , "InfiniteSphereFarField",
"VersionID:=" , 0,
"ID:=" , <ID>,
"StartTheta:=" , "<StartTheta>deg",
Python Syntax "StartPhi:=" , "<StartPhi>deg",
"StopTheta:=" , "<StopTheta>deg",
"StopPhi:=" , "<StopPhi>deg",
"StepTheta:=" , "<StepTheta>deg",
"StepPhi:=" , "<StapPhi>deg",
"CS:=" , <CS>,
"UseLocalCS:=" , <UseLocalCS>
])
oDesign = oDesign.GetModule("RadiationSetupMgr")
oModule.Add(
[
Python Example
"NAME:Infinite Sphere 1",
"Type:=", "InfiniteSphereFarField",
"VersionID:=", 0,
"ID:=", 5,
"StartTheta:=", "0deg",
"StartPhi:=", "-180deg",
"StopTheta:=", "180deg",
"StopPhi:=", "180deg",
"StepTheta:=", "2deg",
"StepPhi:=", "2deg",
"CS:=", 1,
"UseLocalCS:=", False
])
Note: Only Name and Type are required parameters. If you set a custom Theta or Phi parameter, then you must set all
Theta and Phi parameters. If you have a local coordinate system, then you must set the CS and UseLocalCS parameters.
UI Access In the Project Manager under the design name > Radiation, double click on the name of the infinite sphere.
oModule.Edit(
[
"NAME:<Name>",
"Type:=" , "InfiniteSphereFarField",
"VersionID:=" , 0,
"ID:=" , <ID>,
"StartTheta:=" , "<StartTheta>deg",
Python Syntax "StartPhi:=" , "<StartPhi>deg",
"StopTheta:=" , "<StopTheta>deg",
"StopPhi:=" , "<StopPhi>deg",
"StepTheta:=" , "<StepTheta>deg",
"StepPhi:=" , "<StapPhi>deg",
"CS:=" , <CS>,
"UseLocalCS:=" , <UseLocalCS>
])
oDesign = oDesign.GetModule("RadiationSetupMgr")
Python Example
oModule.Edit(
[
"NAME:Infinite Sphere 1",
"Type:=", "InfiniteSphereFarField",
"VersionID:=", 0,
"ID:=", 5,
"StartTheta:=", "0deg",
"StartPhi:=", "-180deg",
"StopTheta:=", "180deg",
"StopPhi:=", "180deg",
"StepTheta:=", "2deg",
"StepPhi:=", "2deg",
"CS:=", 1,
"UseLocalCS:=", False
])
In the Project Manager under the design name, right click Radiation and in the right-click menu, click Insert
UI Access
Near Field Setup>Line.
oModule.Add(
Python Syntax [
"NAME:<Name>",
"Type:=" , "NearFieldLine",
"VersionID:=" , 0,
"ID:=" , <ID>,
"NFLineID:=", "<NFLineID>",
"NumSamples:=","<NumSamples>"
])
oDesign = oDesign.GetModule("RadiationSetupMgr")
oModule.Add(
[
"NAME:Line 1",
"Type:=", "NearFieldLine",
Python Example
"VersionID:=", 0,
"ID:=", 7,
"NFLineID:=", 312,
"NumSamples:=", "1000"
])
VB
Set oModule = oDesign.GetModule("RadiationSetupMgr")
Example oModule.Add Array("NAME:Line 1", "Type:=", "NearFieldLine", "VersionID:=", 0, "ID:=",
_
4, "NFLineID:=", 312, "NumSamples:=", "1000")
UI Access In the Project Manager under the design name > Radiation, double click on the name of the line.
oModule.Edit(
[
Python Syntax
"NAME:<Name>",
"Type:=" , "NearFieldLine",
"VersionID:=" , 0,
"ID:=" , <ID>,
"NFLineID:=", "<NFLineID>",
"NumSamples:=","<NumSamples>"
])
oDesign = oDesign.GetModule("RadiationSetupMgr")
oModule.Edit(
[
"NAME:Line 1",
"Type:=", "NearFieldLine",
Python Example
"VersionID:=", 0,
"ID:=", 7,
"NFLineID:=", 312,
"NumSamples:=", "1000"
])
In the Project Manager under the design name, right click Radiation and in the right-click menu, click Insert
UI Access
Near Field Setup>Plane.
oModule.Add(
[
"NAME:<Name>",
"Type:=" , "NearFieldPlane",
"VersionID:=" , 0,
"ID:=" , <ID>,
"MinX:=" , "<MinX>",
Python Syntax
"MaxX:=" , "<MaxX>",
"MinY:=" , "<MinY>",
"MaxY:=" , "<MaxY>",
"Height:=" , "<Height>",
"ExpFactor:=" , "<ExpFactor>",
"UseExpFactor:=" , <UseExpFactor>,
"CSID:=" , <CSID>
])
oDesign = oDesign.GetModule("RadiationSetupMgr")
oModule.Add(
[
"NAME:Plane 1",
"Type:=", "NearFieldPlane",
"VersionID:=", 0,
"ID:=", 7,
"MinX:=", "-50mm",
Python Example
"MaxX:=", "25mm",
"MinY:=", "-18.5mm",
"MaxY:=", "31.5mm",
"Height:=", "5.6mm",
"ExpFactor:=", "1",
"UseExpFactor:=", False,
"CSID:=", -4
])
VB Syn- oModule.Add Array("NAME:<Name>", "Type:=", "NearFieldPlane", "VersionID:=", 0, "ID:=", <ID>, "MinX:=", "<MinX>",
tax "MaxX:=", "<MaxX>", "MinY:=", "<MinY>", "MaxY:=", "<MaxY>", "Height:=", "<Height>", "ExpFactor:=", "<ExpFactor>",
"CSID:=",<CSID>)
Set oModule = oDesign.GetModule("RadiationSetupMgr")
oModule.Add Array("NAME:Plane 1", "Type:=", "NearFieldPlane", "VersionID:=", 0,
VB "ID:=", _
Example 2, "MinX:=", "-49mm", "MaxX:=", "19mm", "MinY:=", "-11mm", "MaxY:=", "29mm",
"Height:=", _
"4.652145mm", "ExpFactor:=", "1", "UseExpFactor:=", false, "CSID:=", -3)
UI Access In the Project Manager under the design name > Radiation, double click on the name of the plane.
factor to determine new dimensions for the plane. For example, set
to 1 to use the default calculated dimensions of the plane or set to 2
to double each dimension of the plane. Use the form "<num>".
<UseExpFactor> Boolean Optional. Set to True to add the exponent factor to the plane dimen-
sions or False to use the automatically calculated plane dimen-
sions or user-defined plane dimensions.
<CSID> Integer Optional. An identifier for the coordinate system.
oModule.Edit(
[
"NAME:<Name>",
"Type:=" , "NearFieldPlane",
"VersionID:=" , 0,
"ID:=" , <ID>,
Python Syntax
"MinX:=" , "<MinX>",
"MaxX:=" , "<MaxX>",
"MinY:=" , "<MinY>",
"MaxY:=" , "<MaxY>",
"Height:=" , "<Height>",
"ExpFactor:=" , "<ExpFactor>",
"UseExpFactor:=" , <UseExpFactor>,
"CSID:=" , <CSID>
])
oDesign = oDesign.GetModule("RadiationSetupMgr")
oModule.Edit(
[
"NAME:Plane 1",
"Type:=", "NearFieldPlane",
"VersionID:=", 0,
"ID:=", 7,
"MinX:=", "-50mm",
Python Example
"MaxX:=", "25mm",
"MinY:=", "-18.5mm",
"MaxY:=", "31.5mm",
"Height:=", "5.6mm",
"ExpFactor:=", "1",
"UseExpFactor:=", False,
"CSID:=", -4
])
VB Syn- oModule.Edit Array("NAME:<Name>", "Type:=", "NearFieldPlane", "VersionID:=", 0, "ID:=", <ID>, "MinX:=", "<MinX>",
"MaxX:=", "<MaxX>", "MinY:=", "<MinY>", "MaxY:=", "<MaxY>", "Height:=", "<Height>", "ExpFactor:=", "<ExpFactor>",
tax
"CSID:=",<CSID>)
Set oModule = oDesign.GetModule("RadiationSetupMgr")
oModule.Edit Array("NAME:Plane 1", "Type:=", "NearFieldPlane", "VersionID:=", 0,
VB "ID:=", _
Example 2, "MinX:=", "-49mm", "MaxX:=", "19mm", "MinY:=", "-11mm", "MaxY:=", "29mm",
"Height:=", _
"4.652145mm", "ExpFactor:=", "1", "UseExpFactor:=", false, "CSID:=", -3)
Note: Only Name and Type are required parameters. If you set a custom Theta or Phi parameter, then you must set all
Theta and Phi parameters. If you have a local coordinate system, then you must set the CS and UseLocalCS parameters.
In the Project Manager under the design name, right click Radiation and in the right-click menu, click Insert
UI Access
Near Field Setup>Sphere.
<StartPhi> String Optional. Starting point for phi in the spherical coordinate system
for the sphere being defined. The default value is "-180deg". Use
the form "<num>deg".
<StopTheta> String Optional. Stopping point for theta in the spherical coordinate sys-
tem for the sphere being defined. The default value is "180deg".
Use the form "<num>deg".
<StopPhi> String Optional. Stopping point for phi in the spherical coordinate system
for the sphere being defined. The default value is "1800deg". Use
the form "<num>deg".
<StepTheta> String Optional. Step size between the start and the stop theta values at
which the far field is calculated. The default value is "2deg". Use
the form "<num>deg".
<StepPhi> String Optional. Step size between the start and the stop phi values at
which the far field is calculated. The default value is "2deg". Use
the form "<num>deg".
<CS> Integer Optional. The coordinate system to use. When coordinate system
is local, set this number to the index of the local coordinate system.
Set this value to -1 for a global coordinate system. The default
value is -1.
<UseLocalCS> Boolean Optional. True to select a local coordinate system, and False to
use the global coordinate system. The default value is False.
<NFRadius> String Optional. Radius of the sphere we want to calculate near fields on.
The default value is "20mm".Use the form "<num><unit>".
oModule.Add(
[
Python Syntax
"NAME:<Name>",
"Type:=" , "InfiniteSphereFarField",
"VersionID:=" , 0,
"ID:=" , <ID>,
"StartTheta:=" , "<StartTheta>deg",
"StartPhi:=" , "<StartPhi>deg",
"StopTheta:=" , "<StopTheta>deg",
"StopPhi:=" , "<StopPhi>deg",
"StepTheta:=" , "<StepTheta>deg",
"StepPhi:=" , "<StapPhi>deg",
"CS:=" , <CS>,
"UseLocalCS:=" , <UseLocalCS>,
"NFRadius:=", "<NFRadius>"
])
oDesign = oDesign.GetModule("RadiationSetupMgr")
oModule.Add(
[
"NAME:Sphere 1",
Python Example
"Type:=", "NearFieldSphere",
"VersionID:=", 0,
"ID:=", 7,
"StartTheta:=", "0deg",
"StartPhi:=", "-180deg",
"StopTheta:=", "180deg",
"StopPhi:=", "180deg",
"StepTheta:=", "2deg",
"StepPhi:=", "2deg",
"CS:=", -1,
"UseLocalCS:=", False,
"NFRadius:=", "20mm"
])
Note: Only Name and Type are required parameters. If you set a custom Theta or Phi parameter, then you must set all
Theta and Phi parameters. If you have a local coordinate system, then you must set the CS and UseLocalCS parameters.
UI Access In the Project Manager under the design name > Radiation, double click on the name of the near-field sphere.
<UseLocalCS> Boolean Optional. True to select a local coordinate system, and False to
use the global coordinate system.
<NFRadius> String Optional. Radius of the sphere we want to calculate near fields on.
Use the form "<num><unit>".
oModule.Edit(
[
"NAME:<Name>",
"Type:=" , "InfiniteSphereFarField",
"VersionID:=" , 0,
"ID:=" , <ID>,
"StartTheta:=" , "<StartTheta>deg",
"StartPhi:=" , "<StartPhi>deg",
Python Syntax
"StopTheta:=" , "<StopTheta>deg",
"StopPhi:=" , "<StopPhi>deg",
"StepTheta:=" , "<StepTheta>deg",
"StepPhi:=" , "<StapPhi>deg",
"CS:=" , <CS>,
"UseLocalCS:=" , <UseLocalCS>,
"NFRadius:=", "<NFRadius>"
])
oDesign = oDesign.GetModule("RadiationSetupMgr")
oModule.Edit(
[
"NAME:Sphere 1",
"Type:=", "NearFieldSphere",
"VersionID:=", 0,
"ID:=", 7,
"StartTheta:=", "0deg",
Python Example "StartPhi:=", "-180deg",
"StopTheta:=", "180deg",
"StopPhi:=", "180deg",
"StepTheta:=", "2deg",
"StepPhi:=", "2deg",
"CS:=", -1,
"UseLocalCS:=", False,
"NFRadius:=", "20mm"
])
21-26
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
You can find examples of how to use these methods on each of the methods' pages. A complete example of a Python script is also
available, as is an example with a line by line explanation.
AddDocument
Creates a new document based on provided data and traces. The document names come from UserDefinedDocument folder under
syslib, userlib, and personallib. This creates a document and places it in the Project Manager under Results > Documents.
UI Access Right click on Results > Create Document. Choose a document name.
In this example, the document names come from the UserDefinedDocument folder in the syslib, userlib, and personallib
folders. This creates a document and places it in the Documents folder under results.
oModule.AddDocument _
Array("NAME:Design Summary", _
"", "SysLib", "DesignSummary", _
Array("NAME:Inputs")), _
Array("NAME:DocTraces")
The following example is explained in Explication of a Sample UDD Script.
oModule.AddDocument Array("NAME:Test Report1", "Test Report", "SysLib", _
"Examples/TestUDDInputs", Array("NAME:Inputs", Array("NAME:DLMetrics", "Solution", _
"Data Line Metrics", -1, -1), Array("NAME:DQ0", "Trace", "DQ0", -1, -1), _
VB
Example Array("NAME:DQS", "Trace", "DQS", -1, -1), _
Array("NAME:Name", "Text", "User Name", Array("Sita Ramesh")), _
Array("NAME:Summary", "Bool", "Display Summary", Array(true)), _
Array("NAME:Version", "Number", "Script Version"))), _
Array("NAME:DocTraces", Array("NAME:DLMetrics", _
Array("User Defined", "", "DDR3 AC-Timing 4-DQ1", Array("Context:=", ""), _
Array("Index:=", Array("All"), "Trise:=", Array( "Nominal"), "Tfall:=", _
Array("Nominal"), "Pulse_Width:=", Array("Nominal"), _
"Data_Rate:=", Array( "Nominal"),"Length:=", Array("Nominal")), _
Array("Probe Component:=", Array("")), Array())), _
Array("NAME:DQ0", Array( _
DeleteAllDocuments
Deletes all documents in the object.
UI Access Right click on Documents in the Project Manager and click Delete All Documents.
Parameters None.
Return Value None.
VB Syntax DeleteAllDocuments
VB Example oModule.DeleteAllDocuments
DeleteDocument
Deletes a specified document.
UI Access Right click on the created document in the Project Manager under Results > Documents and click Delete.
EditDocument
Edits specified documents. If the document pops up a dialog box, the user can make a change the inputs for the document. The doc-
ument is regenerated and updated. A new one is not created.
Right click on the created document in the Project Manager under Results > Documents and click Modify doc-
UI Access
ument.
GetDocumentDefinitionNames
Document definition names are the list of names that can be used to create a document. They appear when you click on Create doc-
ument. This method returns the filenames of document definitions according to the files in the installation directories:
l syslib/UserDefinedDocuments
l userlib/UserDefinedDocuments
l personalllb/UserDefinedDocuments
UI Access NA
GetDocumentNames
Retrieves the names for all documents.
UI Access N/A
Parameters None.
Return Value Array of strings containing document names.
VB Syntax GetDocumentNames
VB Example oModule.GetDocumentNames
RenameDocument
Changes the name of a document.
UI Access Right click on the created document in the Project Manager under Results> Documents and click Rename.
SaveHtmlDocumentAs
Saves a pre-existing HTML file to a different name and/or location.
Right click on the created document in the Project Manager under Results > Documents and click Save As >
UI Access
HTML.
SavePdfDocumentAs
Saves a pre-existing PDF file to a different name and/or location.
Right click on the created document in the Project Manager under Results > Documents and click Save As >
UI Access
PDF.
UpdateAllDocuments
Refreshes the contents of all created documents. This action is made on the folder rather than the individual document.
UI Access Right click on Results > Documents in the Project Manager and click Update All Documents.
Parameters None.
Return Value None.
VB Syntax UpdateAllDocuments
VB Example oModule.UpdateAllDocuments
UpdateDocument
Refreshes the contents of the selected document.
Right click on the created document in the Project Manager under Results > Documents and click Update
UI Access
Document.
ViewHtmlDocument
Displays a pre-existing document as HTML.
Right click on the created document in the Project Manager under Results > Documents and click View Xml
UI Access
Document.
ViewPdfDocument
Displays a pre-existing document as a PDF file.
Right click on the created document in the Project Manager under Results > Documents and click View PDF
UI Access
Document.
' This array contains trace selection for the solution and trace inputs.
Array("NAME:DocTraces", ' Document traces keyword
' This array defines a trace similar to the UDO. This trace definition is a User defined solution
Array("User Defined", "", "DDR3 AC-Timing 4-DQ1", Array("Context:=", ""), Array("Index:=", Array
("All"), "Trise:=", Array("Nominal"), "Tfall:=", Array("Nominal"), "Pulse_Width:=", Array("Nom-
inal"), "Data_Rate:=", Array("Nominal"), "Length:=", Array("Nominal")), Array("Probe Com-
ponent:=", Array("")), Array())),
' This array defines a trace similar to the UDO. This trace definition is a Standard solution.
Array("Standard", "DQ0", "NexximTransient", Array("NAME:Context", "SimValueContext:=", Array(1,
0, 2, 0, false, false, -1, 1, 0, 1, 1, "", 0, 0, "DE", false, "0", "DP", _
false, "20000000", "DT", false, "0.001", "WE", false, "100ns", "WM", false, _
"100ns", "WN", false, "0ps", "WS", false, "0ps")), Array("Time:=", Array("All"), "Trise:=",
Array( _
"Nominal"), "Tfall:=", Array("Nominal"), "Pulse_Width:=", Array("Nominal"), "Data_Rate:=", Array
("Nominal"), "Length:=", Array("Nominal")), Array("Probe Component:=", Array( _
"DQ0")), Array())))
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oProject = oDesktop.SetActiveProject("BJT_Inverter")
oDesign = oProject.SetActiveDesign("Nexxim1")
oModule = oDesign.GetModule("UserDefinedSolutionModule")
],
[]
],
[
"Standard",
"probe2",
"Transient",
[
"NAME:Context",
"SimValueContext:=", [1,0,2,0,False,False,-
1,1,0,1,1,"",0,0,"DE",False,"0","DP",False,"500000000","DT",False,"0.001","NUMLEVELS",False,"0",-
"WE",False,"10us","WM",False,"10us","WN",False,"0ns","WS",False,"0ns"]
],
[
"Time:=", ["All"]
],
[
"Probe Component:=", ["V(Port1)"]
],
[]
]
],
[])
oModule = oDesign.GetModule("UserDefinedDocuments")
oModule.AddDocument(
[
"NAME:Test Report",
"Test Report",
"SysLib",
"TestUDDInputs",
[
"NAME:Inputs",
[
"NAME:UDS1",
"Solution",
"UDS Distance Trace Arithmetic Result1",
1000000,
0
],
[
"NAME:UDS2",
"Solution",
"UDS Distance Trace Arithmetic Result2",
1000000,
2
]
]
],
[
"NAME:DocTraces",
[
"NAME:UDS1",
[
"User Defined",
"",
"UDS Distance Trace Arithmetic Result1",
[
"Context:=", ""
],
[
"Distance:=", ["All"]
],
[
"Probe Component:=", [""]
],
[]
]
],
[
"NAME:UDS2",
[
"User Defined",
"",
"UDS Distance Trace Arithmetic Result1",
[
"Context:=", ""
],
[
"Distance:=", ["All"]
],
[
"Probe Component:=", [""]
],
[]
]
]
])
22-20
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
CreateUserDefinedSolution
DeleteUserDefinedSolutions
EditUserDefinedSolution
CreateUserDefinedSolution
Creates a new user defined solution.
For example:
Array("multiply_factor:=", "2.0", "component_name:=",
"resistor1")
<ProbeSelections> Array Name of the probe being specified. Note: this must match a probe name spe-
cified in the UDS plugin file.
<DynamicProbes> Array Array of <ProbeSelection>'s, representing the probes that are used by
dynamic-probes.
DeleteUserDefinedSolutions
Deletes one or more user defined solutions.
EditUserDefinedSolution
Modifies an existing user defined solution.
UI Access Edit button from the User Defined Solutions dialog box.
GetUserDefinedSolutionNames
Retrieves user defined solution names.
UI Access N/A
Parameters None.
Return Value Array of strings containing solution names.
VB Syntax GetUserDefinedSolutionNames
VB Example oModule.GetUserDefinedSolutionNames
GetUserDefinedSolutionProperties
Obtains properties for a specified user defined solution.
UI Access N/A
23-8
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AddDiffPair
Cascade (SPISim)
ClearDiffPairs
Clone
Close
Combine (SPISim)
Deembed (SPISim)
DeembedBack (SPISim)
DeembedFront (SPISim)
DisableDiffPairs
EnableDiffPairs
ExportCitiFile
ExportFullWaveSpice
ExportMatlab
ExportNMFData
ExportNetworkData
ExportSpreadsheet
ExportTouchstone
ExportTouchstone2
Extract (SPISim)
GetFrequencies
GetFrequencyCount
GetName
GetPortCount
GetPortNumber
GetPostProcSettings
GetSolutionVariation
GetVariation
HasSameData
LoadSolution
Open
Rename (SPISim)
Renormalize (SPISim)
Reorder
Reorder (SPISim)
Reset
SetAllPortImpedances
SetAllPortImpedances
SetPortDeembedDistance
SetPortImpedance
SetPostProcSettings
Smooth
Stretch (SPISim)
Terminate
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
AddDiffPair
Specifies a differential pair from two terminal ports.
From the Network Data Explorer tab, select Differential Pairs in the NDE ribbon to open the Differential
UI Access
Pairs window. Then select differential pairs from the Pairs group box and click Add Pairs >>.
VB Syntax AddDiffPair
VB Example Set success = oPostProc.AddDiffPair 2, 1, "Diff1", "Comm1", 100, 25
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Cascade (SPISim)
Creates new network data from a group of network data objects cascaded together. The network data must have an even number of
terminal ports and must have the same number of ports.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Cascade from the
UI Access
drop-down menu.
Network IDispatch.
Return Value Note: Cascade returns None if the specified network data does not have compatible terminal ports
defined.
VB Syntax Cascade
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData2 = oNDE.Cascade Array(oData1, oData2, oData3)
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
ClearDiffPairs
Clears all differential pair definitions. All other post-processing settings remain the same.
From the Network Data Explorer tab, select Differential Pairs in the NDE ribbon to open the Dif-
UI Access
ferential Pairs window. Then select differential pairs from the rightmost box and click << Remove Pairs.
Parameters None.
Return Value None.
oNDE = oDesktop.GetTool("ndExplorer")
Python Example
oPostProc.ClearDiffPairs()
VB Syntax ClearDiffPairs
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
oPostProc.ClearDiffPairs
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Clone
Creates a copy of the network data object.
From the Network Data Explorer tab, select the network data object to clone. Then select Clone from
UI Access
the NDE ribbon.
Parameters None.
Return Value Network IDispatch.
VB Syntax Clone
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData1 = oData.Clone
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Close
Closes the network data object. The object will no longer be accessible.
UI Access From the Network Data Explorer tab, click Close in the NDE ribbon, or select File > Close.
Parameters None.
Return Value None.
VB Syntax Close
VB Example Set oNDE = oDesktop.GetTool("ndExplorer")
oData.Close
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Combine (SPISim)
Combines frequencies from multiple network data objects to create a new network data with all of the frequencies.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Combine from the
UI Access
drop-down menu.
Network IDispatch.
Return Value
Note: Combine returns None if the network data does not have the same number of ports.
VB Syntax Combine
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData4 = oNDE.Combine Array(oData1, oData2, oData3), 1000
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Deembed (SPISim)
Creates a new network data, dembedding the frontData and the backData from the front and back of the originalData.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Deembed from the
UI Access drop-down menu to open the Deembed... window, and choose Given 3 S-params in order of: Total, Front,
Back from the Settings group box.
<backData> Object Network data that is deembeded from the back of the original.
Network IDispatch.
Return Value Note: Deembed returns None if the specified network data does not have compatible terminal ports
defined.
VB Syntax Deembed
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData2 = oNDE.Deembed oData1, oDataFront, oDataBack
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
DeembedBack (SPISim)
Creates a new network data, dembedding the backData from the back of the originalData.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Deembed from the
UI Access drop-down menu to open the Deembed... window, and choose Given 3 S-params in order of: Total, Back
from the Settings group box.
Network IDispatch.
Return Value Note: DeembedBack returns None if the specified network data does not have compatible terminal
ports defined.
VB Syntax DeembedBack
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData2 = oNDE.DeembedBack oData1, oDataBack
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
DeembedFront (SPISim)
Creates a new network data, dembedding the frontData from the front of the originalData.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Deembed from the
UI Access drop-down menu to open the Deembed... window, and choose Given 3 S-params in order of: Total, Front
from the Settings group box.
Network IDispatch.
Return Value Note: DeembedFront returns None if the specified network data does not have compatible terminal
ports defined.
VB Syntax DeembedFront
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData2 = oNDE.DeembedFront oData1, oDataFront
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
DisableDiffPairs
Deactivates all differential pair definitions. This script does not remove them, so they can be reactivated.
From the Network Data Explorer tab, select Differential Pairs in the NDE ribbon to open the Dif-
ferential Pairs window. Once differential pairs have been added to the rightmost box (i.e., select dif-
UI Access
ferential pairs from the Pairs group box and click Add Pairs >>), remove check marks from the Enabled
column to deactivate the corresponding differential pairs.
Parameters None.
Return Value None.
VB Syntax DisableDiffPairs
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
oPostProc.DisableDiffPairs
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
EnableDiffPairs
Enables all differential pair definitions.
From the Network Data Explorer tab, select Differential Pairs in the NDE ribbon to open the Dif-
ferential Pairs window. Once differential pairs have been added to the rightmost box (i.e., select dif-
UI Access
ferential pairs from the Pairs group box and click Add Pairs >>), add check marks to the Enabled column
to activate the corresponding differential pairs.
Parameters None.
Return Value None.
VB Syntax EnableDiffPairs
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
ExportCitiFile
Writes the S-parameters to disk in Citifile format (*.cit text file).
From the Network Data Explorer tab, select File > Save As to open a Save As explorer window. Then select
UI Access
Citifile (*.cit) from the Save as type: drop-down menu.
l 1 – Real/Imaginary
l 2 – dB/Angle (degrees)
<frequencies> Array of A subset of the calculated frequencies. Any array values that don’t
Doubles have calculated data will be ignored. An empty array will cause all
frequencies to be written.
Return Value Boolean True if file was successfully written; else False.
VB Syntax ExportCitiFile
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set success = oData.ExportCitiFile "D:\folder\ne133.cit", 0, 1, 12, Array()
ExportFullWaveSpice
Use: Export FullWaveSpice data in a format of your choice.
Command: File > Export MacroModel > Broadband (SYZ, FWS….)
Syntax: ExportFullWaveSpice
"DesignName", // Design name. Can be left blank, if loading solution from a file.
true/false, // true - solution loaded from file, false- loaded from design
"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
"variation", // Pick a particular variation. Leave blank if no variation.
Array("NAME:Frequencies"), // Optional; if none defined all frequencies are used
Array("NAME:SpiceData", // Spice export options object
"SpiceType:=", "SSS", // SpiceType can be "PSpice", "HSpice", "Spectre", "SSS",
// "Simplorer", "TouchStone1.0", "TouchStone2.0"
"EnforcePassivity:=", false, // Enforce Passivity true/false
"EnforceCausality:=", false, // Enforce Causality true/false
"UseCommonGround:=", false, // Use common ground true/false
"FittingError:=", 0.5, // Fitting error
"MaxPoles:=", 400, // Maximum Order
"PassivityType:=", "ConvexOptimization", // Passivity Type can be "ConvexOptimization",
// "PassivityByPerturbation", or "IteratedFittingOfPV"
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
ExportMatlab
Writes the S-parameters to disk in Matlab format (*.m text file).
From the Network Data Explorer tab, select File > Save As to open a Save As explorer window. Then select
UI Access
MATLAB (*.m) from the Save as type: drop-down menu.
l 1 – Y-Parameters
l 2 – Z-Parameters
l 3 – Gamma
l 4 – Impedance
<frequencies> Array of A subset of the calculated frequencies. Any array values that don’t
Doubles have calculated data will be ignored. An empty array will cause all
frequencies to be written.
Return Value Boolean True if file was successfully written; else False.
VB Syntax ExportMatlab
Set oNDE = oDesktop.GetTool "ndExplorer"
VB Example
Set success = oData.ExportMatlab "D:\folder\ne133.m", 0, 1, 12, Array()
ExportNMFData
<ReduceMatrix>
Type: <string>
Either "Original" or one of the reduce matrix setup name
<Reference Impedance>
Type: <Double>
Reference impedance
<FrequencyArray>
Type: <Array of doubles>
Value: Array(<double>,<double>….)
Frequency points in the sweep that is exported.
<DesignVariation>
Type: <String>
Design variation at which the solution is exported.
<Format>
Type: <String>
Values: "MagPhase", "RealImag", "DbPhase".
The format in which the sparameters will be exported.
<Length>
Type:<String>
Length for exporting sparameters.
<PassNumber>
Type:<integer>
Pass number.
VB Example:
oDesign.ExportNMFData "Setup7 : LastAdaptive", "C:/temp/neu.nmf", "Original", _ 50, Array
(10000000, 20000000, 30000000, 40000000, 50000000, 60000000, 70000000, _ 80000000, 90000000,
100000000), "", "MagPhase","7meter"
ExportNMFData(
"",
# Empty string.
1,
#The number 1.
"Name",
# This is the full path of the file from which the solution is loaded
Python Syntax
"ExportFile",
# full path of file to export to
["NAME:Frequencies"],
#optional, if none defined all frequencies are used
["NAME:NMFOptions",
#Export NMF options object
"DataTypes:=", ["S"],
#DataTypes can be "S", "Y","Z", "G", and "Z0", for S , Y, Z matrix, Gamma and Z0 (zero)
"DisplayFormat:=", "MA",
#DisplayFormat "MA", "RI", "DB"
"FileType:=", "",
# Export File Type
2 - Spreadsheet(*.tab)
3 - Touchstone(*.sNp)
4 - Citifile(*.cit)
6 - Neutral format(*.nmf)
7 - Matlab format(*.m)
"Renormalize:=", false,
#Renormalize true/false
"RefImpedance:=",50,
# Reference Impedance
"Precision:=", 8,
# Number of digits Precision
"Variables:=", ["FF", "cap", "Rs"]
# Array of variables
"Variations:=", ["", "", ""]
# Array of variations to export solutions for
["NAME:ConstantVars"]
#Array of variables that are constant, can be empty
["NAME: DependentVars"]
#Array of variables that are dependent, can be empty
"MatrixSize:=", 2,
#Matrix size, optional (used in nmf file header)
"CreateNPortModel:=", true
#Create a model based on the exported file true/false
])
oTool = oDesktop.GetTool("NdExplorer")
oTool.ExportNetworkData("", True,
"C:/.../100OHM.S2P", "$SYSLIB/Test.s2p", "",
[
"NAME:Frequencies",
500000000,
Python Example
1000000000,
10000000000,
25000000000,
50000000000,
75000000000,
100000000000
],
[
"NAME:TSOptions",
"DataTypes:=" , ["S"],
"DisplayFormat:=" , "DB",
"FileType:=" , 3,
"Renormalize:=" , True,
"RefImpedance:=" , 50,
"Precision:=" , 6,
"UseMultipleCores:=" , False,
"NumberOfCores:=" , 1,
"Comments:=" , True,
"Noise:=" , False
])
ExportNetworkData
Exports matrix solution data to a file. Available only for Driven solution types with ports.
UI Access N/A
0 = Magnitude/Phase.
1= Real/Imaginary.
2= db/Phase.
<Precision> Integer Optional. Touchstone number of digits precision. Default if not spe-
cified is 15.
<UseExportFreqs> Boolean Specifies whether to use export frequencies.
<IncludeGammaComments> Boolean Specifies whether to include Gamma and Impedance comments.
<SupportNonStdExport> Boolean Specifies whether to support non-standard Touchstone extensions
for mixed reference impedance.
oModule.ExportNetworkData "width=’2in’", _
Array("Setup1:Sweep1"),2, "c:\mydir\out.tab", _
Array("all"), false, 0
VB Example oModule.ExportNetworkData "width=’2in’", _
Array("Setup1:Sweep1", "Setup1:Sweep2"), 3, _
"c:\mydir\out.s2p", Array(1.0e9, 1.5e9, 2.0e9), _
true, 50.0
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
ExportSpreadsheet
Writes the S-parameters to disk in spreadsheet format (*.tab text file).
From the Network Data Explorer tab, select File > Save As to open a Save As explorer window. Then select
UI Access
Data Table (spreadsheet) (*.tab) from the Save as type: drop-down menu.
<frequencies> Array of A subset of the calculated frequencies. Any array values that don’t
Doubles have calculated data will be ignored. An empty array will cause all
frequencies to be written.
<renormalize> Boolean If True, will renormalize the data to the value of renormImpedance
before writing.
<renormImpedance> Double Data will be renormalized to this impedance before writing only if
renormalize is True.
Return Value Boolean True if file was successfully written; else False.
VB Syn- ExportSpreadsheet
tax
VB Set oData=oDesktop.GetTool("ndExplorer")
Example success = oData.ExportSpreadsheet "D:\folder\ne133.tab", 0, 1, 12, Array(), True, 23
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
ExportTouchstone
Writes the S-parameters to disk in Touchstone 1.0 format (*.snp text file).
From the Network Data Explorer tab, select File > Save As to open a Save As explorer window. Then select
UI Access
Touchstone Format 1.0 (*.snp) from the Save as type: drop-down menu.
Parameters
<formalType> Integer One of the following:
l 0 – Magnitude/Angle (degrees)
l 1 – Real/Imaginary
l 2 – dB/Angle (degrees)
<frequencies> Array of A subset of the calculated frequencies. Any array values that don’t
Doubles have calculated data will be ignored. An empty array will cause all
frequencies to be written.
<renormalize> Boolean If True, will renormalize the data to the value of renormImpedance
before writing.
<renormImpedance> Double Data will be renormalized to this impedance before writing only if
renormalize is True.
Return Value Boolean True if file was successfully written; else False.
Python ExportTouchstone()
Syntax
VB Syn- ExportTouchstone
tax
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
ExportTouchstone2
Writes the S-parameters to disk in Touchstone 2 format (*.ts text file).
From the Network Data Explorer tab, select File > Save As to open a Save As explorer window. Then select
UI Access
Touchstone 2 Format (*.ts) from the Save as type: drop-down menu.
l 1 – Real/Imaginary
l 2 – dB/Angle (degrees)
<frequencies> Array of A subset of the calculated frequencies. Any array values that don’t
Doubles have calculated data will be ignored. An empty array will cause all
frequencies to be written.
<renormalize> Boolean If True, will renormalize the data to the value of renormImpedance
before writing.
<renormImpedance> Double Data will be renormalized to this impedance before writing only if
renormalize is True.
Return Value Boolean True if file was successfully written; else False.
Python ExportTouchstone2()
Syntax
VB Syn- ExportTouchstone2
tax
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Extract (SPISim)
Creates a new smaller network data after removing data for the specified terminal port numbers.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Extract from the drop-
UI Access
down menu.
VB Syntax Extract
Set oNDE = oDesktop.GetTool "ndExplorer"
VB Example
Set oData2 = oNDE.Extract oData1, Array(3, 2)
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
GetFrequencies
Returns the frequency values with calculated data in the network data.
UI Access None.
Parameters None.
VB Syntax GetFrequencies
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set Freqs = oData.GetFrequencies
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
GetFrequencyCount
Returns the number of frequencies with calculated data in the network data.
UI Access None.
Parameters None.
Return Value Integer number of frequencies.
VB Syntax GetFrequencyCount
Set oData = oDesktop.GetTool("ndExplorer")
VB Example
Set numFreqs = oData.GetFrequencyCount
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
GetName
Returns the name of the network data.
UI Access None.
Parameters None.
Return Value String name.
VB Syntax GetName
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
strName = oNDE.GetName
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
GetPortCount
Returns the total number of ports.
From the Network Data Explorer tab, select Edit Ports in the NDE ribbon to open the Port prop-
UI Access
erties window.
Parameters None.
Return Value Integer number of ports.
VB Syntax GetPortCount
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
num = oData.GetPortCount
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
GetPortNumber
Returns the terminal port number for a given terminal port name.
Note: GetPortNumber can be used in other commands that require a port number, if a port name is preferable.
From the Network Data Explorer tab, ensure the Full Port Names check box is activated. Port numbers will be
UI Access
represented in the object portNames.
VB Syntax GetPortNumber
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
index = oPostProc.GetPortNumber "Input35"
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
GetPostProcSettings
Returns a copy of the IDispatch to the postprocessing settings for the network data (oPostProc).
Note: Making changes to the PostProcSettings will not change the network data. To make changes, call
oData.SetPostProcSettings to change the network data.
UI Access None.
Parameters None.
Return Value PostProcSettings IDispatch
VB Syntax GetPostProcSettings
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oPostProc = oData.GetPostProcSettings
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
GetSolutionVariation
Returns the network data object corresponding to a variation of the solution.
UI Access None.
VB Syntax GetSolutionVariation
VB Example Set oNDE = oDesktop.GetTool("ndExplorer")
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
GetVariation
Returns the variation key for the network data.
UI Access None.
Parameters None.
Return Value String variation key.
VB Syntax GetVariation
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set variation = oData.GetVariation
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
HasSameData
Compares one network data object with another network data. Actual calculated values will be compared and no interpolation will be
done.
UI Access None.
<compareNoise> Boolean If True, and both network data have noise data, the comparison will
fail unless the noise values also match.
Return Value Boolean True if the compared network data have the same frequency and matrix values; otherwise, False.
VB Syntax HasSameData
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set success = oData.HasSameData oData2, 0, True, False, 1e-10, 0
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
LoadSolution
Loads the specified design (all variations) and returns an integer ID.
After analyzing a design, from the Project Manager window, expand the Project Tree and Analysis folders.
UI Access Then right-click on the completed analysis icon and select Network Data Explorer to open the solution in the
Network Data Explorer tab.
Return Value Integer ID (identifying the solution); < 0 if the solution is not loaded.
VB Syntax LoadSolution
VB Example Set oNDE = oDesktop.GetTool("ndExplorer")
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Open
Reads contents of file and returns the IDispatch for the new network data.
From the Network Data Explorer tab, select Open in the NDE ribbon, or select File > Open to open an explorer
UI Access
window. Then navigate to the required S-parameter file.
VB Syntax Open
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData = oNDE.Open "D:\folder\test.s2p"
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Rename (SPISim)
Creates a new network data of the same size with the terminal ports renamed.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Rename from the
UI Access
drop-down menu.
VB Syntax Rename
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Renormalize (SPISim)
Creates a new network data of the same size after renormalizing the terminal ports using the specified impedance values.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Renormalize from the
UI Access
drop-down menu.
Network IDispatch.
Return Value
Note: Renormalize returns None if there is not an impedance value for each port.
VB Syntax Renormalize
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
oData2 = oNDE.Renormalize oData1, Array(3, 2)
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Reorder
Rearranges the terminal port entries but does not change the port names (i.e., switching first and third terminal port positions will give
switched values for S(1,1) and S(3,3) but S(Port1,Port1) and S(Port3,Port3) do not change).
From the Network Data Explorer tab, select Edit Ports in the NDE ribbon to open the Port properties win-
UI Access
dow. Click+drag the terminal port rows to reorder them. Make changes, as necessary, then click OK.
VB Syntax Reorder
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
oPostProc.Reorder Array(3, 2, 1)
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Reorder (SPISim)
Creates a new network data with the same number of terminal ports and with the port names in the same order. The data is also
reordered so it corresponds to the new order (e.g., the data for S(Port1, Port1) may correspond to S(Port3, Port3).
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Reorder from the
UI Access
drop-down menu.
<portNumbers> Array of The port numbers in new order (integers between 1 and n).
Integers
Network IDispatch.
Return Value Note: Reorder returns None if the array argument does not contain all the terminal port numbers, in
any order.
VB Syntax Reorder
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData2 = oNDE.Reorder Array(3, 2, 1)
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Reset
Resets the post-processing to what it was when the network data was created.
Note: This is not equivalent to setting post-processing to an empty state. The network data may have been read from a file
or created from solution data that already had post-processing settings.
UI Access From the Network Data Explorer tab, select Reset postprocessing in the NDE ribbon.
Parameters None.
Return Value None.
VB Syntax Reset
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
oPostProc.Reset
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
SetAllPortImpedances
Sets all terminal port impedances in a single call. The impedances are in an array of real or complex values.
Through the UI, the terminal ports can only be edited individually. From the Network Data Explorer tab, select
UI Access
Edit Ports in the NDE ribbon to open the Port properties window. Make changes, then click OK.
Python SetAllPortImpedances()
Syntax
VB Syn- SetAllPortImpedances
tax
Set oData=oDesktop.GetTool("ndExplorer")
VB
Example oPostProc.SetAllPortImpedances Array(23, "2+3i", 50) -or- oData.SetAllPortImpedances
50
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
SetPortDeembedDistance
Sets terminal port impedance for a single port.
From the Network Data Explorer tab, select Edit Ports in the NDE ribbon to open the Port properties window.
UI Access
Make changes, then click OK.
VB Syntax SetPortDeembedDistance
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
oPostProc.SetPortDeembedDistance 2, "20mm"
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
SetPortImpedance
Sets port impedance for a single port.
From the Network Data Explorer tab, select Edit Ports in the NDE ribbon to open the Port properties win-
UI Access
dow. Make changes, then click OK.
VB Syntax SetPortImpedance
VB Example Set oNDE = oDesktop.GetTool("ndExplorer")
oPostProc.SetPortImpedance 2, "25+3i"
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
SetPostProcSettings
Applies postprocessing settings (oPostProc) to the specified network data.
Note: Making changes to the PostProcSettings will not change the network data. To make changes, call
oData.SetPostProcSettings to change the network data.
UI Access None.
VB Syntax SetPostProcSettings
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Smooth
Creates a new network data with values smoothed. The number of adjacent points smoothed is user-specified.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Smooth from the
UI Access
drop-down menu.
VB Syntax Smooth
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData2 = oNDE.Smooth oData1, 3, True
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Stretch (SPISim)
Creates a new network data representing a matrix of transmission lines with the length of those transmission lines multiplied by a
factor of n.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Stretch from the
UI Access
drop-down menu.
Note: Stretch returns None if the network data argument does not represent a matrix of transmission
lines.
VB Syntax Stretch
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData2 = oNDE.Stretch oData1, 3.1
Warning: The following command is preliminary. Its syntax may change. Be prepared to make changes to leg-
acy scripts.
Terminate
Creates a new network data with specified ports terminated.
From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Terminate from the
UI Access
drop-down menu.
<portNumbers> Array of The port numbers that are terminated (integers between 1 and n).
Integers
<termImpedances> Array of The impedance values used to terminate the specified ports.
Complex
Numbers
Network IDispatch.
Return Value Note: Terminate returns None if the port numbers are not valid or there are no impedance value for
the port numbers.
VB Syntax Terminate
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
Set oData2 = oNDE.Terminate oData1, Array(2, 3), Array(23, "10+2i")
Definitions
<propName> = text string
<value> = double
<valueText> = text string
<fileName> = full path file name
<choices> = string containing menu choices separated by commas
<initialChoice> = string containing initial choice for menu; must be one of the <choices>
<scriptName> = string containing name of script stored in project
<bool> is 1 for true or 0 for false
CompInstance Functions
Following are commands that can be used to manipulate properties from a CompInstance script.
The topics for this section include:
GetComponentName
GetEditor
GetInstanceID
GetInstanceName
GetParentDesign
GetPropHost
GetPropServerName
GetComponentName
Returns the name of the component corresponding to this CompInstance.
UI Access NA
None
String
Return Value
name of component (e.g. MS_TRL) and stores it in "name"
VB Syntax GetComponentName()
VB Example name = CompInstance.GetComponentName()
GetParentDesign
Use: Returns an interface to the compInstance's parent design.
Command: None
Syntax: GetParentDesign()
Return Value: Returns interface to design.
Example: Set oDesign2 = CompInstance.GetParentDesign();
Returns the interface to the design containing the compInstance.
This interface can be used to call Design functions. See: Design Object Script Commands.
GetPropServerName
Use: Returns the PropServerName of the Component corresponding to this CompInstance.
Command: None
Syntax: GetPropServerName()
Return Value: String
VB Example:
name = CompInstance.GetPropServerName();
Returns propserver name of compInstance (e.g., CompInst@MS_TRL;7) and stores it in "name".
68
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ListVariations
RefreshMeshOverlays
RenameSweep
Array("NAME:Sweeps", _
"Variable:=", "F", _
"Data:=", "LINC 1GHz 10GHz 10 LINC 10GHz 12GHz 5"))
Command: None
Syntax: GetSetupData <setup>
Return Value: String array of setup information.
Parameters: <setup>
Type: string
VB Example: oSetup = oDesign.GetModule("SolveSetups")
setup = oSetup.GetSetups()
dat = oSetup.GetSetupData(setup[0])
Example: oModule.ListVariations("NWA1")
26-8
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
27 - Excitations Commands
The following commands are available in the Excitations module. These commands should be executed by the oDesign object. For
example:
oDesign.GetModule("Excitations")
oModule.CommandName <args>
EditCircuitExcitations
EditCircuitPort
EditExcitations
GetAllBoundariesList
GetAllPortsList
RemoveRefPort
Rename
RenameSource
SelectInLayout
CoupleEdgePorts
Use: Couples valid edge ports
Syntax: CoupleEdgePorts(VARIANT coupledlist) //entry containing ports to be coupled
Example: oModule.CoupleEdgePorts Array("Port1", "Port2")
Parameters: <Port_Data>
Type: array
VB Example: oEditor.CreateInterfacePort Array("NAME:NexximPort", "Name:=", "Port1", _
"X:=", -0.00309202168136835, "Y:=", 0.00314928125590086, "Rot:=", 0)
DecoupleEdgePorts
Use: Decouples edge ports
Syntax: DecoupleEdgePorts(
VARIANT decoupledlist) //entry containing ports to be decoupled
Example: oModule.DecoupleEdgePorts Array("Port1:T1", "Port1:T2")
UI Access None.
28-2
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
29 - Cavity Commands
The following commands are available in the Cavities module. These commands should be executed by the oDesign object. For
example:
oDesign.GetModule("Cavities")
oModule.CommandName <args>
29-2
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
30 - Layout Scripting
The Layout scripting interface is a set of commands that can be executed by the Layout Editor interface of Design objects. Accessing
the Layout Editor interface can be done by the SetActiveEditor method of a Design object, for example:
Dim oEditor
oEditor = DesignObject.SetActiveEditor ("Layout")
The call to each scripting method contains three elements:
l Layout editor
l Method name
l Method arguments (if any)
Create Primitives
The following create primitives are available.
CreateCircle
CreateLine
CreatePolygon
CreateRectangle
CreateText
Parameters: <circle_description>:
Array("NAME:Contents",
"circleGeometry:=", <circle_geometry>) // object description
<circle_geometry> :
Array("LayerName:=", <layer_name>, // name of the layer
"lw:=", <value>, // border line width
"x:=", <value>, // center x coordinate
"y:=", <value>, // center y coordinate
"r:=", <value>) // radius
<layer_id> :
integer; never used in scripting
<object_name> :
quoted string, uniquely identifying an object
<value> :
quoted_string_parseable_as_value (e.g. "0.111mm")
VB Example:
oEditor.CreateCircle
Array("NAME:Contents",
"circleGeometry:=",
Array("Layer:=", 6,
"Name:=", "circle_150",
"LayerName:=", "Top",
"lw:=", "0mm",
"x:=", "34mm",
"y:=", "-15mm",
"r:=", "8.60232526704263mm"))
CreateLine (Layout Editor)
Use: Creates a line primitive object.
Syntax: CreateLine <line_description>
Return Value: Returns the name of the newly created object.
Parameters: <line_description>:
Array("NAME:Contents",
"lineGeometry:=", <line_geometry>)
<line_geometry> :
Array("LayerName:=",<layer_name>,
"lw:=", <value>, // line width
"endstyle:=", <end_style>,
"joinstyle:=",<join_style>,
<vertex_sequence> )
<end_style> : integer
FlatEnd = 0
ExtendedEnd = 1
RoundEnd = 2
<join_style> : integer
UnmiteredJoin = 0
MiteredJoin = 1
OptimallyMiteredJoin = 2
RadiallyMiteredJoin = 3
ChordMiteredJoin = 4
<vertex_sequence>:
"LayerName:=", "Top",
"lw:=", "0mm",
"x:=", "29mm",
"y:=", "9.5mm",
"w:=", "24mm",
"h:=", "15mm",
"ang:=", "0deg"))
<polygon_geometry> :
Array("LayerName:=", <layer_name>, // layer
"lw:=", <value>, // border line width
<vertex_sequence> ) // polygon boundary
VB Example:
oEditor.CreatePolygon
Array("NAME:Contents",
"polyGeometry:=",
Array("Layer:=", 6,
"Name:=", "poly_5",
"LayerName:=", "Top",
"lw:=", "0mm",
"n:=", 5,
"x0:=", "-35mm", "y0:=", "17mm",
"x1:=", "-37mm", "y1:=", "5mm",
"x2:=", "-30mm", "y2:=", "8mm",
"x3:=", "-30mm", "y3:=", "8mm",
"x4:=", "-30mm", "y4:=", "8mm"))
"textGeometry:=", <text_geometry>)
<text_geometry> :
Array("LayerName:=", <layer_name>,
"x:=", <value>, // origin X
"y:=", <value>, // origin Y
"ang:=", <value>, // rotation
"isPlot:=", <bool>, // is it plotted or not
"font:=", <font_name>,
"size:=", <value>,
"weight:=", <text_weight>,
"just:=", <text_justification>,
"mirror:=", <bool>,
"text:=", <quoted_string>) // text itself
<text_weight> : integer
Thin = 0,
ExtraLight = 1
Light = 2
Normal = 3
Medium = 4
SemiBold = 5
Bold = 6
ExtraBold = 7
Heavy =8
<text_justification> : integer
LeftTop = 0
LeftBase = 1
LeftBottom = 2
CenterTop = 3
CenterBase= 4
CenterBottom = 5
RightTop = 6
RightBase = 7
RightBottom = 8
VB Example: oEditor.CreateText
Array("NAME:Contents",
"textGeometry:=",
Array("Layer:=", 6,
"Name:=", "text_6",
"LayerName:=", "Top",
"x:=", "-26mm",
"y:=", "-16mm",
"ang:=", "0deg",
"isPlot:=", true,
"font:=", "Roman",
"size:=", "0.508mm",
"weight:=", 3,
"just:=", 4,
"mirror:=", false,
"text:=", "Sample"))
CreateRectangleVoid
"r:=", "1.41421356237309mm"))
"n:=", 3,
"x0:=", "27mm", "y0:=", "5mm",
"x1:=", "35mm", "y1:=", "5mm",
"x2:=", "36mm", "y2:=", "9mm"))
"n:=", 5,
"x0:=", "21mm", "y0:=", "9mm",
"x1:=", "21mm", "y1:=", "5mm",
"x2:=", "24mm", "y2:=", "7mm",
"x3:=", "24mm", "y3:=", "7mm",
"x4:=", "24mm", "y4:=", "7mm"))
Array("Layer:=", 6,
"Name:=", "rect void_16",
"LayerName:=", "Top",
"lw:=", "0mm",
"x:=", "34.5mm",
"y:=", "13mm",
"w:=", "3mm",
"h:=", "2mm",
"ang:=", "0deg"))
Notes:
Each Layer mapping is specified as a single text string in quotes, "<footprint layer>:<design layer>". If the layer does not map to any-
thing, use a "0" for the layer. For example, you can use "Measures:0", if the footprint "Measures" layer does not map to a design layer.
Use "0:Dielectric", if the design "Dielectric" layer does not map to a footprint layer.
Note, also, that the "StackupLayers" and the "DrawLayers" arguments may be omitted, in which case, the mappings are determined
automatically.
<vpoint> :
Array("x:=", <value>, // X coordinate
"y:=", <value>) // Y coordinate
VB Example: oEditor.CreateHole
Array("NAME:Contents",
Array("NAME:full_definition",
"type:=", "hole",
Array("NAME:Properties",
"VariableProp:=",
Array("radius", "D", "", "0.635mm"),
"VariableProp:=",
Array("sides", "D", "", "6")),
"from_layer:=", 6,
"to_layer:=", 6),
"placement:=", Array("x:=", "-36mm", "y:=", "-9mm"),
"layer:=", "Top")
<text_style> :
"name:=", <quoted string>, // its name
"isPlot:=", <bool>,
"font:=", <font_name>,
"size:=", double, // size in current units
"angle:=", <value>,
"weight:=", <text_weight>,
"just:=", <text_justification>,
"mirror:=", <bool>,
"scales:=", <bool>))
VB Example: oEditor.CreateMeasure
Array("NAME:Contents",
"MeasurementGeometry:=",
Array("Layer:=", 0,
"Name:=", "Measurement_2",
"LayerName:=", "Measures",
"lw:=", "0mm",
"sx:=", "-32mm",
"sy:=", "-13mm",
"ex:=", "32mm",
"ey:=", "-11mm",
"name:=", "<DefaultAnnotation>",
"isPlot:=", false,
"font:=", "Arial",
"size:=", 10,
"angle:=", "0deg",
"weight:=", 3,
"just:=", 4,
"mirror:=", false,
"scales:=", false))
<n_lines>
Type: integer
Description: number of line definitions following
<"line">
Type: text
Description: line name
<"width">
Type: text
Description: line width; value with units, e.g. "1mm"
<endstyle>
Type: integer
Description: end (cap) style value for the line.
<joinstyle>
Type: integer
Description: join style value.
<n_vertex>
Type: integer
Description: number of vertices in the line
<value>
Type: double
Description: simple value, e.g. 10
<n_vias>
Type: integer
Description: number of via defintions following
<"via">
Type: text
Description: via name
<"padstack">
Type: text
Description: padstack defintion name.
<"angle">
Type: text
Description: via orientation; value with units, e.g. "180deg"
<override>
Type: boolean (true or false)
Description: if true, the diameter is used to override the via hole definition.
<"diameter">
Type: text
Description: via hole diameter override; a value with units, e.g. "1mm"
<"port">
Type: text
Description: a port or pin name.
<edge description>
for primitive edges
"et:=", "pe", "prim:=", <"prim">, "edge:=", <edge#>
<"prim">
Type: text
Description: primitive name
<edge#>
Type: integer
Description: edge number on the primitive
<edge description>
for via edges
<"via">:
text that is the name of the via to use
<layer id>:
an integer that is the id of the layer of the pad of the via to use
<arc height>:
double giving the height of the edge arc (0 for a straight edge)
<radians>:
double giving the arc size in radians (0 for a straight edge)
"name:=", "",
"vposition:=", Array("x:=", "-22mm", "y:=", "5mm"),
"rotation:=", 0,
"overrides hole:=", false,
"hole diameter:=", Array( "1mm"),
"ReferencedPadstack:=", "Round 1mm/0.5mm",
"highest_layer:=", "Top",
"lowest_layer:=", "Bottom")
…) // etc
VB Example:
oEditor.Connect Array("NAME:elements", "2:n2", "circle_4")
…) // etc
VB Example: oEditor.Disonnect Array("NAME:elements", "2:n2")
<object_description>:
<circle_description> |
<rectangle_description> |
<line_description> |
<polyon_description> |
<text_description> |
<circle_void_description> |
<rectangle_void_description> |
<line_void_description> |
<polyon_void_description> |
<component_description> |
<pin_description> |
<via_description>
VB Example:
oEditor.Edit Array("NAME:items", Array("NAME:item",
"name:=", "circle_0", Array("NAME:contents",
"circleGeometry:=", Array("Layer:=", 6,
"Name:=", "circle_0", "LayerName:=", "Top",
"lw:=", "0mm", "x:=", "-0.008meter",
"y:=", "13.2924281984334mm", "r:=", 10.2924281984334mm")))
"CORNER"
l
<replace> Boolean True to replace original object; False to create new object.
<items> Array Structured array containing object to expand:
Array("NAME:elements",
"<Name of Object to Expand>")
l "MITER"
"CORNER"
l
<replace> Boolean True to replace original object; False to create new object.
<items> Array Structured array containing object to expand:
Array("NAME:elements",
"<Name of Object to Expand>")
Move(Layout Editor)
Use: Translate this Polygon by the vector specified in the provided Point. Return this Polygon.
Syntax: oPolygon.Move(<oPoint>)
Return Value: This Polygon object.
VB Example: oPolygon = oPolygon.Move(oLayout.Point().Set(1,1))
…) // etc
VB Example:
…) // etc
VB Example:
oEditor.DeactivateShort Array("NAME:components", "2", "3")
…) // etc
VB Example:
oEditor.DeactivateShort Array("NAME:components", "2", "3")
UI Access N/A.
Valid <value> strings for this type include: 'pin', 'via', 'rect', 'arc', 'line',
'poly', 'plg', 'circle void', 'line void', 'rect void', 'poly void', 'plg void', 'text',
'cell', 'Measurement', 'Port', 'Port Instance', 'Port Instance Port', 'Edge
Parameters Port', 'component', 'CS', 'S3D', 'ViaGroup'
An asterisk ('*') in the <value> string matches all layers. Vias and pins
match using their defined layer range. 'Multi' matches (non via/pin)
multi-layer objects.
<value> String Specific query. Queries use a basic string match. For instance, an asterisk ('*')
matches anything. All matching is case insensitive.
UI Access N/A.
Valid <value> strings for this type include: 'pin', 'via', 'rect', 'arc', 'line',
'poly', 'plg', 'circle void', 'line void', 'rect void', 'poly void', 'plg void', 'text',
Parameters
'cell', 'Measurement', 'Port', 'Port Instance', 'Port Instance Port', 'Edge
Port', 'component', 'CS', 'S3D', 'ViaGroup'
An asterisk ('*') in the <value> string matches all layers. Vias and pins
match using their defined layer range. 'Multi' matches (non via/pin)
multi-layer objects.
<value> String Specific query. Queries use a basic string match. For instance, an asterisk ('*')
matches anything. All matching is case insensitive.
Syntax: oLayout.GetPolygon(<Name>)
Return Value: Polygon object.
VB Example: oPolygon = oLayout.GetPolygon('line_37')
VB Example:
# Find all objects intersecting box = {(0,0), (1e-3,1e-3)}
p0 = oLayout.Point().Set(0, 0)
p1 = oLayout.Point().Set(1e-3, 0)
p2 = oLayout.Point().Set(1e-3, 1e-3)
p3 = oLayout.Point().Set(0, 1e-3)
box = oLayout.Polyon().AddPoint(p0).AddPoint(p1).AddPoint(p2).AddPoint(p3).SetClosed(True)
objs = oLayout.FindObjectsByPolygon(box, '*')
SetY
GetY
SetArc
IsArc
IsEqual
Mag
Distance
Cross
Move
Rotate
Normalize
DistanceFromLine
ClosestPointOnLine
Set (Layout Editor)
Use: Set both the x and y -coordinates of the Point, in meters. Return this Point.
Syntax: oPoint.Set(<x>, <y>)
Return Value: This Point object.
VB Example: oPoint = oPoint.Set(1e-3, 1e-3)
Syntax: oPoint.SetX(<x>)
Return Value: This Point object.
VB Example: oPoint = oPoint.SetX(1e-3)
Move(Layout Editor)
Use: Translate this Polygon by the vector specified in the provided Point. Return this Polygon.
Syntax: oPolygon.Move(<oPoint>)
Return Value: This Polygon object.
VB Example: oPolygon = oPolygon.Move(oLayout.Point().Set(1,1))
HasArcs
HasSelfIntersections
BBoxLL
BBoxUR
IsParametric
IsConvex
IsPoint
IsSegment
IsArc
IsBox
IsCircle
GetBoundingCircleCenter
GetBoundingCircleRadius
Area
PointInPolygon
CircleIntersectsPolygon
GetIntersectionType
GetClosestPoint
GetClosestPoints
Unite
Intersect
Subtract
Xor
Move(Layout Editor)
Use: Translate this Polygon by the vector specified in the provided Point. Return this Polygon.
Syntax: oPolygon.Move(<oPoint>)
Return Value: This Polygon object.
VB Example: oPolygon = oPolygon.Move(oLayout.Point().Set(1,1))
UI Access N/A.
Syntax: oPolygon.AddHole(oPolygon)
Return Value: This Polygon object.
VB Example: oPolygon = oPolygon.AddHole(oPolygonHole)
…) // etc
VB Example:
oEditor.Unite Array("NAME:primitives", "circle_0", "rect_2")
…) // etc
VB Example:
oEditor.Intersect Array("NAME:primitives", "circle_0", "rect_2")
…) // etc
VB Example:
oEditor.Intersect Subtract ("NAME:primitives", "circle_0", "rect_2")
…) // etc
VB Example:
oEditor.Unite Array("NAME:primitives", "circle_0", "rect_2")
…) // etc
VB Example:
oEditor.Intersect Array("NAME:primitives", "circle_0", "rect_2")
…) // etc
VB Example:
oEditor.Intersect Subtract ("NAME:primitives", "circle_0", "rect_2")
CreateCS
Array("NAME:Contents",
Array("NAME:full_definition", "type:=", "CS", "N:=", <"CS name">),
"placement:=", Array("x:=", <"x_coord">, "y:=", <"y_coord">),
"Clf:=", <color flag>, "Col:=", <color> )
CreateCS
Array("NAME:Contents",
"Name:=", <"CS name">),
"RelPos:=", Array(edge description))
Return Value: Text containing the name of the created relative coordinate system.
Parameters: <"CS name">
Text with the requested name for the relative coordinate system
<x_coord>
Text that is the X location for the relative coordinate system origin
<y_coord>
Text that is the Y location for the relative coordinate system origin
<color flag>
True if a color is being specified by the next parameter
<color>
Integer specifying the color for the relative coordinate system.
Only used if color flag is true;
"t:=", "pe", "from:=", <"prim">, "pos:=", <edge position>, "et:=", "pe", "prim:=",
<"prim">, "edge:=", <edge#>
<edge position>
double between 0 and 1, inclusive
0 indicates the start of the edge
1 indicates the end of the edge
"t:=", "pe", "from:=", <"via">, "pos:=", <edge position>, "et:=", "pse", "sel:=", <"via">, "lay-
er:=", <layer id>, "sx:=", <start X location>, "sy:=", <start Y location>, "ex:=", <end X loc-
ation>, "ey:=", <end Y location>,
"h:=", <arc height>, "rad:=", <radians>
<"via">:
text that is the name of the via to use
<layer id>:
an integer that is the id of the layer of the pad of the via to use <start X location>,
<start Y Location>:
doubles that are the X, Y location of the start point of the edge arc <end X location>, <end Y Location>:
doubles that are the X, Y location of the end point of the edge arc
<arc height>:
double giving the height of the edge arc (0 for a straight edge)
<radians>:
double giving the arc size in radians (0 for a straight edge)
PositionRelative
Array("NAME:Contents",
"RelPos:=", Array(<edge description>)),
Array("NAME:elements", <coordinate system name>, < coordinate system name >, …)
PositionRelative Array("NAME:Contents",
"RelPos:=", Array("t:=", "pr", "from:=", <edge port or pin name>)),
Array("NAME:elements", <coordinate system name>, <coordinate system name>, …)
"t:=", "pe", "from:=", <"prim">, "pos:=", <edge position>, "et:=", "pe", "prim:=", <"prim">, "edge:=", <edge#>
<edge position>
double between 0 and 1, inclusive
0 indicates the start of the edge
1 indicates the end of the edge
values in between are positions along the edge
<arc height>: double giving the height of the edge arc (0 for a straight edge)
<radians>: double giving the arc size in radians (0 for a straight edge)
"from:=", "via_0", "pos:=", 0, "et:=", "pse", "sel:=", "via_0", "layer:=", 10, "sx:=",
0.0015, "sy:=", 0.0015, "ex:=", -0.0015, "ey:=", 0.0015, "h:=", 0, "rad:=", 0)),
Array("NAME:elements", "CS_201")
Layers Methods
The following methods are available to manipulate layers:
l AddLayer (Layout Editor)
l AddStackupLayer (Layout Editor)
l ChangeLayers (Layout Editor)
l ClearLayerMappings (Layout Editor)
l CreateBoardBend
l DuplicateAcrossLyrs (Layout Editor)
l GetAllLayerNames (Layout Editor)
l GetLayerInfo (Layout Editor)
l GetStackupLayerNames (Layout Editor)
l ProcessBentModelCmd
l RemoveLayer (Layout Editor)
l SetLayerMapping (Layout Editor)
l SyncRigidFlexSandbox
Command: None.
Syntax: ClearLayerMappings <component name>
Return Value: None.
Parameters: <component name> is a string that specifies the name of the component.
VB Example: oEditor.ClearLayerMappings "2"
UI Access None
VB Syntax CreateBoardBend<Contents>,<boardbendGeometry>
oEditor.CreateBoardBend
Array("NAME:Contents",
"board bendGeometry:=" , Array( "Name:=" , "board bend_example", "LayerName:=" ,
"Outline", "lw:=" , "0", "PrimName:=" , "Zone1" , "Definition:=" , Array("Id:=" ,
VB Example 12, "Poly:=" , Array( "U:=" , "cm", "x:=" , 3.75, "y:=" , 0.25, "x:=" ,
3.70467214069287, "y:=" , 0), "Radius:=" , "124mil", "Angle:=" , "90deg",
"ZonePrimId:=" , 9)
)
UI Access None
The following are also in the array if the layer is a stackup layer:
l Index: integer [the stackup order index]
l LayerThickness: double [total layer thickness, in meters]
l EtchFactor: double [This will not appear if the layer has no etch factor defined.]
l IsIgnored: "true"|"false"
l NumberOfSublayers: 1 [This is always 1.]
l Material0: material name
l FillMaterial0: material name
l Thickness0: expression with units
l LowerElevation0: expression with units
l If roughness is defined, some or all of the following appear:
l Roughness0Type: Groiss | Huray
l Roughness0: value and units or surface ratio value for Huray
l BottomRoughness0 Type: Groiss | Huray
l BottomRoughness0: value and units or surface ratio value for Huray
l SideRoughness0 Type: Groiss | Huray
For example:
['Type: signal', 'TopBottomAssociation: Neither', 'Color: 32512d', 'IsVisible:
true', ' IsVisibleShape: true', ' IsVisiblePath: true', ' IsVisiblePad: true', '
IsVisibleHole: true', ' IsVisibleComponent: true', 'IsLocked: false', 'LayerId:
7', 'Index: 0', 'LayerThickness: 0', 'IsIgnored: false', 'NumberOfSublayers: 1',
'Material0: copper', 'FillMaterial0: FR4_epoxy', 'Thickness0: 0mil', 'Lower-
Elevation0: 62mil', 'Roughness0 Type: Huray', 'Roughness0: 0mil, 2.9', 'Bot-
tomRoughness0 Type: Huray', 'BottomRoughness0: 0mil, 2.9', 'SideRoughness0 Type:
Huray', 'SideRoughness0: 0mil, 2.9']
Syntax: GetStackupLayerNames
Return Value: array of strings which are the names of all layers in the layout, blackbox, or footprint.
Parameters: None
UI Access None
Parameters None.
Parameters: <LayerName>
Type: <String>
VB Example: oEditor.RemoveLayer ("T3 C1 sub")
oDefinitionEditor.RemoveLayer("Top3 Footprint")
Note As with other Layout scripting interface commands that modifiy the layout, this command is not intended for use within scripts
that define footprints. The command behavior from within such a script is undefined and may be unexpected. Use the LayoutHost
scripting interface commands within scripts that define footprints.
SetLayerMapping (Layout Editor)
Use: Set layer mapping.
Command: None.
Syntax: SetLayerMapping <component name>, <design layer>, <footprint layer>
Return Value: None.
Parameters: <component name> is a string that specifies the name of the component
<design layer> is a string that specifies the name of the design layer
<footprint layer> is a string that specifies the name of the footprint layer
VB Example: oEditor.SetLayerMapping "2", "Bottom Signal", "Top"
l CreateNetClass
l DeleteNets
l DelNetClass
l GetNetClasses
l GetNetClassNets
l GetNetConnections
l HighlightNet
l ModifyNetClass
l SetNetVisible
CreateNetClass
Use:Create a new net class into a layout.
Command:CreateNetClass.
Syntax:CreateNetClass (<name> <description> <nets name list>)
Return Value:None
VB Example:oEditor.CreateNetClass "power", "power nets", Array("A_D2D_VDD_0", "A_D2D_VDD_1", "A_
D2D_VSS_0")
DeleteNets
Removes specified nets from the project.
UI Access None.
DelNetClass
Use:Delete a net class in a layout.
Command:DelNetClass
Syntax:DelNetClass (<names>)
Return Value:None
VB Example:oEditor.DelNetClass Array ("power")
GetNetClasses
Use:Gets all the net classes in a layout.
Command:GetNetClasses
Syntax:GetNetClasses ()
Return Value:None
VB Example:oEditor. GetNetClasses
GetNetClassNets
Use:Gets the list of nets in a net class.
Command:GetNetClassNets
Syntax:GetNetClassNets (<name>)
Return Value:None
VB Example:oEditor. GetNetClassNets Array ("power")
Command: None.
Syntax: GetNetConnections(<netName>)
Return Value: Array of strings containing the connections for the net identified by the
netName argument. The strings in the array are in one of four formats:
"ComponentPin compID pinname x y EdgePort"
"ComponentPin compID pinname x y PinPadstack: padstackName"
"InterfacePort portname portID x y Padstack: padstackName"
"EdgePort portname portID EdgeInfo: Primitive id, edge index[Primitive id, edge index]"
where compID is the component instance identifier, pinname is the name of
the connected pin, x and y are the connection point, padstackName is the name of the
padstack, portname is the name of the port, portID is the identifier for the interface
port, and id and index identify edges involved in an edgeport.
Parameters: <netName>
Type: String
The name of the net.
VB Example: netArray = oEditor.GetNetConnections("net_1")
UI Access None.
Python Syntax HighlightNet (["Name:Args", "Name:=", " <netName>", "Hi:=", <highlightFlag>, ...])
oEditor.HighlightNet(
[
"NAME:Args",
Python Example
"Name:=", "net_0",
"Hi:=", True
])
ModifyNetClass
Use:Modify an existing net class in a layout.
Command:ModifyNetClass
Syntax:ModifyNetClass (<name> <new name> <new description> <new nets name list>)
Return Value:None
VB Example:oEditor.ModifyNetClass "power", "power", "new power nets", Array("A_D2D_VDD_0", "A_
D2D_VDD_1", "A_D2D_VSS_0", "VDD_DIG_0", "VDD_DIG_1")
On the Nets tab of the Nets window, highlight and right click on one or more nets. Click Hide or any of the Show
UI Access
options.
VB
oEditor.SetNetVisible Array("NAME:Args","Name:=","NET_1","Vis:=", true)
Exa- oEditor.SetNetVisible Array("NAME:Args", "Name:=", "<NO-NET>", "Vis:=", false, "Name:=",
mple "Ground", "Vis:=", false, "Name:=", "Chassis", "Vis:=", true)
Port Methods
The following port methods are available:
l AddCircuitRefPort
l AddPortsToAllNets
l AddPortsToNets
l AddRefPort
l AlignPorts
l AssignCircuitRefPort
l AssignRefPort
l ClearRefPort
l CreateCircuitPort
l CreateEdgePort
l CreateNPort
l CreatePortInstancePorts
l CreatePortsOnComponents
l GetPortInfo
l RemovePortsFromAllNets
l RemovePortsFromNet
l RemovePortsOnComponents
<"prim">:
text that is the primitive name
<edge#>:
<edge description>:
for via edges
<"via">:
text that is the name of the via to use
<layer id>:
an integer that is the id of the layer of the pad of the via to use
<radians>:
double giving the arc size in radians (0 for a straight edge)
VB Example:
oEditor.AddPortsToNet Array("NAME:Nets", "CB1", "CB5")
AddRefPort (Layout Editor)
Use: Create a reference port from edges and associate with each of the named ports.
Command: (When more than 2 edges are selected.)
Draw > Port > Create
Right-click > Port > Create
Also available through toolbar icon.
Syntax: AddRefPort
Array(<"port name">, <"port name">, ...),
Array("NAME:Contents",
"edge:=", Array(<edge description>), "edge:=, Array(<edge description>), ...)
Return Value: None.
Parameters: <edge description> for primitive edges
<"prim">:
text that is the primitive name
<edge#>:
integer that is the edge number on the primitive
<edge description>
for via edges
<"via">:
text that is the name of the via to use
<layer id>:
an integer that is the id of the layer of the pad of the via to use
<arc height>:
double giving the height of the edge arc (0 for a straight edge)
<radians>:
double giving the arc size in radians (0 for a straight edge)
VB Example: oEditor.AddRefPort Array("Port3"), Array("NAME:Contents", "edge:=",
Array("et:=", "pe", "prim:=", "line_998", "edge:=", 0))
oEditor.AddRefPort Array("Port1"), Array("NAME:Contents", "edge:=",
Array("et:=", "pse", "sel:=", "via_5", "layer:=", 10, "sx:=", 0.0015, "sy:=", 0.0015,
"ex:=", -0.0015, "ey:=", 0.0015, "h:=", 0, "rad:=", 0))
…) // etc
Return Value: None.
Parameters: The LayoutComp's ID
VB Example: oEditor.Paste Array ("NAME:elements", "1", "2")
oEditor.Paste Array ("NAME:elements")
<"port">
Type: text
Description: a port or pin name.
<"prim">
Type: text
<edge#>
Type: integer
Description: edge number on the primitive
<"via">:
text that is the name of the via to use
<layer id>:
an integer that is the id of the layer of the pad of the via to use
<start X location>, <start Y Location>:
doubles that are the X, Y location of the start point of the edge arc
<end X location>, <end Y Location>:
doubles that are the X, Y location of the end point of the edge arc
<arc height>:
double giving the height of the edge arc (0 for a straight edge)
<radians>:
double giving the arc size in radians (0 for a straight edge)
VB Example: oEditor.AssignCircuitRefPort Array("pin_1"), "pin_2"
<"port">
Type: text
Description: a port or pin name.
<edge description>
for primitive edges
"et:=", "pe", "prim:=", <"prim">, "edge:=", <edge#>
<"prim">
Type: text
Description: primitive name
<edge#>
Type: integer
Description: edge number on the primitive
<edge description>
for via edges
"et:=", "pse", "sel:=", <"via">, "layer:=", <layer id>,
"sx:=", <start X location>, "sy:=", <start Y location>, "ex:=", <end X location>,
"ey:=", <end Y location>, "h:=", <arc height>, "rad:=", <radians>
<"via">:
text that is the name of the via to use
<layer id>:
an integer that is the id of the layer of the pad of the via to use
<arc height>:
double giving the height of the edge arc (0 for a straight edge)
<radians>:
double giving the arc size in radians (0 for a straight edge)
<"port">
Type: text
Description: a port or pin name.
<edge description>
for primitive edges
<"prim">
Type: text
Description: primitive name
<edge#>
Type: integer
Description: edge number on the primitive
<edge description>
for via edges
<"via">:
text that is the name of the via to use
<layer id>:
an integer that is the id of the layer of the pad of the via to use
<arc height>:
double giving the height of the edge arc (0 for a straight edge)
<radians>:
double giving the arc size in radians (0 for a straight edge)
Syntax: CreateEdgePort
Array("NAME:Contents",
"edge:=", Array(<edge description>), "edge:=, Array(<edge description>), ...
"external:=", <flag>)
Return Value: Text containing the name of the created edge port. (Returns an empty name if the edge port is not created.)
Parameters: <edge description> for primitive edges
"et:=", "pe", "prim:=", <"prim">, "edge:=", <edge#>
<edge description>
for via edges
an integer that is the id of the layer of the pad of the via to use
<arc height>:
double giving the height of the edge arc (0 for a straight edge)
<radians>:
double giving the arc size in radians (0 for a straight edge)
<flag>
true if the port is an external port
false if the port is an internal port
VB Example: oEditor.CreateEdgePort Array("NAME:Contents", "edge:=", Array("et:=", "pe",
"prim:=", "rect_167", "edge:=", 0), "edge:=", Array("et:=", "pe", "prim:=",
"rect_167", "edge:=", 3), "external:=", true)
<nport_definition_name>:
quoted string (name of the component definition)
<component_placement>:
Array("x:=", <value>, // x coordinate
"y:=", <value>, // y coordinate
"scaling:=", <value>) // double
VB Example: oEditor.CreateNPort
Array("NAME:Contents",
"definition_name:=", "NetworkData3",
"placement:=",
Array("x:=", "-9mm",
"y:=", "-5mm",
"scaling:=", "2"),
"layer:=", "Symbols",
Array("NAME:NPortData",
Array("NAME:NetworkData2",
"filelocation:=", "UsePath",
"filename:=", "",
"domain:=", "frequency",
"numberofports:=", 2,
"datamode:=", "Import",
"devicename:=", "", "
ImpedanceTab:=", 1,
"NoiseDataTab:=", 1,
"DCBehaviorTab:=", 1,
"SolutionName:=", "",
"dcbehavior:=", "DCOpen",
"displayformat:=", "MagnitudePhase",
"datatype:=", "SMatrix",
"interptype:=", "Linear",
"extraptype:=", "Same as interpolation",
"ShowRefPin:=", 0,
"RefNodeCheckbox:=", 1)))
NetName=<net name>
<name>
Text containing the name of the pin or port
<X coordinate>
Double indicating the X location of the pin or port location
<Y coordinate>
Double indicating the Y location of the pin or port location
<connection description>
< X coordinate> <Y coordinate> Dir:<direction> Layer: <layer name>
<direction>
Either NONE or a double giving the angle in degrees for the connection direction
<layer name>
Name of the layer for the connection point being described.
Name=Pin1
Type=Pin, Padstack: Padstack
X=0.000744
Y=0.015537
ConnectionPoints= 0.000744 0.015537 Dir:NONE Layer: Top; 0.000744 0.015537
Dir:NONE Layer: Ground; 0.000744 0.015537 Dir:NONE Layer: Bottom
NetName=Pin1
Name=Port1
Type=EdgePort
X=-0.008120
Y=0.004264
ConnectionPoints= -0.008120 0.004264 Dir:90.000000 Layer: Bottom
NetName=Port1
Parameters: <"name">
Text that contains the name of the port or pin for which information is being requested.
VB Example:
Dim conns
conns = oEditor.GetPortInfo("Port1")
In the Layout window, right click the net and click Port > Remove Ports from Net or on the Nets tab of the
UI Access
Nets window, highlight and right click one or more nets and choose Remove Ports.
UI Access Right click and choose Port > Remove Ports From Component.
Miscellaneous Methods
The following miscellaneous methods are available.
l AlignObjects (Layout Editor)
l ChangeOptions (Layout Editor)
l ClipPlane (Layout Editor)
l CopyToHFSS 3D Layout (Layout Editor)
"ConstrainToGrid:=", false _
"defaultholesize:=", "5mil", _
"show connection points:=", true, _
"display vertex labels:=", true, _
"NetColor:=", 8421440, _
"rectangle description:=", 1, "snaptoport:=", false, _
"sym footprint scaling:=", _
0.385, "primary selection color:=", 32768, _
"secondary selection color:=", _
22784, "preview selection:=", true, "anglesnap:=", _
"59deg", "AllowDragOnFirstClick:=", true, _
"useFixedDrawingResolution:=", true, _
"DrawingResolution:=", "0.002mm", "Tol:=", _
Array(3E-009, 1.5E-008, 1E-012))
Note:
An error will be returned if this script command is not used at the top-level hierarchy.
"MinorSize" 2
"ShowGrid" 1
Drawing Specifies size and coordinates of Lower left of the layout is (-0.1, -0.1) and the "PageExtent" 4
Extent the layout upper right is (0.1, 0.1)
Background Color of the layout background white "background color" 3
color
Sketch Mode Fill patterns and center lines are off "DefaultToSketchMode" 1
not drawn.
Solid Mode Objects are filled in with solid off "fillMode" 1
color.
Draw Con- Display pin symbols in the layout. off "show connection points" 1
nection
Points
Draw Rats Display lines indicating missing on "draw rats" 1
physical connections in nets
Label Ver- Display property text labeling the off "display vertex labels" 1
tices vertices of selected polygons and
lines.
Net Color Color used for highlighting nets light yellow "NetColor" 3
Rectangle Specifies if rectangles are 2 points "rectangle description" 5
Description described with two points or cen-
ter point, width, and height
Default Hole Default size for actual holes in a 25 mil "defaultholesize" 2
Size PC board
Align Snaps components on entry. on "snaptoport" 1
Microwave
Components
Symbol Foot- Used to size symbol footprints Based on data extent and current length units. "sym footprint scaling" 6
print Scaling placed in layout.
Primary and Colors used to indicate the first Primary color is red, secondary color is a darker "primary selectioncolor" 3
Secondary item selected and other items cur- red
Selection Col- rently selected. "secondary selection color" 3
ors
Preview Highlight the object that would be off "preview selection" 1
Selection selected with a left mouse button
click in the current location.
Snapping Choose snapping sources and Snap distance is 20 pixels. Snapping sources are "PixelSnapTolerance"7
options targets and the maximum dis- vertex, edge center, object center, & elec. conn. "SnapTargetVertex_on"1
tance (in pixels) for snapping to Snapping targets are vertex, edge center, object "SnapTargetEdgeCenter_on"1
occur. Constrain edits to grid if center, elec. conn, & grid. Edits are constrained to "SnapTargetObjCenter_on"1
desired. grid. "SnapTargetEdge_on"1
"SnapTargetElecConnection_
on"1
"SnapTargetIntersection_on"1
4 = An Array containing (lower left x, lower left y, upper right x, upper right y)
7 = Integer
ClipPlane
Truncates graphics at the XY-plane in the +Z direction. Clip planes can be used to truncate graphics in the Layout view, including
mesh and fields plots.
UI Access From the View menu, select Clip Plane, or from the View ribbon, select Add Clipping Plane.
Parameters None.
Return Value None.
VB Syntax ClipPlane
oEditor = oDesign.SetActiveEditor"Layout"
VB Example Editor.ClipPlane "n1, n2, n3, et cetera"
Set success = oEditor.ClipPlane "n1, n2, n3, et cetera"
"AutoGenExtent":=<boolean>,
"Expansion":=<double>,
"RoundCorner":=<boolean>,
"Increments":=<integer>,
"ExtentSel:=", Array(<"extent-poly">, …),
Array("NAME:Nets", "net:=", Array(<"net-name">, <clip>), …))
Increments — integer; this is from the Auto Generate Dialog, and by default is set to true. This can greatly increase the run-
ning time and a small increase can make a big difference. It is probably best to experiment with this parameter first, rather
than set it arbitrarily.
ExtentSel— an array of extent polygon names.
Extent — alternative to ExtentSel; an explicit polygon defined by coordinates.
cl — must always be true; indicates that the polygon is closed.
U — coordinate units, e.g. "mm"
pt — array of coordinate values.
x — x coordinate value
y — y coordinate value
Nets — the net information.
net — array of net information.
<"net-name">
"<no net trace>" — special value referring to traces not in a net.
"<no net fill>" — special value refereeing to fill polygons not in a net.
<design>:<net> — net within a particular design.
<net> — net within the active design.
<clip> — boolean true/false; if true, the net is clipped against the extent else the net is included but not clipped.
Return Value: None
Example: Using "extent_poly" as the selection extent:
oEditor.CutOutSubDesign Array("NAME:Params",
"Name:=", "EMDesign1_cutout",
"EMDesign:=", true,
"SubDesign:=", false,
"Within:=", true,
"Without:=", false,
"ExtentSel:=", Array("extent_poly", …),
Array("NAME:Nets",
"net:=", Array("<no net trace>", true),
"net:=", Array("<no net fill>", true),
"net:=", Array("EMDesign1:GND", true) … ))
Example: Example using an explicit polygon as the selection extent:
oEditor.CutOutSubDesign Array("NAME:Params",
"Name:=", "EMDesign1_cutout",
"EMDesign:=", true,
"SubDesign:=", false,
"Within:=", true,
"Without:=", false,
"Extent:=", Array(
"cl:=", true,
"pt:=", Array(
"U:=", "mm",
"x:=", 0,
"y:=" 0, ) ),
Array("NAME:Nets",
"net:=", Array("<no net trace>", true),
"net:=", Array("<no net fill>", true),
"net:=", Array("EMDesign1:GND", true) … ))
Example: That will create a cutout around first the pos and then the neg trace from the Sample
Project "Diff_Via" under Open Samples/EM/SI:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Diff_Via")
Set oDesign = oProject.SetActiveDesign("diffViaNominal")
Set oEditor = oDesign.SetActiveEditor("Layout")
oEditor.CutOutSubDesign Array("NAME:Params", "Name:=", "diffViaNominal_pos", "EMDesign:=", _
true, "SubDesign:=", false, "Within:=", true, "Without:=", false, "AutoGenExtent:=", _
Edit3DComponentDefinition
Edits definitions of a specified 3D component.
UI Access Layout > 3D Component Definitions. Select component and click Edit Definition.
"EditFilePath:=", ""
)
<"filename">
Type: text
Description: file path for the export file
<version>
Type: integer
Description: version of AutoCAD. Acceptable values are:
l 0 corresponding to AutoCAD version 13
l 1 corresponding to AutoCAD version 14
l 2 corresponding to AutoCAD 2000-2003
l 3 corresponding to AutoCAD 2004-2006
l 4 corresponding to AutoCAD 2007-2009
l 5 corresponding to AutoCAD 2010-2012
<scale>
Type: double
Description: the scaling of the values written out, e.g. if the data is written out in "mm", the scaling factor will be 1000.
<"layer">
Type: text
Description: names of the layers to be exported.
VB Example:
Set oDesign = oProject.SetActiveDesign("HFSS3D1")
Set oEditor = oDesign.SetActiveEditor("Layout")
oEditor.ExportGDSII
Array("NAME:options",
"FileName:=", "C:/Projects/ design.gds",
"NumVertices:=", 0,
"ArcTol:=", 2E-006,
"LayerMap:=", Array(
"entry:=", Array(
VB Example
"layer:=", "Bottom",
"id:=", 2,
"include:=", true),
"entry:=", Array(
"layer:=", "Top",
"id:=", 1,
"include:=", true)))
"Units:=", <"units">,
"IntPlace:=", <integer places>,
"DecimalPlace:=", <decimal places>,
"Suppress:=", <"suppress">,
Array("NAME:GerberPages",
"<page>:=", Array(<"layer">, …), …))
Return Value: None
Parameters: <"file name">
Type: text
Description: prefix for the exported Gerber files; the actual files will be named <file name>_<page>.ger
<"units">
Type: text
Description: unit code, e.g. "in", "mm", etc.
<integer places>
Type: integer
Description: number of integer places to use when formatting the numerical output.
<decimal places>
Type: integer
Description: number of decimal places to use when formatting the numerical output.
<"suppress">
Type: text
Array("NAME:options",
"FileName:=", "C:/ Projects/drill.ncd",
"Units:=", "mm",
"IntPlace:=", 5,
"DecimalPlace:=", 5,
"SuppressLeadingZero:=", true,
Array("NAME:NCDFileOptsVec",
Array("NAME:NCDrillOptions",
"Top:=", "Top",
"Bottom:=", "Ground",
"Create:=", true),
Array("NAME:NCDrillOptions",
"Top:=", "Top",
"Bottom:=", "Bottom",
"Create:=", true)))
"ComponentName=string"
"PlacementLayer=string"
"LocationX=number"
"LocationY=number"
"BBoxLLx=number"
"BBoxLLy=number"
"BBoxURx=number"
"BBoxURy=number"
"Angle=number" (in degrees)
"Flip=true or false"
"Scale=number"
Parameters: The LayoutComp's ID
VB Example: dim info
sys= oEditor.GetComponentInfo ("1")
UI Access N/A
Parameters None.
Return Value Array containing object IDs
VB Syntax GetSelections
VB Example oEditor.GetSelections
For the category Feature, type Voids there is an additional optional argument: "AntiPads:=" true or false.
Syntax:
Heal( [ "NAME:<category>", "Selection:=", ["<obj1>", "<obj2>", … ],"Type:=", "<type>", "Tol:= ", "<tolerance>", <args>] ))
VB Example:
oProject = oDesktop.SetActiveProject("GeometryHealing")
oDesign = oProject.SetActiveDesign("TestDesign")
oEditor = oDesign.SetActiveEditor("Layout")
oEditor.Heal(
[
"NAME:Snap",
"Type:=" , "Point",
"Tol:=" , "0.1mm"
])
oEditor.Heal(
[
"NAME:Snap",
"Type:=" , "Arc",
"Tol:=" , "0.1mm"
])
oEditor.Heal(
[
"NAME:Snap",
"Type:=" , "Grid",
"Tol:=" , "0.1mm"
])
oEditor.Heal(
[
"NAME:Feature",
"Type:=" , "Voids",
"AntiPads:=" , False,
"Tol:=" , "4mm2"
])
oEditor.Heal(
[
"NAME:Feature",
"Type:=" , "FloatingBodies",
"AntiPads:=" , False,
"Tol:=" , "4mm2"
])
oEditor.Heal(
[
"NAME:Repair",
"Type:=" , "Colinear",
"Tol:=" , "1e-007mm"
])
oEditor.Heal(
[
"NAME:Repair",
"Type:=" , "SelfIntersecting",
"Tol:=" , "1e-007mm"
])
<Border>: Integer value indicating to draw border (1) or not to draw (0).
<DesignVars>: Integer value indicating to draw design vars (1) or not to draw (0).
VB Example: Set oProject = oDesktop.GetActiveProject()
Set oDesign = oProject.GetActiveDesign()
Set oEditor = oDesign.GetActiveEditor()
oEditor.PageSetup Array("NAME:PageSetupData", "margins:=", Array("left:=", 550, "right:=", _
550, "top:=", 500, "bottom:=", 500), "border:=", 1, "DesignVars:=", 0)
PushExcitations
Allows access to computed excitations for transient and linear frequency solutions. The script command can be accessed from three
locations.
l Layout Editor
UI Access l Schematic Editor
l Select a Nexxim solution in a 3D Layout design, right click, and choose Push Excitations.
l Blackman
l Hamming
l Hanning
l Kaiser
l Welch
l Weber
l Lanzcos
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
removedDefs = oDefinitionEditor.SelectAll()
Syntax: ZoomToFit()
Return Value: None
30-164
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
31 - Schematic Scripting
The Schematic scripting interface is a set of commands that match the data changing methods available in the UI of the Schematic,
plus some selection and query methods. Examples of the commands available through the scripting interface are adding items, remov-
ing items, and modifying items on the Schematic. Identifying objects on the Schematic is done by a unique ID that is generated and
returned by all methods that add objects, and by the FindElements and GetSelections methods. This ID can then be passed into com-
mands to modify or remove Schematic objects.
l Since most Schematic objects can have sub-components (such as property displays or segments on a wire, etc), IDs can also
be in the format of "TopLevelID:SubComponentIndex".
l The SubComponentIndex is a one-based index into the sub components of the item thus making the second segment of com-
ponent CAP1 identified by "CAP1:2".
l A SubComponentIndex of zero will refer to the TopLevel item only.
l When an ID is mentioned later in this document, it will refer to either a simple string ID representing a top-level Schematic item
or a "TopLevelID:SubComponentIndex" pair unless otherwise stated.
l If a specified ID or SubComponentIndex does not exist, then the function will ignore that entry and proceed with other specified
IDs. Even if no valid IDs are specified, the functions will still return success.
Method Format
In the following formats, [Opt=x] appearing after a parameter indicates that the parameter is optional and the default value is x.
When calling object-creation methods as functions, parenthesis are required in order to retrieve the name of the created object. Par-
enthesis are also required in JavaScript. When using VB/VBScript to call a method as a subroutine, however, parenthesis are not
required.
All methods to create Schematic objects have the following form:
Create[type](VARIANT parameters,
// Array of type specific parameters
VARIANT attributes,
// attributes is in the format of:
Array("NAME:Attributes", _
"Page:=", int, _ // [Opt=1] Page number (one-based)
// Note: Page 1 always exists
"X:=", double, _ // X position of the object
"Y:=", double, _ // Y position of the object
"Angle:=", double, _ // Rotation angle (radians)
"Flip:=", bool) // True if mirrored
[out,retval] string id)
ID Format
When IDs are passed to a function it can be in one of the following formats:
l Array of integers of top-level items only
l String of IDs separated by spaces or commas
l Array of strings with each string element being an ID
Point Format
When a method takes an array of points, each element in the array is a string in the format of: "x y", "x,y", or "(x,y)".
UI Access Draw>Primitive>Arc
String
Return Value
Unique id
The Schematic ID can be found on the Symbols tab of the Properties window when you select the arc.
(["NAME:ArcData", _
"X:=", -0.004318, "Y:=", -0.00127, _
"Radius:=", 0.00297299377732279, _
"StartAng:=", 1.9195673303788, _
"EndAng:=", 3.32144615338227, _
"Id:=", 10], _
["NAME:Attributes", "Page:=", 1])
VB Syntax CreateArc()
oEditor.CreateArc
Array("NAME:ArcData", _
"X:=", -0.004318, "Y:=", -0.00127, _
"Radius:=", 0.00297299377732279, _
VB Example
"StartAng:=", 1.9195673303788, _
"EndAng:=", 3.32144615338227, _
"Id:=", 10), _
Array("NAME:Attributes", "Page:=", 1)
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
Dim ArcID
ArcID = oEditor.CreateArc(Array("NAME:ArcData", "X:=", 0.10414, "Y:=", 0.08382, "Radius:=", _
0.00915810023967853, "StartAng:=", 2.15879893034246, "EndAng:=", _
5.49778714378214, "LineWidth:=", 0, "Color:=", 0, "Id:=", 48), Array("NAME:Attributes", "Page:=",
_
1))
MsgBox "Arc ID = " & ArcID
CreateCircle (Schematic Editor)
Create a circle
UI Access Draw>Primitive>Circle
String
Return Value
Unique id
Circle is created and the returned value has the format SchObj@<schematicID>
The schematic ID of the circle can be located in the Properties window on the Symbols tab.
VB Syntax CreateCircle()
oEditor.CreateCircle
Array("NAME:CircleData", _
UI Access N/A.
Note:
Note:
"Id:=", "1"
],
["NAME:Attributes",
"Page:=", 1,
"X:=", -0.01524,
"Y:=", 0.00508,
"Angle:=", 0,
"Flip:=", false
]
)
Return Value
String
PortID, the identifier that can be used for this port in script operations involving this schematic
Global port is created and the return value has the format GPort@<portName>;<schematicID>
The Schematic ID can be found in the Properties window on the Symbols tab when you select the global port.
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
Dim GPort
GPort = oEditor.CreateGlobalPort(Array("NAME:GlobalPortProps", "Name:=", "G_1", "Id:=", 68),
Array("NAME:Attributes", "Page:=", _
1, "X:=", 0.11684, "Y:=", 0.0635, "Angle:=", 0, "Flip:=", false))
MsgBox "Port = " & GPort
CreateGround (Schematic Editor)
Create a ground
UI Access Draw>Ground
String
Return Value
Unique id
Ground is created and the returned value has the format GPort@<portname>;<schematicID>
The Schematic ID for ground can be found on the Symbols tab of the Properties window when you select the object.
VB Syntax CreateGround()
oEditor.CreateGround
Array("NAME:GroundProps", "Id:=", 8),
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
UI Access Draw>Primitive>Line
String
Return Value
Unique id
Line is created and the returned value has the format SchObj@<schematicID>
The Schematic ID can be found on the Symbol tab of the Properties window when you select the line.
VB Syntax CreateLine()
oEditor.CreateLine Array("NAME:LineData",_
"Points:=", Array("(-0.055652, 0.020669)", _
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
LineID = oEditor.CreateLine(Array("NAME:LineData", "Points:=", Array("(0.050800, 0.106680)", _
<nport_definition_name>:
quoted string (name of the component definition)
<component_placement>:
Array("x:=", <value>, // x coordinate
"y:=", <value>, // y coordinate
"scaling:=", <value>) // double
Return Value: Returns the name of the newly created component.
"NoiseDataTab:=", 1,
"DCBehaviorTab:=", 1,
"SolutionName:=", "",
"dcbehavior:=", "DCOpen",
"displayformat:=", "MagnitudePhase",
"datatype:=", "SMatrix",
"interptype:=", "Linear",
"extraptype:=", "Same as interpolation",
"ShowRefPin:=", 0,
"RefNodeCheckbox:=", 1)))
String
Return Value
Unique id
VB Syntax CreatePagePort()
oEditor.CreatePagePort
Array("NAME:PagePortProps", "Name:=", "pageport_0", "Id:=", _
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
PagePortID = oEditor.CreatePagePort(Array("NAME:PagePortProps", "Name:=", "pageport_0", "Id:=", _
177), Array("NAME:Attributes", "Page:=", 1, "X:=", 0.0889, "Y:=", 0.1651, "Angle:=", _
0, "Flip:=", false))
MsgBox "PagePort = " & PagePortID
CreateIPort (Schematic Editor)
Create an interface port
Note:
String
Return Value
Unique id
Interface port is created and the returned value has the following format:
IPort@<portName>;<schematicID>
The interface port schematic ID can be found in the Properties window on the Symbols tab.
VB Syntax CreateIPort()
VB Example oEditor.CreateIPort Array("NAME:IPortProps", "Name:=",_
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
IPortID = oEditor.CreateIPort(Array("NAME:IPortProps", "Name:=", "Port1", "Id:=", 189), Array
("NAME:Attributes", "Page:=", _
1, "X:=", 0.0889, "Y:=", 0.1651, "Angle:=", 0, "Flip:=", false))
MsgBox "IPort ID = " & IPortID
UI Access Draw>Primitive>Polygon
String
Return Value
Unique id
VB Syntax CreatePolygon()
oEditor.CreatePolygon
Array("NAME:PolygonData", "Points:=", Array( _
"(-0.058951, 0.006308)", "(-0.046142, 0.010480)",_
VB Example
"(-0.046239, 0.001067)"), "LineWidth:=", _
0, "BorderColor:=", 0, "Fill:=", 0, "Color:=",_
0, "Id:=", 27), Array("NAME:Attributes", "Page:=", 1)
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
UI Access Draw>Primitive>Rectangle
String
Return Value
Unique id
VB Syntax CreateRectangle()
oEditor.CreateRectangle
Array("NAME:RectData", "X1:=", -0.0755449856733525, "Y1:=", _
0.0335755491881566, "X2:=", -0.0611831900668577, "Y2:=", _
VB Example
0.0254242597898758, "LineWidth:=", _
0, "BorderColor:=", 0, "Fill:=", 0, "Color:=", 0, "Id:=", 31), _
Array("NAME:Attributes", "Page:=", 1)
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
rectangleID = oEditor.CreateRectangle(Array("NAME:RectData", "X1:=", 0.1016, "Y1:=", 0.0635,
"X2:=", _
0.10414, "Y2:=", 0.06096, "LineWidth:=", 0, "BorderColor:=", 0, "Fill:=", 0, "Color:=", _
0, "Id:=", 9), Array("NAME:Attributes", "Page:=", 1))
MsgBox "Rectangle ID = " & rectangleID
CreateText (Schematic Editor)
Create text
UI Access Draw>Primitive>Text
String
Return Value
Unique id
Text is created and the return value has the format: SchObj@<SchematicID>
The Schematic ID can be found in the Properties window on the Symbols tab when you select the text.
VB Syntax CreateText()
oEditor.CreateText
Array("NAME:TextData", "X:=", -0.0764183381088826, "Y:=", _
0.040174212034384, "Size:=", 12, "Angle:=",_
0, "Text:=", "Con-
trol Circuit", "Color:=", _
0, "Id:=", 34, "ShowRect:=", false, "X1:=", _
VB Example
-0.0793287547755609, "Y1:=", _
0.0407033787010528, "X2:=", -0.0502245881087778,_
"Y2:=", 0.035411712034365, "RectLineWidth:=", _
0, "RectBorderColor:=", 0, "RectFill:=",
0, "RectColor:=", 0), Array("NAME:Attributes", "Page:=", 1)
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
textobj = oEditor.CreateText(Array("NAME:TextData", "X:=", 0.10414, "Y:=", 0.06604, "Size:=", _
12, "Angle:=", 0, "Text:=", "CreateDefaultTectxt" & Chr(13) & Chr(10) & "", "Color:=", _
0, "Id:=", 286, "ShowRect:=", false, "X1:=", 0.100141851851836, "Y1:=", _
0.0670983333333376, "X2:=", 0.140123333333477, "Y2:=", 0.0565149999999619, "RectLineWidth:=", _
0, "RectBorderColor:=", 0, "RectFill:=", 0, "RectColor:=", 0), Array("NAME:Attributes", "Page:=",
_
1))
MsgBox "text = " & textobj
CreateWire (Schematic Editor)
Create a wire
UI Access Draw>Wire
String
Return Value
Unique id
Wire is created and its return value has the format Wire@<netName>;<schematicID>;<segment index list>
The Schematic ID can be found in the Symbol tab of the Properties window when you select the wire. The wire net name appears in
the General tab. The parameter segment index list indicates the number of segments i.e. the segment count.
VB Syntax CreateWire()
VB Example oEditor.CreateWire
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Project4")
Set oDesign = oProject.SetActiveDesign("Circuit1")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
WireID = oEditor.CreateWire(Array("NAME:WireData", "Name:=", "", "Id:=", 261, "Points:=", Array(
_
"(0.101600, 0.063500)", "(0.106680, 0.063500)", "(0.106680, 0.060960)")), Array("NAME:At-
tributes", "Page:=", _
1))
MsgBox "Wire ID = " & WireID
UI Access Edit>Activate
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Note:
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Python Example
["NAME:Selections", "Selections:=", ["CompInst@R;2;37"]]
VB Syntax AddPinIPorts ()
oEditor.AddPinIPorts
VB Example
Array("NAME:Selections", "Selections:=", Array("CompInst@R;2;37"))
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax AddPinPageConnectors ()
oEditor.AddPinPageconnectors
VB Example Array("NAME:Selections", "Selections:=", Array( _
"CompInst@C;1;1"))
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Python
oEditor.AlignHorizontal (["NAME:Selections", "Selections:=", [ _
Example "CompInst@R;2;4", "CompInst@C;1;1"]], ["NAME:AlignParame-
ters", "Disconnect:=", _
VB Syn- AlignHorizontal()
tax
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Python AlignVertical()
Syntax
VB Syn- AlignVertical()
tax
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax BringToFront( )
oEditor.BringToFront
VB Example
Array("NAME:Selections", "Selections:=", Array("SchObj@1"))
UI Access NA
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax CloseEditor
VB Example oDefinitionEditor.CloseEditor
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Identifiers for each selected item to be copied, in the form CompInst@<id>, where id is the compname;ID;schematicID for each ele-
ment.
Example: Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
oEditor.CopyData Array("NAME:Selections", "Selections:=", Array("CompInst@Cap;1;1"))
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
UI Access Edit>Cut
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax Cut()
oEditor.Cut Array("NAME:Selections",
VB Example
"Selections:=", Array("CompInst@R;10;93"))
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax DeactivateOpen()
oEditor.DeactivateOpen Array("NAME:Selections",
VB Example
"Selections:=", Array( "CompInst@R;2;37"))
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax DeactivateShort ()
oEditor.DeactivateShort Array("NAME:Selections", "Selections:=", Array( _
VB Example
"CompInst@R;2;37"))
UI Access Edit>Delete
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax Delete()
oEditor.Delete Array("NAME:Selections", "Selections:=",
VB Example
Array("CompInst@R;10;93"))
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax ElectricRuleCheck()
oEditor.ElectricRuleCheck Array("PinRule",
VB Example
"OutputPinRule", "OverlapCompRule"), True
UI Access None.
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
8 - wires only
16 - ports only
Add the numbers to look through more types - 30 is a common number, search-
ing through everything
<match> Boolean True = match all of the properties specified
False = match any of the properties specified
<case> Boolean True = case-sensitive
False = not case-sensitive
<sub> Boolean True = search subcircuits as well as current schematic
False = only search current schematic
<only> Boolean True = search within current selections
False = search schematic(s)
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
"NAME:SearchProps",
"Prop:=", ["CompName","",0]
],
[
"NAME:Parameters",
"Filter:=" , 30,
"MatchAll:=" , False,
"MatchCase:=" , False,
"SearchSubCkt:=" , True,
"SearchSelectionOnly:=" , False
])
VB Syntax FitToBorder
VB Example oEditor.FitToBorder
UI Access NA
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax FlipHorizontal(
oEditor.FlipHorizontal
Array("NAME:Selections", "Selections:=", Array( _
UI Access NA
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Python Example
"Selections:=", ["CompInst@R;2;4", _
"CompInst@C;1;1"]], ["NAME:FlipParameters",
"Disconnect:=", true, "Rubberband:=", false])
VB Syntax FlipVertical(
oEditor.FlipVertical Array("NAME:Selections",
"Selections:=", Array("CompInst@R;2;4", _
VB Example
"CompInst@C;1;1")), Array("NAME:FlipParameters",
"Disconnect:=", true, "Rubberband:=", false)
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
"SnapToGrid:=", true, _
"BackgroundColor:=", 0x00ffffff, _ # White
"SaveAsDefault:=", false])
VB Syntax GridSetup()
oEditor.GridSetup
Array(
"NAME:Options", _
"MajorGrid:=", "10mm", _
"Divisions:=", 10, _
For example:
oEditor.GridSetup Array(
"NAME:Options", _
"MajorGrid:=", "10mm", _
"Divisions:=", 10, _
"MajorColor:=", 0x00ff0000, _ // Red
"MinorColor:=", 0x0000ff00, _ // Green
"ShowGrid:=", true, _
"SnapToGrid:=", true, _
"BackgroundColor:=", 0x00ffffff, _ // White
"SaveAsDefault:=", false)
Move (Schematic Editor)
Move items
UI Access NA
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax Move()
oEditor.Move Array("NAME:elements", "circle_0", "rect_2"),
VB Example
Array(0.0165613577023499, -0.001)
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
NameNets(
bool display, // Show Net names or not
["NAME:NetNames", _
Python Syntax
"string:=", _ #Old name of the net (e.g. net_1)
string, _ #New name of the net (e.g. my_net)
...]) # Repeat for additional nets to change
oEditor.NameNets (True, ["NAME:NetNames",
Python Example
"Wire@net_2;41:1:=", "A[0]"])
NameNets(
bool display, // Show Net names or not
Array("NAME:NetNames", _
VB Syntax
"string:=", _ // Old name of the net (e.g. net_1)
string, _ // New name of the net (e.g. my_net)
...) // Repeat for additional nets to change
Note:
This command has been replaced with the SetPageData command. Legacy scripts using this command will play back for
the first page of a schematic only.
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
UI Access View>Pan
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Pan([
Python Syntax double, _ // Move the visible area by X meters
double]) // Move the visible area by Y meters
oDefinitionEditor.Pan
Python Example
([-0.00922653869663931, 0.00686839904222147])
Pan(Array(
VB Syntax double, _ // Move the visible area by X meters
double)) // Move the visible area by Y meters
oDefinitionEditor.Pan
VB Example
Array(-0.00922653869663931, 0.00686839904222147)
UI Access Edit>Paste
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
1 to create a new copy of the design that was copied but keep the original layers of the design being copied
2 to create a new copy of the design and merge the layers of the design being copied into the design receiving the copy
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("SimpleCircuitPaste")
oProject.CopyDesign "D"
Set oDesign = oProject.SetActiveDesign("A")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
oEditor.PasteDesign 1, Array("NAME:Attributes", "Page:=", 1, "X:=", 0.0762, "Y:=", _
0.0635, "Angle:=", 0, "Flip:=", false)
PushExcitations
Allows access to computed excitations for transient and linear frequency solutions. The script command can be accessed from three
locations.
l Layout Editor
UI Access l Schematic Editor
l Select a Nexxim solution in a 3D Layout design, right click, and choose Push Excitations.
"transient:=", Array(
"start:=", <start time>,
"stop:=", <stop time>,
"maxHarmonics:=", <max harmonics>,
"winType:=", <window>,
["widthPct:=", <width percentage>,]
["kaiser:=", <Kaiser value>,]
["correctCoherentGain:=", true]),
"Sol:=", "<solution name>")
winType can have the following values:
l Rectangular
l Bartlett
l Blackman
l Hamming
l Hanning
l Kaiser
l Welch
l Weber
l Lanzcos
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
UI Access Draw>Rotate
Note:
When you record a script, the schematic editor's Rotate command shows the rotation angle for some older scripts in radi-
ans, while newer scripts show rotation angle in degrees.
Array("CompInst@RES_;1;1:1")), Array("NAME:RotateParameters", _
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax Rotate()
oEditor.Rotate Array("NAME:Selections", "Selections:=",
Array("CompInst@R;2;4", "CompInst@C;1;1")),
VB Example
Array("NAME:RotateParameters","Degrees:=", 90, "Disconnect:=", _
false, "Rubberband:=", false)
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
UI Access NA
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Example oEditor.SelectPage 1
SendToBack
Send the selected object to the back of the view
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs
Note:
To add or remove page border, title block and page property data from the specified page. Title blocks will not be shown if the page
border type is "None". Any number of title blocks may be specified, as well as any number of page properties. Some of the page prop-
erties are special and their values will be updated automatically as appropriate, such as Project, ProjectPath, Design, Number and
Date.
SetPageData (<pagenum>,
["NAME:Border", "BorderType:=", <bordertype>, "Page-
Size:=", ["x:=", <sizeX>,
"y:=", <sizeY>],
"PageMargins:=", ["x:=", <marginX>,
"y:=", <marginX>],"ZonesHoriz:=", <zonesH>,
Python Syntax
"ZonesVert:=", <zonesV>],
["NAME:TitleBlocks"[, "TitleBlock:=",
[<symbolName>, <libName>, <Hsnap>, <Vsnap>,
<rotation>, -1)]*],
["NAME:PageProps"[, <propName>, <propVal>]*])
SetPageData (<pagenum>,
Array("NAME:Border", "BorderType:=", <bordertype>, "Page-
Size:=", Array("x:=",
<sizeX>, "y:=", <sizeY>),
"PageMargins:=", Array("x:=", <marginX>,
"y:=", <marginX>),"ZonesHoriz:=", <zonesH>,
VB Syntax
"ZonesVert:=", <zonesV>),
Array("NAME:TitleBlocks"[, "TitleBlock:=",
Array(<symbolName>, <libName>, <Hsnap>, <Vsnap>,
<rotation>, -1)]*),
Array("NAME:PageProps"[, <propName>, <propVal>]*)
Dim oEditor
oEditor.SetPageData 1, Array("NAME:Border",
"BorderType:=", "ANSI", "PageSize:=", Array("x:=", "11in", "y:=", "8.5in"),
VB Example
"PageMargins:=", Array("x:=", "0.38in", "y:=", "0.25in"), "ZonesHoriz:=",
2, "ZonesVert:=", 2), Array("NAME:TitleBlocks", "TitleBlock:=", Array("TitleBlk1",
"TitleBlocks", "Right", "Bottom", "0", -1)), Array("NAME:PageProps",
oEditor ShowVariableBlock
[
Python Example
("True")
]
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax SortComponents ()
VB Example oEditor.SortComponents
Syntax:
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
UI Access View>Zoom In
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax ZoomIn()
VB Example oEditor.ZoomIn
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax ZoomOut()
VB Example oEditor.ZoomOut
UI Access NA
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax ZoomPrevious()
VB Example oEditor.ZoomPrevious
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
VB Syntax ZoomToFit()
VB Example oEditor.ZoomToFit
UI Access NA
VB Syntax ChangeProperty()
oEditor.ChangeProperty Array("NAME:AllTabs",
Array("NAME:ComponentTab", Array("NAME:PropServers", _
VB Example "Wire@net_1;14:1"), Array("NAME:ChangedProps",
Array("NAME:NetName", "ExtraText:=", _
"net_10", "Name:=", "net_10", "SplitWires:=", false))))
UI Access NA
direction = oEditor.GetPropertyAttribute
("Quantities",i, j, "Direction")
UI Access NA
str(direction))
VB Example
for each j in proparray
next
next
UI Access NA
VB Syntax GetPropertyValue(<tab>,<item>,<propname>,<value>)
Please refer to the examples that can be found in C:\Program Files\...[Ansys Installation]...\Examples\Twin Build-
VB Example
er\Applications\Scripting\Ex6_MathMod
UI Access NA
VB Syntax SetPropertyValue(<params>)
Please refer to the examples that can be found in C:\Program Files\...[Ansys Installation]...\Examples\Twin Build-
VB Example
er\Applications\Scripting\Ex6_MathMod
UI Access NA
VB Syntax GetAllPorts
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
VB Example
oEditor.GetAllPorts()
UI Access NA
GetCompInstanceFromRefDes(string)
Python Syntax
# string is refDes for the component
GetCompInstanceFromRefDes("R1")
Python Example
GetCompInstanceFromRefDes(string)
VB Syntax
// string is refDes for the component
VB Example GetCompInstanceFromRefDes("R1")
UI Access NA
"ComponentName=string"
"GateCount=number"
"LocationX=number"
"LocationY=number"
"BBoxLLx=number"
"BBoxLLy=number"
"BBoxURx=number"
"BBoxURy=number"
"Angle=number" (in degrees)
"Flip=true or false"
VB Syntax GetComponentInfo<compID>
selectionArray = oEditor.GetSelections
For Each i in selectionArray
compArray = oEditor.GetComponentInfo(i)
UI Access NA
Return Value Array of strings, which are the names of all the component's pins
for j in pinArray
AddInfoMessage("Pin: " + str(j))
VB Syntax GetComponentPins<compID>
selectionArray = oEditor.GetSelections
for Each i in selectionArray
pinArray = oEditor.GetComponentPins(i)
UI Access NA
UI Access NA
UI Access N/A
Parameters None
Return Value String containing the name of the schematic editor. “SchematicEditor”
PagePort indicates that portID specifies the name of the page port,
Component indicates that compID specifies the component instance identifier,
x and y are the connection point,
pinName is the name of the connected pin,
componentName is the name of the component.
Parameters: <netName>
Type: String
The name of the net. Specifying "0" as the netName will return all objects connected
to ground including all ground ports.
VB Example: netArray = oEditor.GetNetConnections("net_1")
UI Access NA
VB Syntax GetNumPages
VB Example Set num = oEditor. GetNumPages
UI Access NA
VB Syntax GetPortInfo<portID>
selectionArray = oEditor.GetSelections
For Each i in selectionArray
info = oEditor.GetPortInfo(i)
UI Access N/A
Parameters None.
VB Syntax GetSelections
VB Example oEditor.GetSelections
UI Access NA
Array of strings which contains the signal names in the wirename argument. The wirename "Net1" would return
Return Value an array with a single string "Net1". The wirename "WW[0-3],A,B" would return an array with six strings "WW[0]",
"WW[1]", "WW[2]", "WW[3]", "A", :B".
for i in selectionArray:
netArray3 = oEditor.GetWireInfo(i)
for n in netArray3:
wname = n[0:9]
if (wname == "WireName:"):
nn = len(n)
wn = n[nn-10:]
AddInfoMessage("Wirename, parsed from ID :" + str(wn))
sigs = oEditor.GetSignals(wn)
for ll in sigs:
AddInfoMessage("Element in array
from GetSignals :" + str(ll))
VB Syntax GetSignals(<wirename>)
selectionArray = oEditor.GetSelections
For Each i in selectionArray
VB Example
netArray3 = oEditor.GetWireInfo(i)
wname = Left(n, 9)
nn = Len(n)
wn = Right(n, nn - 10)
sigs = oEditor.GetSignals(wn)
Next
End If
Next
Next
UI Access NA
Array of strings containing the connections for the wire identified by the wireID argument.
The strings in the array are in one of four formats:
"InterfacePort=portname portID x,y"
Return Value "GlobalPort=portname portID x,y"
"PagePort=portname portID x,y"
"ComponentPin=compId pinname x,y"
where x,y is the connection point.
VB Syntax GetWireConnections(<wireID>)
selectionArray = oEditor.GetSelections
For Each i in selectionArray
MsgBox i, 0, "Selected element"
netArray = oEditor.GetWireConnections(i)
VB Example
for each m in netArray
MsgBox m, mbokonly, "GetWireConnections"
Next
Next
UI Access NA
AddInfoMessage("GetWireInfo" + str(n))
VB Syntax GetWireInfo(<wireID>)
selectionArray = oEditor.GetSelections
For Each i in selectionArray
MsgBox i, 0, "Selected element"
netArray3 = oEditor.GetWireInfo(i)
VB Example
for each n in netArray3
MsgBox n, 0, "GetWireInfo"
Next
Next
UI Access NA
Array of strings containing the wire segments in the wireID argument. The strings in the array are:
"Segment=val,val val,val number" the "val" quantities are
Return Value
segment endpoints x1,y1 x2,y2
and the "number" is a schematic segment ID
MsgBox n, 0, "GetWireSegments"
Next
Next
Related Topics:
"QuantityProp:=", <QuantityPropInfo>...),
Array("NAME:CosimDefinitions",
<CosimDefInfo>,
<CosimDefInfo>...)
Return Value:<string>
// composite name of the component.
// If the name requested conflicts with the name of an existing
// component, the requested name is altered to be unique.
// The name returned reflects any change made to be unique.
Parameters:<ComponentName>:
<string> // simple name of the component
<ComponentInfo>:
Array("Type:=", <TypeInfo>,
"NumTerminals:=", <int>,
"DataSource:=", <string>,
"ModifiedOn:=", <ModifiedOnInfo>,
"Manufacturer:=", "<string>,
"Symbol:=", <string>,
"Footprint:=", <string>,
"Description:=", <string>,
"InfoTopic:=", <string>,
"InfoHelpFile:=", <string>,
"IconFile:=", <string>,
"LibraryName:=", "",
"OriginalLocation:=", "Project", // Project Location
"Author:=", <string>,
"OriginalAuthor:=", <string>,
"CreationDate:= ", <int>)
<TypeInfo>:
An integer that is the or-ing of bits for each product listed below. The default setting is 0xffffffff (4294967295) which indicates
valid for all products. In the component editing dialog, checking different boxes in the "Specify products for which this com-
ponent is valid" grid control sets specific flags that correspond to the following hex/decimal settings:
Nexxim -- 100 binary, 4 decimal, 0x4
SIwaveDeNovo -- 1000 binary, 8 decimal, 0x8
Simplorer -- 10000 binary, 16 decimal, 0x10
MaxwellCircuit -- 100000 binary, 32 decimal, 0x20
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed since 00:00 hours, Jan 1, 1970 UTC from the sys-
tem clock.
<TerminalInfo>:
Array(<string>, // symbol pin
<string> // footprint pin
<string >, // gate name
<bool>, // shared
<int>, // equivalence number
<int>, // what to do if unconnected: flag as error:0, ignore:1
<string> // description
<Nature>)
<Nature>:
<string> // content varies as follows
Nexxim/Circuit:
"Electrical" // the only choice
Simplorer:
// several choices
<VHDLPackageName>:
<string> // in the form <Library>.<Package>
<Library>:
<string> // name of the VHDL library
<Package>:
<string> // name of the VHDL package
<VariableInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: number, variable, or expression
<FlagLetters>:
<string> // "D" - has description parameter,
// "RD" - readonly & has description parameter,
// or "RHD" - readonly, hidden, & has description parameter
<CheckBoxInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<bool>) // value: true or false
<ButtonInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // button title
<string>, // extra text
<ClientID>,
"ButtonPropClientData:= ", <ClientDataArray>)
<ClientID>:
<int> // specifies Button Prop Client
// 0 - unknown, ButtonPropClientData
// array will be empty
// 1 - Netlist Prop Client
// 2 - not used
// 3 - File Name Prop Client
<ClientDataArray>:
varies with <ClientID>
<ClientID> is 3:
Array("InternalFormatText:=", "<prefix><RelativePath>")
<prefix>:
<string> // "<Project>", "<PersonalLib>", "<UserLib>", or "<SysLib>"
<RelativePath>:
<TextInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a text string
<NumberInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<real>, // value: a number
<string>) // units
<SeparatorInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<ValueInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a number, variable or expression
<MenuPropInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // menu choices - separated by commas
<int>) // 0 based index of current menu choice
<VPointInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<PointInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<real>, // x value
<real>) // y value
<QuantityPropInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // value
<TypeString>,
<TypeStringDependentInfo>)
<TypeString>:
<TypeStringDependentInfo>:
<TypeString> is "Free" :
<string>, // direction: "In", "Out", "InOut", or "DontCare"
// Following <string> is not present if direction is "DontCare"
<string> // when to calculate: "BeforeAnalogSolver",
// "BeforeStateGraph", "AfterStateGraph", or "DontCareWhen"
<CosimDefInfo>:
Array("NAME:CosimDefinition",
"CosimulatorType:=", <int>,
"CosimDefName:=", <string> // "HFSS 3D Layout", "Circuit",
// "Custom", or "Netlist"
"IsDefinition:=", <bool>,
final array member(s) vary with CosimDefName)
VB Example:
Dim name
oComponentManager.Add (Array("NAME:MyComponent", _
"Info:=", Array("Type:=", 4294901767, _
"NumTerminals:=", 2, _
"DataSource:=", "", _
"ModifiedOn:=", 1071096503, _
"Manufacturer:=", "Ansys", _
"Symbol:=", "bendo", _
"Footprint:=", "BENDO", _
"Description:=", "",_
"InfoTopic:=", "", _
"InfoHelpFile:=", "", _
"IconFile:=", "", _
"LibraryName:=", "", _
"OriginalLocation:=", "Project", _
"Author:=", "", _
"OriginalAuthor:=", "", _
"CreationDate:= ", 1147460679), _
"Refbase:=", "U", _
"NumParts:=", 1, _
"OriginalComponent:=", "", _
"Terminal:=", Array("n1", _
"n1", _
"A", _
false, _
0, _
1, _
"", _
"Electrical"), _
"Terminal:=", Array("n2", _
"n2", _
"A", _
false, _
1, _
0, _
"", _
"Electrical"), _
Array("NAME:Parameters", _
"MenuProp:=", Array("CoSimulator", _
"D", _
"", _
"Default,HFSS 3D Layout,Circuit,Custom,Netlist", _
0), _
"ButtonProp:=", Array("CosimDefinition", _
"D", _
"", _
"", _
"Edit", _
0, _
"ButtonPropClientData:=", Array())), _
Array("NAME:CosimDefinitions", _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 0, _
"CosimDefName:=", "HFSS 3D Layout", _
"IsDefinition:=", true, _
"CosimStackup:=", "Layout stackup", _
"CosimDmbedRatio:=", 3), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 1, _
"CosimDefName:=", "Circuit", _
"IsDefinition:=", true, _
"ExportAsNport:=", 0, _
"UsePjt:=", 0), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 2, _
"CosimDefName:=", "Custom", _
"IsDefinition:=", true, _
"DefinitionCompName:=", ""), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 3, _
"CosimDefName:=", "Netlist", _
"IsDefinition:=", true, _
"NetlistString:=", "")))
Add [("NAME:<ComponentName>",
"Info:=", <ComponentInfo>,
"RefBase:=", <string>, // reference designator
"NumParts:=", <int>, // parts per component
"OriginalComponent:=", <string>
"Terminal:=", <TerminalInfo>,
Python Syntax "Terminal:=", <TerminalInfo>, ...
The remaining parameters are optional.
["NAME:Parameters", // any combo of the following
"VariableProp:=", <VariableInfo>,
"CheckboxProp:=", <CheckBoxInfo>,
"ButtonProp:=", <ButtonInfo>,
"TextProp:=", <TextInfo>,
"NumberProp:=", <NumberInfo>,
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>],
["NAME:Properties", Any combination of the following:
"CheckboxProp:=", <CheckBoxInfo>,
"TextProp:=", <TextInfo>,
"NumberProp:=", <NumberInfo>,
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>,
"VPointProp:=", <VPointInfo>,
"PointProp:=", <PointInfo>],
["Quantities",
"QuantityProp:=", <QuantityPropInfo>...],
["NAME:CosimDefinitions",
<CosimDefInfo>,
<CosimDefInfo>...]]
oComponentManager.Add(
Python Example [
"NAME:Component",
"Info:=", [
"Type:=", 0,
"NumTerminals:=", 0,
"DataSource:=", "",
"ModifiedOn:=", 1467910752,
"Manufacturer:=", "",
"Symbol:=", "Component",
"ModelNames:=", "",
"Footprint:=", "",
"Description:=" , "",
"InfoTopic:=", "",
"InfoHelpFile:=", "",
"IconFile:=", "",
"Library:=", "",
"OriginalLocation:=", "Project",
"IEEE:=", "",
"Author:=", "",
"OriginalAuthor:=", "",
"CreationDate:=", 1467910746,
"ExampleFile:=", ""],
"Refbase:=", "U",
"NumParts:=", 1,
"ModSinceLib:=", True,
"CompExtID:=", 2
])
AddDataset
Adds a dataset. This can be executed by the oProject, or oDesign variables.
[
"NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 2,
"Y:=", 4
],
[
"NAME:Coordinate",
"X:=", 6,
"Y:=", 8
]
]
]
)
oDesign.AddDataset(
[
"NAME:$ds1",
[
"NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 2,
"Y:=", 4
],
[
"NAME:Coordinate",
"X:=", 6,
"Y:=", 8
]
]
]
)
oDesign.AddDatasetArray("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)))
AddDefinitionFromBlock
Adds a material definition from block text (same definition format as would be contained in the material library file) by library type
(using definition folder name). This scripting command directly supports the .AMAT (or .ASURF) definition formats.
UI Access N/A
h-
o-
n
S-
y-
nt-
ax
oProject = oDesktop.NewProject()
oProject.InsertDesign("HFSS", "HFSSDesign1", "DrivenModal", "")
oDesign = oProject.SetActiveDesign("HFSSDesign1")
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateBox(
P-
yt- [
h-
o-
n "NAME:BoxParameters",
E-
x-
a- "XPosition:=" , "-0.4mm",
m-
pl- "YPosition:=" , "-1mm",
e
"ZPosition:=" , "0mm",
"XSize:=" , "1.4mm",
"YSize:=" , "1.6mm",
"ZSize:=" , "0.6mm"
],
"NAME:Attributes",
"Name:=" , "Box1",
"Flags:=" , "",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"vacuum\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , True,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
oDefinitionManager = oProject.GetDefinitionManager()
defBlock = "$begin 'vacuum2' $begin 'AttachedData' $begin 'MatAppearanceData' property_data-
='appearance_data' Red=230 Green=230 Blue=230 Transparency=0.95 $end 'MatAppearanceData'
$end 'AttachedData' simple('permittivity', 1) ModTime=1499970477 $end 'vacuum2'"
added = oDefinitionManager.AddDefinitionFromBlock(defBlock, "Materials", "10101010", True)
addedName = ''
if isinstance(added, basestring):
addedName = added
elif isinstance(added, list):
addedName = added[0]
else:
"NAME:AllTabs",
"NAME:Geometry3DAttributeTab",
"NAME:PropServers",
"Box1"
],
"NAME:ChangedProps",
"NAME:Material",
"Value:=", materialNameInQuotes
]
]
]
])
AddMaterial
Adds a local material.
<MaterialParams> Array [
"NAME: <name of the material to be added>",
<MatProperty>, <MatProperty>, ...
]
Parameters
<MatProperty> Array For simple material:
"<PropertyName>:=", <value>
"property_type:=", "AnisoProperty",
"unit:=", <Unit>",
"component1:=", <value>,
"component2:=", <value>,
"component3:=", <value>))
]
<PropertyName> String Should be one of the following (depending on the material, design, and solution
types):
Electromagnetic (Maxwell-exclusive material properties omitted, see
Maxwell Scripting help):
"permittivity", "permeability", "conductivity", "dielectric_loss_tan-
gent",
"magnetic_loss_tangent", "electric_coercivity", "magnetic_coer-
civity",
"saturation_mag", "lande_g_factor", "delta_H", "delta_h_freq",
"mass_density"
Thermal (including solids, Icepak fluid flow, and Mechanical rotating fluid
modeling):
"thermal_conductivity", "mass_density", "specific_heat",
"thermal_expansion_coefficient", "thermal_material_type", "vis-
cosity",
"diffusivity", "molecular_mass", "clarity_type"
Structural:
"mass_density", "youngs_modulus", "poissons_ratio",
"thermal_expansion_coefficient"
<Unit> String Possible values (Maxwell-exclusive properties omitted, see Maxwell Scripting
Help; other missing entries are unitless):
conductivity: "siemens/m"
saturation_mag: "uTesla", "mTesla", "tesla", "kTesla", "uGauss",
"mGauss", "gauss", "kGauss"
delta_H: "A_per_meter", "kA_per_meter", "Oe", "kOe"
delta_h_frequency: "Hz", "kHz", "MHz", "GHz", "THz", "rps", "per_sec"
mass_density: "kg/m^3"
thermal_conductivity: "W/m-C"
specific_heat: "J/kg-C"
youngs_modulus: "N/m^2"
thermal_expansion_coefficient: "1/C"
AddMaterial (["NAME:<MaterialName>",
Python Syntax
<MatProperty>, <MatProperty>, ...])
oDefinitionManager.AddMaterial(
["permittivity:=", "2.2", "0.002"])
oDefinitionManager.AddMaterial [("NAME:Material2",_
"dielectric_loss_tangent:=", "44",
Array("NAME:saturation_mag",_
Python Example
"property_type:=", "AnisoProperty",_
"unit:=", "Gauss",_
"component1:=", "11", _
"component2:=", "22", _
"component3:=", "33"), _
"delta_H:=", "44Oe")]
AddMaterial Array("NAME:<MaterialName>",
VB Syntax
<MatProperty>, <MatProperty>, ...)
oDefinitionManager.AddMaterial Array(
VB Example
"permittivity:=", "2.2", "0.002")
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")
<LayerGeometryArray>,
<LayerGeometryArray....),
"hle:=", <PadInfo>
"hRg:=", <HoleRange>,
"sbsh:=", <SolderballShape>,
"sbpl:=", <SolderballPlacement>,
"sbr:=", <string>, // solderball diameter, real with units
"sb2:=", <string>, // solderball mid diameter, real with units
"sbn:=", <string>), // name of solderball material
"ppl:=", <PadPortLayerArray>)
Return Value: simple name of the added padstack
// If the name requested conflicts with the name of an existing
// padstack, the requested name is altered to be unique.
// The name returned reflects any change made to be unique.
Parameters: <PadstackName>:
<string> // simple name of padstack to create
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<LayerGeometryArray>:
Array("Name:lgm",
"lay:=", <string>, // definition layer name
"id:=", <int>, // definition layer id
"pad:=", <PadInfo>, // pad
"ant:=", <PadInfo>, // antipad
"thm:=", <PadInfo>, // themal pad
"X:=", <string>, // pad x connection, real with units
"Y:=", <string>, // pad y connection, real with units
"dir:=", <DirectionString>) // pad connection direction
<PadInfo>:
Array("shp:=", <PadShape>,
"Szs:=", <DimensionArray>,
"X:=", <string>, // x offset, real with units
"Y:=", <string>, // y offset, real with units
"R:=", <string>) // rotation, real with units
<PadShape>:
<DimensionArray>:
Array(<string>, ...) // each string is a real with units for one of the dimensions of the shape
<DirectionString>:
<string> one of these choices
"No" // no direction
"Any" // any direction
"0" // 0 degrees
"45" // 45 degrees
"90" // 90 degrees
"135" // 135 degrees
"180" // 180 degrees
"225" // 225 degrees
"270" // 270 degrees
"315" // 315 degrees
<HoleRange>:
<string> one of these choices
"Thr" // through all layout layers
"Beg" // from upper pad layer to lowest layout layer
"End" // from upper layout layer to lowest pad layer
"UTL" // from upper pad layer to lowest pad layer
<SolderballShape>:
<string> one of these choices
"None" // no solderball
"Cyl" // cylinder solderball
"Sph" // spheroid solderball
<SolderballPlacement>:
<PadPortLayerArray>:
Array( <int>, <int>,....) where each int is a layer id
VB Example:
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"SignalB", "id:=", 2, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array("shp:=", "No", "Szs:=", Array
(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"Ground", "id:=", 3, "pad:=", Array("shp:=", "No", "Szs:=", Array(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "No", "Szs:=", Array(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "R90", "Szs:=", Array( _
"3mm", "0.75mm", "1mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", _
"0mm", "dir:=", "Any"), Array("NAME:lgm", "lay:=", "Bottom signal", "id:=", 5, "pad:=", Array
("shp:=", _
"Cir", "Szs:=", Array("1mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array
("shp:=", _
"Cir", "Szs:=", Array("2mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array
("shp:=", _
"No", "Szs:=", Array(), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", _
"0mm", "dir:=", "Any")), "hle:=", Array("shp:=", "Cir", "Szs:=", Array("1.5mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "hRg:=", "End", "sbsh:=", "Sph", "sbpl:=", _
"abv", "sbr:=", "750um", "sb2:=", "1200um", "1200um", "sbn:=", "solder"), "ppl:=", Array( _
0, 1, 2, 3, 5))
Parameters: <SymbolName>:
<string> // simple name of the symbol being added
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<PinDefInfo>:
Array("NAME:PinDef",
"Pin:=", Array (<string>, // pin name
<real>, // x location
<real>, // y location
<real>, // angle in radians
<PinType>,
<real>, // line width
<real>, // line length
<bool>, // mirrored
<int>, // color
<bool>, // true if visible, false if not
<string>, // hidden net name
<OptionalPinInfo>, // optional info
<PropDisplayMapInfo>)) // optional
<PinType>:
<string> // "N" : normal pin
// "I" : input pin
// "O" : output pin
<OptionalPinInfo>:
// Specify both or neither
<bool>, // true if name is to be shown
<bool>, // true if number is to be shown
<PropDisplayMapInfo>:
Array("NAME:PropDisplayMap",
<PropDisplayInfo>,
<PropDisplayInfo>,...)
<PropDisplayInfo>:
<NameString>, Array(<DisplayTypeInfo>,
<DisplayLocationInfo>,
<int>, // optional, level number
<TextInfo>)
<NameString>:
<string> // PropertyName:=, where PropertyName is the name of
// the property to be displayed
<DisplayTypeInfo>:
<int> // 0 : No display
// 1 : Display name only
// 2 : Display value only
// 3 : Display both name and value
// 4: Display evaluated value only
// 5: Display both name and evaluated value
<DisplayLocationInfo>:
<int> // 0 : Left
// 1 : Top
// 2 : Right
// 3 : Bottom
// 4 : Center
// 5 : Custom placement
<GraphicsDataInfo>:
Array("NAME:Graphics",
// one or more of the following
<RectInfo>,
<CircleInfo>,
<ArcInfo>,
<LineInfo>,
<PolygonInfo>,
<TextInfo>,
<ImageInfo>)
<RectInfo>:
"Rect:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // angle, in radians
<real>, // x position of center
<real>, // y position of center
<real>, // width
< real>) // height
<CircleInfo>:
"Circle:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>) // radius
<ArcInfo>:
"Arc:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>, // radius
<real>, // start angle, in radians
<end>) // end angle, in radians
<LineInfo>:
"Line:=", Array(<real>, // line width
<PolygonInfo>:
"Polygon:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<PointInfo>, // must specify at least 3 points
<PointInfo>...)
<TextInfo>:
"Text:=", Array(<real>, // x position
<real>, // y position
<real>, // angle, in radians
<Justification>,
<Justification>:
<int> // 0 : left top
// 1 : left base
// 2 : left bottom
// 3 : center top
// 4 : center base
// 5 : center bottom
// 6 : right top
// 7 : right base
// 8 : right bottom
<ImageInfo>:
"Image:=", Array(<RectInfo>,
<ImageData>,
<bool>) // is mirrored
<ImageData>:
<string>, // file path
<int>, // 0 : use the file path and link to it
// 1 : ignore file path and use next parameter
<string> // text data, only present if preceding int is 1
VB Example:
oSymbolManager.Add Array("NAME:MySymbol",_
"ModTime:=", 1070989137, _
"Library:=", "", _
"LibLocation:=", "Project", _
Array("NAME:PinDef", _
"Pin:=", Array ("newpin0", _
0.00254, _ 0, _
0, _
"N",_
0, _
0.00254, _
false, _
0, _
true, _
"",_
false, _
false)), _
Array("NAME:PinDef", _
"Pin:=", Array ("newpin1", _
-0.00254, _
0, _
3.14159265358979, _
"N",_
0, _
0.00254, _
false, _
0, _
true, _
"",_
false, _
false)),
Array("NAME:Graphics", _
"Rect:=", Array(0, _
0, _
12566272, _
0, _
4.33680868994202e-019, _
-0.000635, _
0.00508, _
0.002794), _
"Circle:=", Array(0, _
0, _
12566272, _
0.000127, _
0.000635, _
0.000635)))
AreMaterialPropertiesEqual
Checks whether named material compared to added material data have equivalent major properties.
UI Access None.
Boolean:
Return Value l True – named materials have equivalent major properties.
l False – named materials do not have equivalent major properties.
AreSurfaceMaterialPropertiesEqual
Checks whether named surface material compared to added surface material data have equivalent major properties.
UI Access None.
heat:=", "960"]
<MaterialName> <String> Name of the surface material to compare with material data-
base
Boolean:
Return Value l True – named surface materials have equivalent major properties.
l False – named surface materials do not have equivalent major properties.
<PropServersArray>
Array("Name:PropServers", <PropServer>,
<PropServer>, ...)
<NewPropsArray>
Array("Name:NewProps", <PropDataArray>,
<PropDataArray>,...)
<ChangedPropsArray>
Array("Name:ChangedProps",<PropDataArray>,
<PropDataArray>, ...)
<DeletedPropsArray>
Array("Name:DeletedProps", <PropName>,
<PropName>, ...)
OR (for PropDisplay deletions only)
Array("Name:DeletedProps",<PropDataArray>,
<PropDataArray>, ...)
<PropDataArray>
Array("NAME:<PropName>",
"PropType:=", <PropType>,
"NewName:=", <string>,
"Description:=", <string>,
"Callback:=", <string>,
"NewRowPosition:=", <int>,
"ReadOnly:=", <bool>,
"Hidden:=", <bool>,
<PropTypeSpecificArgs>)OR (for PropDisplays only)
Array("Name:<PropName>",<PropDisplayData>)
<PropDisplayData>
<PropDisplayAttributes>
Layer & Location only used for PropDisplays in layout
For adding PropDisplays, this will add a single PropDisplay with attributes as shown; if an attribute is missing, a default
value will be assigned. Adding PropDisplay to schematic with attributes that are identical to one already existing there will
fail without an error message.
For deleting PropDisplays, these attributes are used to identify an existing PropDisplay to delete. If there doesn't exist a
PropDisplay that matches the given attributes, then nothing will be deleted. If multiple PropDisplays match the given attrib-
utes, then all of them will be deleted. If an attribute is missing, then all PropDisplays match that missing attribute. For
example, if Layer is missing, then PropDisplays on all layers that match the remaining given attributes will be deleted.
For changing PropDisplays, these attributes are used to identify an existing PropDisplay to change. If no PropDisplay
matching the attributes is found, no changes will be made. If multiple PropDisplays match the attributes, all of them will be
changed. If an attribute is missing, it matches all PropDisplays. For example, to change the format of PropDisplays that are
on the bottom, but have any layer, style or format to show the name only, this command should have Location set to "Bot-
tom" and all other attributes omitted.
"Format:=", <PropDisplayType>,
"Location:=", <PropDisplayLocation>,
"Layer:=", <string>,
"Style:=", <string>
<PropDisplayNewAttributes>
<PropDisplayType>
Type: string
Identifies the format of PropDisplay.
"Name"
"Value"
"NameAndValue"
"EvaluatedValue"
"NameAndEvaluatedValue"
<PropDisplayLocation>
Type: string
Identifies where PropDisplay is located with respect to object
"Left"
"Top"
"Right"
"Bottom"
"Custom"
<PropType>
Type: string
Identifies the type of property when a new property is added. In Circuit, only separator properties and variable properties
can be added.
"SeparatorProp"
"VariableProp"
"TextProp"
"NumberProp"
"ValueProp"
"CheckboxProp"
"MenuProp"
"PointProp"
"VPointProp"
"ButtonProp"
NewName
Specify the new name of a property if the property’s name is being edited. In Circuit, the name can only be changed for sep-
arators and variables.
Description
Specify a description of the property. In Circuit, the description can only be changed for separators and variables.
Callback
Specify the name of the script callback to be run when the property value is changed.
NewRowPosition
Used to reorder rows in the Property dialog box. In Circuit, this only applies to the Project>Project Variables panel and the
Designer>DesignProperties 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 Circuit, this flag can only be set for variables and sep-
arators.
Hidden
Used to hide a property so it can not be viewed outside of the Property dialog box. In Circuit, 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>
Material Button: "Material:=", <string>
Color Button: "R:=",<int>,"G:=",<int>,"B:=",<int>
Transparency Button: "Value:=", <double>
Parameters:
<OptimizationFlagsArray>
Array("NAME:Optimization",
"Included:=", <bool>,
"Min:=", <value>,
"Max:=", <value>)
<TuningFlagsArray>
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.
Max
High cut-off for the distribution.
Tol
Tolerance for uniform distributions. Format is "<int>%".
Example: "20%".
VB Example:
Adding a new project level variable "$width":
oProject.ChangeProperty Array("NAME:AllTabs",_
Array("NAME:ProjectVariableTab",_
Array("NAME:PropServers", "ProjectVariables"),_
Array("NAME:NewProps",_
Array("NAME:$width",_
"PropType:=", "VariableProp",_
"Value:=", "3mm",_
Changing a property’s value. If the following command were executed, then the value of the prop-
erty "XSize" of the PropServer
"Box1:CreateBox:1" on the "Geometry3DCmdTab" tab would be changed. (oEditor is the Geometry3D
editor in Circuit.)
oEditor.ChangeProperty Array("NAME:AllTabs",_
Array("NAME:Geometry3DCmdTab",_
Array("NAME:PropServers","Box1:CreateBox:1"),_
Array("NAME:ChangedProps",_
Array("NAME:XSize", "Value:=", "1.4mil"))))
VB Example: Changing a property’s value. If the following command were executed, then the values
of Callback and L on the PassedParameterTab would be changed.
oEditor.ChangeProperty Array("NAME:AllTabs", _
Array("NAME:PassedParameterTab", _
Array("NAME:PropServers", "CHOKE2"), _
Array("NAME:ChangedProps", _
Array("NAME:L", "Callback:=", "ac", "OverridingDef:=", true), _
Array("NAME:L", "Value:=", "1nH"))))
VB Example: Changing the Company Name, Design Name, the background color, and the Axis scaling in
a Report.
VB Example: Changing a property’s value. Note that the AllChoices parameter is only used when
the MenuProp is being added. Also note that either a string of choices separated by commas or an
Array("choice1", "choice2", "choice3") works for the AllChoices parameter.
CloneMaterial
Clones a local material.
UI Access N/A
Boolean:
Return Value l 1 - Material is cloned.
l 0 - Existing material not found or a conflict with the new material name.
DeleteDataset
Deletes a specified dataset. This can be executed by the oProject, or oDesign variables.
oProject.DeleteDataset('$ds1')
Python Example
oDesign.DeleteDataset('$ds1')
DoesMaterialExist
Checks for the presence of a material in the library by name
UI Access None.
Boolean:
Return Value l True – specified material exists.
l False – specified material does not exist.
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>),
Array("NAME:Properties", // any combo of the following
"CheckboxProp:=", <CheckBoxInfo>,
"TextProp:=", <TextInfo>,
"NumberProp:=", <NumberInfo>,
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>),
"VPointProp:=", <VPointInfo>,
"PointProp:=", <PointInfo>),
Array("Quantities",
"QuantityProp:=", <QuantityPropInfo>...),
Array("NAME:CosimDefinitions",
<CosimDefInfo>,
<CosimDefInfo>...)
Return Value: <string>
// composite name of the component.
// If the name requested conflicts with the name of an existing
// component, the requested name is altered to be unique.
Parameters: <ComponentName>:
<string> // composite name of the component to edit
<NewComponentName>:
<string> // new simple name for the component
<ComponentInfo>:
Array("Type:=", <TypeInfo>,
"NumTerminals:=", <int>,
"DataSource:=", <string>,
"ModifiedOn:=", <ModifiedOnInfo>,
"Manufacturer:=", "<string>,
"Symbol:=", <string>,
"Footprint:=", <string>,
"Description:=", <string>,
"InfoTopic:=", <string>,
"InfoHelpFile:=", <string>,
"IconFile:=", <string>,
"LibraryName:=", <string>,
"OriginalLocation:=", <string>, // Project Location
"Author:=", <string>,
"OriginalAuthor:=", <string>,
"CreationDate:= ", <int>)
<TypeInfo>:
An integer that is the or-ing of bits for each product listed below. The default setting is 0xffffffff (4294967295) which indicates
valid for all products. In the component editing dialog, checking different boxes in the "Specify products for which this com-
ponent is valid" grid control sets specific flags that correspond to the following hex/decimal settings:
Nexxim -- 100 binary, 4 decimal, 0x4
SIwaveDeNovo -- 1000 binary, 8 decimal, 0x8
Simplorer -- 10000 binary, 16 decimal, 0x10
MaxwellCircuit -- 100000 binary, 32 decimal, 0x20
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed since 00:00 hours, Jan 1, 1970 UTC from the sys-
tem clock.
<TerminalInfo>:
Array(<string>, // symbol pin
<string> // footprint pin
<string >, // gate name
<bool>, // shared
<int>, // equivalence number
<int>, // what to do if unconnected: flag as error:0, ignore:1
<string>, // description
<Nature>)
<Nature>:
<string> // content varies as follows
Nexxim/Circuit:
"Electrical" // the only choice
Simplorer:
// several choices
"Electrical", "Magnetic", "Fluidic", "Translational",
"Translational_V", "Rotational", "Rotational_V",
""Radiant", "Thermal", or <VHDLPackageName>
<VHDLPackageName>:
<string> // in the form <Library>.<Package>
<Library>:
<string> // name of the VHDL library
<Package>:
<string> // name of the VHDL package
<VariableInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: number, variable, or expression
<FlagLetters>:
<string> // "D" - has description parameter,
// "RD" - readonly & has description parameter,
// or "RHD" - readonly, hidden, & has description parameter
<CheckBoxInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<bool>) // value: true or false
<ButtonInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // button title
<string>, // extra text
<ClientID>,
"ButtonPropClientData:= ", <ClientDataArray>)
<ClientID>:
<int> // specifies Button Prop Client
// 0 - unknown, "ButtonPropClientData
// array will be empty
// 1 - Netlist Prop Client
// 2 - not used
// 3 - File Name Prop Client
<ClientDataArray>:
varies with <ClientID>
<ClienID> is 3:
Array("InternalFormatText:=", "<prefix><RelativePath>")
<prefix>:
<string> // "<Project>", "<PersonalLib>", "<UserLib>", or "<SysLib>"
<RelativePath>:
<string> // relative path to file from <prefix>
<TextInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a text string
<NumberInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<real>, // value: a number
<string>) // units
<SeparatorInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a text string
<ValueInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a number, variable or expression
<MenuPropInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // menu choices - separated by commas
<int>) // 0 based index of current menu choice
<VPointInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>, // x value: number with length units
<string>) // y value: number with length units
<PointInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<real>, // x value
<real>) // y value
<QuantityPropInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // value
<TypeString>,
<TypeStringDependentInfo>)
<TypeString>:
<string> // "Across", "Through", or "Free"
<TypeStringDependentInfo>:
"Free" :
"Across" or "Through"
<int>, // terminal 1
<int> // terminal 2
<CosimDefInfo>:
Array("NAME:CosimDefinition",
"CosimulatorType:=", <int>,
"CosimDefName:=", <string> // "HFSS3D", "Circuit",
// "Custom", or "Netlist"
"IsDefinition:=", <bool>,
final array member(s) vary with CosimDefName)
"ExportAsNport:=", <int>,
"UsePjt:=", <int>
"InfoTopic:=", "NXBJT1.htm", _
"InfoHelpFile:=", "nexximcomponents.chm", _
"IconFile:=", "bjtsn.bmp", _
"Library:=", "Nexxim Circuit Elements\BJTs", _
"OriginalLocation:=", "SysLibrary ", _
"Author:=", "", _
"OriginalAuthor:=", "", _
"CreationDate:=", 1152722102), _
"Refbase:=", "Q", _
"NumParts:=", 1, _
"Terminal:=", Array("collector", _
"collector", _
"A", _
false, _
6, _
0, _
"", _
"Electrical"), _
"Terminal:=", Array("base", _
"base", _
"A", _
false, _
7, _
0, _
"", _
"Electrical"), _
"Terminal:=", Array("emitter", _
"emitter", _
"A", _
false, _
8, _
0, _
"", _
"Electrical"), _
Array("NAME:Parameters", _
"TextProp:=", Array("LabelID", _
"HD", _
"Property string for netlist ID", _
"Q@ID"), _
"TextProp:=", Array("MOD", _
"D", _
"HD", _
"", _
"Q@ID %0 %1 %2 *MOD(@MOD) *AREA(AREA=@AREA)" & _
" *AREAB(AREAB=@AREAB) *AREAC(AREAC=@" & _
"AREAC) *DTEMP(DTEMP=@DTEMP) *M(M=@M)", _
"Q@ID %0 %1 %2 *MOD(@MOD) " & _ "*AREA(AREA=@AREA) AREAB(AREAB=@AREAB) *AREAC(AREAC=@" & _
"AREAC) *DTEMP(DTEMP=@DTEMP) *M(M=@M)", _
1, _
"ButtonPropClientData:=", Array()), _
"TextProp:=", Array( "ModelName", _
"HD", _
"", _
"Q"))))
VB Example:
Dim name2
name2 = oComponentManager.Edit "MyComponent", _
(Array("NAME:MyOtherComponent", _
"Info:=", Array("Type:=", 4294901767, _
"NumTerminals:=", 2, _
"DataSource:=", "", _
"ModifiedOn:=", 1071096503, _
"Manufacturer:=", "Ansys", _
"Symbol:=", "bendo", _
"Footprint:=", "BENDO", _
"Description:=", "",_
"InfoTopic:=", "", _
"InfoHelpFile:=", "", _
"IconFile:=", "", _
"LibraryName:=", "", _
"OriginalLocation:=", "Project", _
"Author:=", "", _
"OriginalAuthor:=", "", _
"CreationDate:= ", 1147460679), _
"Refbase:=", "U", _
"NumParts:=", 1, _
"OriginalComponent:=", "", _
"Terminal:=", Array("n1", _
"n1", _
"A", _
false, _
0, _
0, _
"", _
"Electrical"), _
"Terminal:=", Array("n2", _
"n2", _
"A", _
false, _
1, _
0, _
"", _
Electrical"), _
Array("NAME:Parameters", _
"MenuProp:=", Array("CoSimulator", _
"D", _
"", _
"Default,HFSS3D,Circuit,Custom,Netlist", _
0), _
"ButtonProp:=", Array("CosimDefinition", _
"D", _
"", _
"", _
"Edit", _
0, _
"ButtonPropClientData:=", Array())), _
Array("NAME:CosimDefinitions", _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 0, _
"CosimDefName:=", "HFSS3D", _
"IsDefinition:=", true, _
"CosimStackup:=", "Layout stackup", _
"CosimDmbedRatio:=", 3), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 1, _
"CosimDefName:=", "Circuit", _
"IsDefinition:=", true, _
"ExportAsNport:=", 0, _
"UsePjt:=", 0), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 2, _
"CosimDefName:=", "Custom", _
"IsDefinition:=", true, _
"DefinitionCompName:=", ""), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 3, _
"CosimDefName:=", "Netlist", _
"IsDefinition:=", true, _
"NetlistString:=", "")))
Edit <ComponentName>,
["NAME:<NewComponentName>",
"Info:=", <ComponentInfo>,
"RefBase:=", <string>, // reference designator
"NumParts:=", <int>, // parts per component
"OriginalComponent:=", <string>
Python Syntax "Terminal:=", <TerminalInfo>,
"Terminal:=", <TerminalInfo>, ...
#The remaining parameters are optional
["NAME:Parameters", // any combo of the following
"VariableProp:=", <VariableInfo>,
"CheckboxProp:=", <CheckBoxInfo>,
"ButtonProp:=", <ButtonInfo>,
"TextProp:=", <TextInfo>,
"NumberProp:=", <NumberInfo>,
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>],
["NAME:Properties", # any combo of the following
"CheckboxProp:=", <CheckBoxInfo>,
"TextProp:=", <TextInfo>,
"NumberProp:=", <NumberInfo>,
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>),
"VPointProp:=", <VPointInfo>,
"PointProp:=", <PointInfo>),
["Quantities",
"QuantityProp:=", <QuantityPropInfo>...],
["NAME:CosimDefinitions",
<CosimDefInfo>,
<CosimDefInfo>...])
Python
name = oComponentManager.Edit ("Simplorer Circuit Elements\BJTs:Level01_NPN", _
Example ["NAME:Level01_NPN", "Info:=", ["Type:=", 4294901764,_
cur-
rents, resistances, and capacitances", "1"], _
"VariableProp:=", ["AREAB", "D", "Base AREA", _
"1"], "VariableProp:=", ["AREAC", "D", "Collector AREA", _
"1"], "VariableProp:=", ["DTEMP", "D", _
"The difference between element and circuit temperature (deg Cel)", _
"0"], "VariableProp:=", ["M", "D", _
"Multiplier factor to simulate multiple BJTs in parallel", _
"1"], "ButtonProp:=", ["NexximNetlist", "HD", "", _
"Q@ID %0 %1 %2 *MOD(@MOD) *AREA(AREA=@AREA)"& _
["NAME:CosimDefinitions", ["NAME:CosimDefinition", _
["NAME:CosimDefinition", "CosimulatorType:=", 3, _
"NetlistString:=", ""]]])
EditDataset
Modifies a dataset. This can be executed by the oProject, or oDesign variables.
]
]
)
oDesign.EditDataset ("ds1"
["NAME:ds2",
["NAME:Coordinates",
[
"NAME:Coordinate",
"X:=", 1, "Y:=", 2
],
[
"NAME:Coordinate",
"X:=", 3, "Y:=", 4
]
]
]
)
EditMaterial
Modifies an existing material.
types>
],
<Optional ModifierDataArray>,
"permeability:=" , <string containing value>,
"conductivity:=" , <string containing value>,
"thermal_conductivity:=", <string containing value>,
"mass_density:=" , <string containing value>,
"specific_heat:=" , <string containing value>,
"youngs_modulus:=" , <string containing value>,
"poissons_ratio:=" , <string containing value>,
"thermal_expansion_coefficient:=", <string con-
taining value>
]
<Modi- Array Optional structured array containing thermal or spatial modifiers:
fierDataArray>
[
"NAME:ModifierData",
[
"NAME:<ThermalModifierData or SpatialModifierData>",
"modifier_data:=" , <"thermal_modifier_data" or "spa-
tial_modifier_data">,
[
"NAME:<all_thermal_modifiers or all_spatial_mod-
ifiers>",
[
"NAME:<modifierName>",
"Property::=" , <string property being mod-
ified>,
"Index::=" , <integer>,
"prop_modifier:=" , <"thermal_modifier" or
"spatial_modifier">,
"use_free_form:=" , <Boolean>,
"free_form_value:=" , <string modifier
value>,
]
]
]
]
[
"NAME:alumina_92pct",
"CoordinateSystemType:=" , "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic","Thermal","Structural"]
],
"permittivity:=" , "9.3",
"dielectric_loss_tangent:=" , "0.008",
"thermal_conductivity:=" , "26",
"mass_density:=" , "3720",
"specific_heat:=" , "790",
"youngs_modulus:=" , "267000000000",
"poissons_ratio:=" , "0.26",
"thermal_expansion_coeffcient:=", "7.2e-006"
]
)
With Thermal Modifier:
oDefinitionManager.EditMaterial("copper",
[
"NAME:copper",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic","Thermal","Structural"]
],
[
"NAME:ModifierData",
[
"NAME:ThermalModifierData",
"modifier_data:=" , "thermal_modifier_data",
[
"NAME:all_thermal_modifiers",
[
"NAME:one_thermal_modifier",
"Property::=" , "permittivity",
"Index::=" , 0,
"prop_modifier:=" , "thermal_modifier",
"use_free_form:=" , True,
import ScriptEnv
ScriptEnv.Initialize("Ansoft.ElectronicsDesktop")
oDesktop.RestoreWindow()
oProject = oDesktop.SetActiveProject("Drude_plasma_parameters_r231")
oDefinitionManager = oProject.GetDefinitionManager()
oDefinitionManager.EditMaterial("Drude",
[
"NAME:Drude",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic"]
],
[
"NAME:AttachedData",
[
"NAME:MatNonLinearDrudeFreqDepData",
"property_data:=" , "nonlinear_drude_data",
"EpsilonInfinity:=" , "1",
"PlasmaFrequency:=" , "4.62348462366278GHz",
"CollisionFrequency:=" , "0.00054491190162662GHz",
"FieldBreakdown:=" , "10000V_per_meter",
"PlasmaMaintainFrequency:=", "2.31174231183139GHz",
"NeutralDensity:=" , 2.65164580488373E+20,
"ElectronDensity:=" , 2.65164580488373E+17,
"CollisionRateConstant:=", 2.05499505485618E-15
]
]
])
Without Modifiers:
oDefinitionManager.EditMaterial "alumina_92pct",
Array(
VB "NAME:alumina_92pct",
Example "CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=", 1,
Array("NAME:PhysicsTypes",
"set:=", Array("Electromagnetic","Thermal","Structural")),
"permittivity:=", "9.3",
"dielectric_loss_tangent:=", "0.008",
"thermal_conductivity:=", "26",
"mass_density:=", "3720",
"specific_heat:=", "790",
"youngs_modulus:=", "267000000000",
"poissons_ratio:=", "0.26",
"thermal_expansion_coeffcient:=", "7.2e-006"
)
With Thermal Modifier:
oDefinitionManager.EditMaterial "copper",
Array("NAME:copper",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
Array("NAME:PhysicsTypes",
"set:=" , Array("Electromagnetic","Thermal","Structural")),
Array("NAME:ModifierData",
Array("NAME:ThermalModifierData",
"modifier_data:=" , "thermal_modifier_data",
Array("NAME:all_thermal_modifiers",
Array("NAME:one_thermal_modifier",
"Property::=" , "permittivity",
"Index::=" , 0,
"prop_modifier:=" , "thermal_modifier",
"use_free_form:=" , True,
"free_form_value:=" , "if(Temp > 1000cel, 1, if(Temp < -273.15cel,
1, 1))"
)
)
)
),
"permeability:=" , "0.999991",
"conductivity:=" , "58000000",
"thermal_conductivity:=" , "400",
"mass_density:=" , "8933",
"specific_heat:=" , "385",
"youngs_modulus:=" , "120000000000",
"poissons_ratio:=" , "0.38",
"thermal_expansion_coefficient:=" , "1.77e-05"
)
Parameters: <PadstackName>:
<string> // composite name of padstack to edit
<NewPadstackName>:
<string> // new simple name for padstack
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<LayerGeometryArray>:
Array("Name:lgm",
<PadInfo>:
Array("shp:=", <PadShape>,
"Szs:=", <DimensionArray>,
"X:=", <string>, // x offset, real with units
"Y:=", <string>, // y offset, real with units
"R:=", <string>) // rotation, real with units
<PadShape>:
<string> one of these choices
"No" // no pad
"Cir" // Circle
"Sq" // Square
"Rct" // Rectangle
"Ov" // Oval
"Blt" // Bullet
"Ply" // Polygons
"R45" // Round 45 thermal
"R90" // Round 90 thermal
"S45" // Square 45 thermal
"S90" // Square 90 thermal
<DimensionArray>:
Array(<string>, ...) // each string is a real with units for one of the
// dimensions of the shape
<DirectionString>:
<string> one of these choices
"No" // no direction
"Any" // any direction
"0" // 0 degrees
"45" // 45 degrees
"90" // 90 degrees
<HoleRange>:
<string> one of these choices
"Thr" // through all layout layers
"Beg" // from upper pad layer to lowest layout layer
"End" // from upper layout layer to lowest pad layer
"UTL" // from upper pad layer to lowest pad layer
<SolderballShape>:
<string> one of these choices
"None" // no solderball
"Cyl" // cylinder solderball
"Sph" // spheroid solderball
<SolderballPlacement>:
<string> one of these choices
"abv" // above padstack
<PadPortLayerArray>:
Array( <int>, <int>,....) where each int is a layer id
VB Example:
oPadstackManager.Edit "Circle - through1", Array("NAME:Circle - through1", "ModTime:=", _
1235765635, "Library:=", "", "LibLocation:=", "Project", Array("NAME:psd", "nam:=", _
"Circle - through1", "lib:=", "", "mat:=", "", "plt:=", "0", Array("NAME:pds", Array("NAME:lgm",
"lay:=", _
"Top Signal", "id:=", 0, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2.5mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3.5mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "No", "Szs:=", Array
(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"SignalA", "id:=", 1, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "No", "Szs:=", Array(),
"X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"SignalB", "id:=", 2, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array("shp:=", "No", "Szs:=", Array
(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"Ground", "id:=", 3, "pad:=", Array("shp:=", "No", "Szs:=", Array(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "No", "Szs:=", Array(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "R90", "Szs:=", Array( _
"3mm", "0.75mm", "1mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", _
"0mm", "dir:=", "Any"), Array("NAME:lgm", "lay:=", "Bottom signal", "id:=", 5, "pad:=", Array
("shp:=", _
"Cir", "Szs:=", Array("1mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array
("shp:=", _
"Cir", "Szs:=", Array("2mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array
("shp:=", _
"No", "Szs:=", Array(), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", _
"0mm", "dir:=", "Any")), "hle:=", Array("shp:=", "Cir", "Szs:=", Array("1.5mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "hRg:=", "End", "sbsh:=", "Sph", "sbpl:=", _
"abv", "sbr:=", "750um", "sb2:=", "1200um", "1200um", "sbn:=", "solder"), "ppl:=", Array( _
0, 1, 2, 3, 5))
ExportDataset
Exports a dataset to a named file. This can be executed by the oProject, or oDesign variables.
<LibraryLocation>
Return Value: None
Parameters: <LibraryName>:
<string> // name of the library
<FootprintName>:
<string> // composite name of footprint to export
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oFootprintManager.Export Array("NAME:mylib", "Distributed Footprints:BPAD"), "PersonalLib"
ExportMaterial
Exports a local material to a library.
<PadstackName>:
<string> // simple name of padstack to export
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oPadstackManager.Export Array("NAME:mylib", "myPadstack"), "PersonalLib"
ExportScript
Use: Export to Library in the script definition manager
Command: None
Syntax: ExportScript <ExportData>,<Library location>
Return Value: None
Parameters: <ExportData>
Array("NAME:<LibraryName>",<ScriptName>,<ScriptName>,…)
VB Example:
<SymbolName>:
<string> // composite name of symbol to export
<LibraryLocation>:
VB Example:
oSymbolManager.Export _
Array("NAME Nexxim Circuit Elements\Distributed\Distributed:bendo:mylib", _ "mySymbol"), "Per-
sonalLib"
GetProjextMaterialNames
Returns the material names belonging to an active Project.
UI Access N/A
GetPropertyValue
Returns the value of a single property belonging to a specific <PropServer> and <PropTab>. This function is available with the Project,
Design or Editor objects, including definition editors.
Tip:
Use the script recording feature and edit a property, and then view the resulting script to see the format for that property.
UI Access N/A
<PropServer> String An object identifier, generally returned from another script method, such as
Comp-
Inst@R;2;3
<PropName> String Name of the property.
ImportDataset
Imports a dataset from a named file. This can be executed by the oProject, or oDesign variables. The name of the dataset is file-
name+index number (e.g., dsdata1) unless the filename ends with a trailing number. When there is a trailing number at the end, we
will remove the number and use first unused index.
Tab-delimited or space-delimited files with the extension ".tab" is the recommended file type to be used.
For importing datasets at the Design level, this is the only file type supported.
At the Project level, other file types (e.g., ".csv") are supported. However, after calling the command, you must configure the file import
format manually through the GUI as shown in the figure below.
<IsProjectComponent>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oComponentManager.Remove "Nexxim Circuit Elements\BJTs:Level01_NPN", _ true, "Project"
<IsProjectFootprint>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oFootprintManager.Remove "BPAD", true, "Distributed Footprints", "Project"
oFootprintManager.Remove "BPAD", false, "MyLib", "PersonalLib"
RemoveMaterial
Removes a material from a library.
<IsProjectPadstack>,
<LibraryName>,
<LibraryLocation>
Return Value: None
Parameters: <PadstackName>:
<string> // simple name of the padstack to remove
<IsProjectPadstack>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
RemoveScript
Use: Remove Script in the script definition manager
Command: None
Syntax: RemoveScript <ScriptName>,<IsProjectScript>, <LibraryName>,<LibraryLocation>
Return Value: None
Parameters: <ScriptName>
Type: <string>
<IsProjectScript>
Type: <bool>
<LibraryName>
Type: <string>
<LibraryLocation>
Type: <string>
VB Example:
oDefinitionManager.RemoveScript "myscript", true, "Local", "Project"
<IsProjectSymbol>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oSymbolManager.Remove "Nexxim Circuit Elements\Distributed\Distributed:bendo", true, "Project"
RemoveUnusedDefinitions
Removes any unused project definitions.
"Steel-oxidised-surface"
]
])
VB RemoveUnusedDefinitions <Definitions>
Syntax
VB
oProject.RemoveUnusedDefinitions Array(Array("NAME:Materials", "Al-Extruded"), Array
Exampl- ("NAME:SurfaceMaterials", _
e "Steel-oxidised-surface"))
SetPropertyValue
Sets the value of a single propertybelonging to a specific PropServer and PropTab. This function is available with the Project, Design
or Editor objects, including definition editors.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.
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.
UI Access N/A
l ConstantsTab ("Constants")
l ComponentTab ("General")
l Component("Component")
l Quantities ("Quantities")
l Signals ("Signals")
<propServer> String An object identifier, generally returned from another script method, such as
Comp-Inst@R;2;3
<propName> String Name of the property.
<propValue> String The value for the property
UpdateDefFromBlock
Updates a material definition from block text (same definition format as would be contained in the material library file) by library type
(using definition folder name). This scripting command directly supports the .AMAT (or .ASURF) definition formats.
UI Access N/A
<targetDefName> String Name of the target definition, i.e. the name of the material to update (string).
Parameters <defBlock> String Text of the new material definition in block format (string); this block could use a
new definition name, which will cause a rename as part of the update.
<defFolderName> String Library type (by definition, folder name).
<newTimeStamp> String New timestamp string (time_t as integer, number of seconds since 1/1/1970
12:00am), default is current time.
oProject = oDesktop.NewProject()
oProject.InsertDesign("HFSS", "HFSSDesign1", "DrivenModal", "")
oDesign = oProject.SetActiveDesign("HFSSDesign1")
oEditor = oDesign.SetActiveEditor("3D Modeler")
oDefinitionManager = oProject.GetDefinitionManager()
defBlock = "$begin 'vacuum2' $begin 'AttachedData' $begin 'MatAppearanceData' property_data-
='appearance_data' Red=230 Green=230 Blue=230 Transparency=0.95 $end 'MatAppearanceData'
$end 'AttachedData' simple('permittivity', 1) ModTime=1499970477 $end 'vacuum2'"
P- added = oDefinitionManager.AddDefinitionFromBlock(defBlock, "Materials", "10101010", True)
yt-
h- addedName = ''
o-
n
if isinstance(added, basestring):
E- addedName = added
x-
a- elif isinstance(added, list):
m-
pl- addedName = added[0]
e
else:
UpdateDynamicLink
Add [component manager]
Use:Add a component
Command: Tools > Edit Configured Libraries > Components > Add Component
Syntax:Add Array("NAME:<ComponentName>",
"Info:=", <ComponentInfo>,
"RefBase:=", <string>, // reference designator
"NumParts:=", <int>, // parts per component
"OriginalComponent:=", <string>
"Terminal:=", <TerminalInfo>,
"Terminal:=", <TerminalInfo>, ...
// The remaining parameters are optional
Array("NAME:Parameters", // any combo of the following
"VariableProp:=", <VariableInfo>,
"CheckboxProp:=", <CheckBoxInfo>,
"ButtonProp:=", <ButtonInfo>,
"TextProp:=", <TextInfo>,
"NumberProp:=", <NumberInfo>,
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>),
Parameters:<ComponentName>:
<string> // simple name of the component
<ComponentInfo>:
Array("Type:=", <TypeInfo>,
"NumTerminals:=", <int>,
"DataSource:=", <string>,
"ModifiedOn:=", <ModifiedOnInfo>,
"Manufacturer:=", "<string>,
"Symbol:=", <string>,
"Footprint:=", <string>,
"Description:=", <string>,
"InfoTopic:=", <string>,
"InfoHelpFile:=", <string>,
"IconFile:=", <string>,
"LibraryName:=", "",
"OriginalLocation:=", "Project", // Project Location
"Author:=", <string>,
"OriginalAuthor:=", <string>,
"CreationDate:= ", <int>)
<TypeInfo>:
An integer that is the or-ing of bits for each product listed below. The default setting is 0xffffffff (4294967295) which indicates
valid for all products. In the component editing dialog, checking different boxes in the "Specify products for which this com-
ponent is valid" grid control sets specific flags that correspond to the following hex/decimal settings:
Nexxim -- 100 binary, 4 decimal, 0x4
SIwaveDeNovo -- 1000 binary, 8 decimal, 0x8
Simplorer -- 10000 binary, 16 decimal, 0x10
MaxwellCircuit -- 100000 binary, 32 decimal, 0x20
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed since 00:00 hours, Jan 1, 1970 UTC from the sys-
tem clock.
<TerminalInfo>:
Array(<string>, // symbol pin
<string> // footprint pin
<string >, // gate name
<bool>, // shared
<int>, // equivalence number
<int>, // what to do if unconnected: flag as error:0, ignore:1
<string> // description
<Nature>)
<Nature>:
<string> // content varies as follows
Nexxim/Circuit:
"Electrical" // the only choice
Simplorer:
// several choices
"Electrical", "Magnetic", "Fluidic", "Translational",
"Translational_V", "Rotational", "Rotational_V",
""Radiant", "Thermal", or <VHDLPackageName>
<VHDLPackageName>:
<string> // in the form <Library>.<Package>
<Library>:
<string> // name of the VHDL library
<Package>:
<VariableInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: number, variable, or expression
<FlagLetters>:
<string> // "D" - has description parameter,
// "RD" - readonly & has description parameter,
// or "RHD" - readonly, hidden, & has description parameter
<CheckBoxInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<bool>) // value: true or false
<ButtonInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // button title
<string>, // extra text
<ClientID>,
"ButtonPropClientData:= ", <ClientDataArray>)
<ClientID>:
<int> // specifies Button Prop Client
// 0 - unknown, ButtonPropClientData
// array will be empty
// 1 - Netlist Prop Client
// 2 - not used
// 3 - File Name Prop Client
<ClientDataArray>:
varies with <ClientID>
<ClientID> is 3:
Array("InternalFormatText:=", "<prefix><RelativePath>")
<prefix>:
<string> // "<Project>", "<PersonalLib>", "<UserLib>", or "<SysLib>"
<RelativePath>:
<string> // relative path to file from <prefix>
<TextInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a text string
<NumberInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<real>, // value: a number
<string>) // units
<SeparatorInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a text string
<ValueInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a number, variable or expression
<MenuPropInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // menu choices - separated by commas
<int>) // 0 based index of current menu choice
<VPointInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>, // x value: number with length units
<string>) // y value: number with length units
<PointInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<real>, // x value
<real>) // y value
<QuantityPropInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // value
<TypeString>,
<TypeStringDependentInfo>)
<TypeString>:
<string> // "Across", "Through", or "Free"
<TypeStringDependentInfo>:
<TypeString> is "Free" :
<string>, // direction: "In", "Out", "InOut", or "DontCare"
// Following <string> is not present if direction is "DontCare"
<string> // when to calculate: "BeforeAnalogSolver",
// "BeforeStateGraph", "AfterStateGraph", or "DontCareWhen"
<int> // terminal 2
<CosimDefInfo>:
Array("NAME:CosimDefinition",
"CosimulatorType:=", <int>,
"CosimDefName:=", <string> // "HFSS 3D Layout", "Circuit",
// "Custom", or "Netlist"
"IsDefinition:=", <bool>,
final array member(s) vary with CosimDefName)
VB Example:
Dim name
oComponentManager.Add (Array("NAME:MyComponent", _
"Info:=", Array("Type:=", 4294901767, _
"NumTerminals:=", 2, _
"DataSource:=", "", _
"ModifiedOn:=", 1071096503, _
"Manufacturer:=", "Ansys", _
"Symbol:=", "bendo", _
"Footprint:=", "BENDO", _
"Description:=", "",_
"InfoTopic:=", "", _
"InfoHelpFile:=", "", _
"IconFile:=", "", _
"LibraryName:=", "", _
"OriginalLocation:=", "Project", _
"Author:=", "", _
"OriginalAuthor:=", "", _
"CreationDate:= ", 1147460679), _
"Refbase:=", "U", _
"NumParts:=", 1, _
"OriginalComponent:=", "", _
"Terminal:=", Array("n1", _
"n1", _
"A", _
false, _
0, _
1, _
"", _
"Electrical"), _
"Terminal:=", Array("n2", _
"n2", _
"A", _
false, _
1, _
0, _
"", _
"Electrical"), _
Array("NAME:Parameters", _
"MenuProp:=", Array("CoSimulator", _
"D", _
"", _
"Default,HFSS 3D Layout,Circuit,Custom,Netlist", _
0), _
"ButtonProp:=", Array("CosimDefinition", _
"D", _
"", _
"", _
"Edit", _
0, _
"ButtonPropClientData:=", Array())), _
Array("NAME:CosimDefinitions", _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 0, _
"CosimDefName:=", "HFSS 3D Layout", _
"IsDefinition:=", true, _
"CosimStackup:=", "Layout stackup", _
"CosimDmbedRatio:=", 3), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 1, _
"CosimDefName:=", "Circuit", _
"IsDefinition:=", true, _
"ExportAsNport:=", 0, _
"UsePjt:=", 0), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 2, _
"CosimDefName:=", "Custom", _
"IsDefinition:=", true, _
"DefinitionCompName:=", ""), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 3, _
"CosimDefName:=", "Netlist", _
"IsDefinition:=", true, _
"NetlistString:=", "")))
Add [("NAME:<ComponentName>",
Python Syntax "Info:=", <ComponentInfo>,
"RefBase:=", <string>, // reference designator
"VPointProp:=", <VPointInfo>,
"PointProp:=", <PointInfo>],
["Quantities",
"QuantityProp:=", <QuantityPropInfo>...],
["NAME:CosimDefinitions",
<CosimDefInfo>,
<CosimDefInfo>...]]
oComponentManager.Add(
[
"NAME:Component",
"Info:=", [
"Type:=", 0,
"NumTerminals:=", 0,
Python Example "DataSource:=", "",
"ModifiedOn:=", 1467910752,
"Manufacturer:=", "",
"Symbol:=", "Component",
"ModelNames:=", "",
"Footprint:=", "",
"Description:=" , "",
"InfoTopic:=", "",
"InfoHelpFile:=", "",
"IconFile:=", "",
"Library:=", "",
"OriginalLocation:=", "Project",
"IEEE:=", "",
"Author:=", "",
"OriginalAuthor:=", "",
"CreationDate:=", 1467910746,
"ExampleFile:=", ""],
"Refbase:=", "U",
"NumParts:=", 1,
"ModSinceLib:=", True,
"CompExtID:=", 2
])
<DataType>:
<string> // "DesignerData" or "Q3DData"
<InterpolationAlgorithm>:
<string> // "auto", "lin", "shadH", or "shadNH"
<NewToOldMapPairs>:
Array of name/value pairs such as "V1", "V2" that will have the new variable name first and the old variable name second.
<OldToNewMapPairs>:
Array of name/value pairs such as "V1", "V2" that will have the old variable name first and the new variable name second.
VB Example:
oComponentManager.AddDynamicNPortData
Array("NAME:ComponentData", _
"ComponentDataType:=", "DesignerData", _
"name:=", "DesignerData", _
"filename:=", _
"C:/Program Files/AnsysEM/Designer/Examples/Projects/optiguides/optiguides.adsn", _
"numberofports:=", 2, _
"DesignName:=", "DesignerModel1", _
"SolutionName:=", "Setup1 : Adaptive_1", _
"Simulate:=", true, _
"CloseProject:=", false, _
"SaveProject:=", true, _
"RefNode:=", false, _
"InterpY:=", true, _
"InterpAlg:=", "auto", _
"NewToOldMap:=", Array("nport_height:=", "$height", _
"nport_length:=", "$length", _
"nport_width:=", "$width"), _
"OldToNewMap:=", Array("$height:=", "nport_height", _
"$length:=", "nport_length", _
"$width:=", "nport_width"), _
<ProductOptionsInfo>)
Return Value: <string>
// composite name of the component.
// If the name requested conflicts with the name of an existing
// component, the requested name is altered to be unique.
// The name returned reflects any change made to be unique.
Parameters: <ComponentDataName>:
<string> // simple name of the component
<LocationType>:
<string> // one of "UsePath", "PersonalLib", "UserLib", "SysLib",
// or "Project".
<dcInfo>:
<string> // one of "DCOpen", "DCShort", "DCShShort",
// "DCNone", or "DCEmpty".
<DisplayInfo>:
<string> // one of "MagnitudePhase", "RealImaginary",
// or "DbPhase".
<ProductOptionsInfo>:
// The remaining parameters differ by product
// Nexxim
"DCOption:=", <NexximDCOption>,
"InterpOption:=", <NexximInterpOption>,
"ExtrapOption:=", <NexximExtrapOption>,
"DataType:=", 2
<NexximDCOption>:
<int> // 0 : Zero Padding
// 1 : Same as last point
// 2 : Linear extrapolation from last 2 points
<NexximInterpOption>:
<int> // 0 : Step
// 1 : Linear
<NexximExtrapOption>:
<int> // 0 : Zero padding
// 1 : Same as last point
// 2 : Linear extrapolation from last 2 points
// 3 : Constant magnitude, linear phase extrapolation
<CircuitDCOption>:
<int> // 0 : Leave all signal lines open circuited
// 1 : Short all signal lines together
// 2 : Short all signal lines to ground
// 3 : Extrapolate from data provided (not recommended)
<CircuitInterpOption>:
<int> // 0 : Linear
// 1 : Cubic spline
// 2 : Rational polynomial
<CircuitExtrapOption>:
<int> // 0 : Same as interpolation
// 1 : Zero padding
// 2 : Same as last point
VB Example:
oComponentManager.AddNPortData Array("NAME:ComponentData", _
"ComponentDataType:=", "NPortData", _
"name:=", "NportData", _
"filename:=", "", _
"numberofports:=", 2, _
"filelocation:=", "UsePath", _
"domain:=", "frequency", _
"datamode:=", "Import", _
"devicename:=", "", _
"ImpedenceTab:=", true, _
"NoiseDataTab:=", true, _
"DCBehaviorTab:=", true, _
"SolutionName:=", "", _
"displayformat:=", "MagnitudePhase", _
"datatype:=", "SMatrix", _
"ShowRefPin:=", true, _
"RefNodeCheckbox:=", false, _
"DCOption:=", 3, _
"InterpOption:=", 1, _
"ExtrapOption:=", 3, _
"DataType:=", 2, _
"DCOption:=", 3, _
"InterpOption:=", 1, _
"ExtrapOption:=", 3, _
"DataType:=", 2)
AddSolverOnDemandModel
Use: This method looks for a local component of the name passed in, and to this component it adds an SOD model definition using the
information passed in the VARIANT. It returns the name of the SOD model added.
Parameters: BSTR component name.
Parameters: VARIANT which is the SOD model data.
Array("Quantities",
"QuantityProp:=", <QuantityPropInfo>...),
Array("NAME:CosimDefinitions",
<CosimDefInfo>,
<CosimDefInfo>...)
Return Value: <string>
// composite name of the component.
// If the name requested conflicts with the name of an existing
// component, the requested name is altered to be unique.
// The name returned reflects any change made to be unique.
Parameters: <ComponentName>:
<string> // composite name of the component to edit
<NewComponentName>:
<string> // new simple name for the component
<ComponentInfo>:
Array("Type:=", <TypeInfo>,
"NumTerminals:=", <int>,
"DataSource:=", <string>,
"ModifiedOn:=", <ModifiedOnInfo>,
"Manufacturer:=", "<string>,
"Symbol:=", <string>,
"Footprint:=", <string>,
"Description:=", <string>,
"InfoTopic:=", <string>,
"InfoHelpFile:=", <string>,
"IconFile:=", <string>,
"LibraryName:=", <string>,
"OriginalLocation:=", <string>, // Project Location
"Author:=", <string>,
"OriginalAuthor:=", <string>,
"CreationDate:= ", <int>)
<TypeInfo>:
An integer that is the or-ing of bits for each product listed below. The default setting is 0xffffffff (4294967295) which indicates
valid for all products. In the component editing dialog, checking different boxes in the "Specify products for which this com-
ponent is valid" grid control sets specific flags that correspond to the following hex/decimal settings:
Nexxim -- 100 binary, 4 decimal, 0x4
SIwaveDeNovo -- 1000 binary, 8 decimal, 0x8
Simplorer -- 10000 binary, 16 decimal, 0x10
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed since 00:00 hours, Jan 1, 1970 UTC from the sys-
tem clock.
<TerminalInfo>:
Array(<string>, // symbol pin
<string> // footprint pin
<string >, // gate name
<bool>, // shared
<int>, // equivalence number
<int>, // what to do if unconnected: flag as error:0, ignore:1
<string>, // description
<Nature>)
<Nature>:
<string> // content varies as follows
Nexxim/Circuit:
"Electrical" // the only choice
Simplorer:
// several choices
"Electrical", "Magnetic", "Fluidic", "Translational",
"Translational_V", "Rotational", "Rotational_V",
""Radiant", "Thermal", or <VHDLPackageName>
<VHDLPackageName>:
<string> // in the form <Library>.<Package>
<Library>:
<string> // name of the VHDL library
<Package>:
<string> // name of the VHDL package
<VariableInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<FlagLetters>:
<string> // "D" - has description parameter,
// "RD" - readonly & has description parameter,
// or "RHD" - readonly, hidden, & has description parameter
<CheckBoxInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<bool>) // value: true or false
<ButtonInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // button title
<string>, // extra text
<ClientID>,
"ButtonPropClientData:= ", <ClientDataArray>)
<ClientID>:
<int> // specifies Button Prop Client
// 0 - unknown, "ButtonPropClientData
// array will be empty
// 1 - Netlist Prop Client
// 2 - not used
// 3 - File Name Prop Client
<ClientDataArray>:
varies with <ClientID>
<ClienID> is 3:
Array("InternalFormatText:=", "<prefix><RelativePath>")
<prefix>:
<string> // "<Project>", "<PersonalLib>", "<UserLib>", or "<SysLib>"
<RelativePath>:
<string> // relative path to file from <prefix>
<TextInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a text string
<NumberInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<real>, // value: a number
<string>) // units
<SeparatorInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a text string
<ValueInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: a number, variable or expression
<MenuPropInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // menu choices - separated by commas
<int>) // 0 based index of current menu choice
<VPointInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>, // x value: number with length units
<string>) // y value: number with length units
<PointInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<real>, // x value
<real>) // y value
<QuantityPropInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
<string>, // value
<TypeString>,
<TypeStringDependentInfo>)
<TypeString>:
<string> // "Across", "Through", or "Free"
<TypeStringDependentInfo>:
"Free" :
<string>, // direction: "In", "Out", "InOut", or "DontCare"
// Following <string> is not present if direction is "DontCare"
<string> // when to calculate: "BeforeAnalogSolver",
// "BeforeStateGraph", "AfterStateGraph", or "DontCareWhen"
"Across" or "Through"
<int>, // terminal 1
<int> // terminal 2
<CosimDefInfo>:
Array("NAME:CosimDefinition",
"CosimulatorType:=", <int>,
"CosimDefName:=", <string> // "HFSS3D", "Circuit",
// "Custom", or "Netlist"
"IsDefinition:=", <bool>,
final array member(s) vary with CosimDefName)
"A", _
false, _
6, _
0, _
"", _
"Electrical"), _
"Terminal:=", Array("base", _
"base", _
"A", _
false, _
7, _
0, _
"", _
"Electrical"), _
"Terminal:=", Array("emitter", _
"emitter", _
"A", _
false, _
8, _
0, _
"", _
"Electrical"), _
Array("NAME:Parameters", _
"TextProp:=", Array("LabelID", _
"HD", _
"Property string for netlist ID", _
"Q@ID"), _
"TextProp:=", Array("MOD", _
"D", _
"Name of model data reference", _
"required"), _
"VariableProp:=", Array("AREA", _
"D", _
"Emitter area multiplying factor, which affects curents, resistances, and capacitances", _ "1"),
_
"VariableProp=", Array("AREAB", _
"D", _
"Base AREA", _
"1"), _
"VariableProp:=", Array( "AREAC", _
"D", _
Collector AREA", _
"1"), _
"VariableProp:=", Array("DTEMP", _
"D", _
"The difference between element and circuit temperature deg Cel)", _
"0"), _
"VariableProp:=", Array("M", _
"D", _
"Multiplier factor to simulate multiple BJTs in paralel", _ "1"), _
"ButtonProp:=", Array("NexximNetlist", _
"HD", _
"", _
"Q@ID %0 %1 %2 *MOD(@MOD) *AREA(AREA=@AREA)" & _
" *AREAB(AREAB=@AREAB) *AREAC(AREAC=@" & _
"AREAC) *DTEMP(DTEMP=@DTEMP) *M(M=@M)", _
"Q@ID %0 %1 %2 *MOD(@MOD) " & _ "*AREA(AREA=@AREA) AREAB(AREAB=@AREAB) *AREAC(AREAC=@" & _
"AREAC) *DTEMP(DTEMP=@DTEMP) *M(M=@M)", _
1, _
"ButtonPropClientData:=", Array()), _
"TextProp:=", Array( "ModelName", _
"HD", _
"", _
"Q"))))
VB Example:
Dim name2
name2 = oComponentManager.Edit "MyComponent", _
(Array("NAME:MyOtherComponent", _
"Info:=", Array("Type:=", 4294901767, _
"NumTerminals:=", 2, _
"DataSource:=", "", _
"ModifiedOn:=", 1071096503, _
"Manufacturer:=", "Ansys", _
"Symbol:=", "bendo", _
"Footprint:=", "BENDO", _
"Description:=", "",_
"InfoTopic:=", "", _
"InfoHelpFile:=", "", _
"IconFile:=", "", _
"LibraryName:=", "", _
"OriginalLocation:=", "Project", _
"Author:=", "", _
"OriginalAuthor:=", "", _
"MenuProp:=", Array("CoSimulator", _
"D", _
"", _
"Default,HFSS3D,Circuit,Custom,Netlist", _
0), _
"ButtonProp:=", Array("CosimDefinition", _
"D", _
"", _
"", _
"Edit", _
0, _
"ButtonPropClientData:=", Array())), _
Array("NAME:CosimDefinitions", _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 0, _
"CosimDefName:=", "HFSS3D", _
"IsDefinition:=", true, _
"CosimStackup:=", "Layout stackup", _
"CosimDmbedRatio:=", 3), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 1, _
"CosimDefName:=", "Circuit", _
"IsDefinition:=", true, _
"ExportAsNport:=", 0, _
"UsePjt:=", 0), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 2, _
"CosimDefName:=", "Custom", _
"IsDefinition:=", true, _
"DefinitionCompName:=", ""), _
Array("NAME:CosimDefinition", _
"CosimulatorType:=", 3, _
"CosimDefName:=", "Netlist", _
"IsDefinition:=", true, _
"NetlistString:=", "")))
Edit <ComponentName>,
["NAME:<NewComponentName>",
Python Syntax "Info:=", <ComponentInfo>,
"RefBase:=", <string>, // reference designator
"NumParts:=", <int>, // parts per component
"OriginalComponent:=", <string>
"Terminal:=", <TerminalInfo>,
"Terminal:=", <TerminalInfo>, ...
#The remaining parameters are optional
["NAME:Parameters", // any combo of the following
"VariableProp:=", <VariableInfo>,
"CheckboxProp:=", <CheckBoxInfo>,
"ButtonProp:=", <ButtonInfo>,
"TextProp:=", <TextInfo>,
"NumberProp:=", <NumberInfo>,
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>],
["NAME:Properties", # any combo of the following
"CheckboxProp:=", <CheckBoxInfo>,
"TextProp:=", <TextInfo>,
"NumberProp:=", <NumberInfo>,
"SeparatorProp:=", <SeparatorInfo>,
"ValueProp:=", <ValueInfo>,
"MenuProp:=", <MenuInfo>),
"VPointProp:=", <VPointInfo>,
"PointProp:=", <PointInfo>),
["Quantities",
"QuantityProp:=", <QuantityPropInfo>...],
["NAME:CosimDefinitions",
<CosimDefInfo>,
<CosimDefInfo>...])
name = oComponentManager.Edit ("Simplorer Circuit Elements\BJTs:Level01_NPN", _
["NAME:Level01_NPN", "Info:=", ["Type:=", 4294901764,_
"NumTerminals:=", 3, "DataSource:=", "Ansoft built-in component",_
"ModifiedOn:=", 1152722112, "Manufacturer:=", "", _
"Symbol:=", "nexx_bjt_npn", "Footprint:=", "", _
"Description:=", "BJT, GP, NPN", "InfoTopic:=", "NXBJT1.htm", _
"InfoHelpFile:=", "nexximcomponents.chm", "IconFile:=", "bjtsn.bmp", _
Python
Example "Library:=", "Nexxim Circuit Elements\BJTs",_
"OriginalLocation:=", "SysLibrary ", "Author:=", "", _
"OriginalAuthor:=", "", "CreationDate:=", 1152722102], _
"Refbase:=", "Q", "NumParts:=", 1, "Terminal:=", ["collector", _
"collector", "A", false, 6, 0, "", "Electrical"], _
"Terminal:=", ["base", "base", "A", false, _
7, 0, "", "Electrical"], "Terminal:=", ["emitter", _
["NAME:CosimDefinitions", ["NAME:CosimDefinition", _
["NAME:CosimDefinition", "CosimulatorType:=", 3, _
"NetlistString:=", ""]]])
EditSolverOnDemandModel
Use: This method looks for a local component of the name passed in, and in this component it looks for an SOD model using the name
passed in the second BSTR. It modifies the SOD model using the data in the VARIANT. It returns the name of the SOD model edited.
Return Value: Returns the name of the model edited.
Parameters: BSTR component name.
Parameters: BSTR SOD model name.
Parameters: VARIANT which is the new SOD model data (can include changed name).
EditWithComps [component manager]
Edit an existing component.
Command: None
Syntax: EditWithComps <ComponentName>,
Array("NAME:<NewComponentName>",
"ModTime:=", <ModifiedTimeInfo>,
"Library:=", <string>, // Library name
"LibLocation:=", <string>, // Project Location
<PinDefInfo>,
<PinDefInfo>,... // optional, to define pins
<GraphicsDataInfo>, // optional, to define graphics
<PropDisplayMapInfo>), // optional, to define property displays
Array(<ListOfComponentNames>) // Component names
Parameters: <ComponentName>:
<string> // composite name of the component being edited
<NewComponentName>:
<string> // new simple name for the component
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<PinDefInfo>:
Array("NAME:PinDef",
"Pin:=", Array (<string>, // pin name
<real>, // x location
<real>, // y location
<real>, // angle in radians
<PinType>,
<real>, // line width
<real>, // line length
<bool>, // mirrored
<int>, // color
<bool>, // true if visible, false if not
<string>, // hidden net name
<OptionalPinInfo>, // optional info
<PropDisplayMapInfo>)) // optional
<PinType>:
<string> // "N" : normal pin
// "I" : input pin
<OptionalPinInfo>:
// Specify both or neither
<bool>, // true if name is to be shown
<bool>, // true if number is to be shown
<PropDisplayMapInfo>:
Array("NAME:PropDisplayMap",
<PropDisplayInfo>,
<PropDisplayInfo>,...)
<PropDisplayInfo>:
<NameString>, Array(<DisplayTypeInfo>,
<DisplayLocationInfo>,
<int>, // optional, level number
<TextInfo>)
<NameString>:
<string> // PropertyName:=, where PropertyName is the name of
// the property to be displayed
<DisplayTypeInfo>:
<int> // 0 : No display
// 1 : Display name only
// 2 : Display value only
// 3 : Display both name and value
// 4: Display evaluated value only
// 5: Display both name and evaluated value
<DisplayLocationInfo>:
<int> // 0 : Left
// 1 : Top
// 2 : Right
// 3 : Bottom
// 4 : Center
// 5 : Custom placement
<GraphicsDataInfo>:
Array("NAME:Graphics",
// one or more of the following
<RectInfo>,
<CircleInfo>,
<ArcInfo>,
<LineInfo>,
<PolygonInfo>,
<TextInfo>,
<ImageInfo>)
<RectInfo>:
"Rect:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // angle, in radians
<real>, // x position of center
<real>, // y position of center
<real>, // width
< real>) // height
<CircleInfo>:
"Circle:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>) // radius
<ArcInfo>:
"Arc:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>, // radius
<real>, // start angle, in radians
<end>) // end angle, in radians
<LineInfo>:
"Line:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<PointInfo>, // must specify at least 2 points
<PointInfo>...)
<PointInfo>:
<real>, // x position
<real> // y position
<PolygonInfo>:
"Polygon:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<PointInfo>, // must specify at least 3 points
<PointInfo>...)
<TextInfo>:
"Text:=", Array(<real>, // x position
<real>, // y position
<real>, // angle, in radians
<Justification>,
<bool>, // is plotter font
<string>, // font name
<int>, // color
<string>) // text string
<Justification>:
<int> // 0 : left top
// 1 : left base
// 2 : left bottom
// 3 : center top
// 4 : center base
// 5 : center bottom
// 6 : right top
// 7 : right base
// 8 : right bottom
<ImageInfo>:
"Image:=", Array(<RectInfo>,
<ImageData>,
<bool>) // is mirrored
<ImageData>:
<string>, // file path
<int>, // 0 : use the file path and link to it
<ListOfComponentNames>:
<string>,<string> ...
// The list may be empty. When not empty, each string that is listed is a component
// that references the component to be edited. Prior to editing, a clone of the component is
// made, and the components that are listed are modified so that they now refer to
// the clone.
VB Example:
Dim nam
oModelManager.EditWithComps_
("Nexxim Circuit Elements\Distributed\Distributed:bendo", _
Array("NAME:bendo new name", _
"ModTime:=", 1152722165, _
"Library:=", "Nexxim Circuit Elements\Distributed\Distributed", _
"LibLocation:=", "SysLibrary", _
Array("NAME:PinDef", _
"Pin:=", Array( "n1", _
-0.00254, _
0.00254, _
0, _
"N", _
0, _
0, _
false, _
0, _
true, _
"", _
false, _
false)), _
Array("NAME:PinDef", _
"Pin:=", Array( "n2", _
0.00254, _
-0.00254, _
1.5708, _
"N", _
0, _
0, _
false, _
0, _
true, _
"", _
false, _
false)), _
Array("NAME:Graphics", _
"Polygon:=", Array( 0, 0, 12566272, 0, 0.00381, 0, .00127, 0.00127, _
0.00127, 0.00127, 0, 0.00381, 0, 0.00381, _
0.002032, 0.00127, 0.00381), _
"Line:=", Array(0, 1, 12566272, -0.00254, 0.00254, 0, .00254), _
"Line:=", Array(0, 1, 12566272, 0.00254, -0.00254, .00254, 0)), _
Array("NAME:PropDisplayMap", _
"W:=", Array(3, _
5, _
0, _
"Text:=", Array( 2.1684E-019, _
0.00504119, _
0, _
1, _
5, _
false, _
"Arial", _
0, _
"W=***"))))), _
Array("MY_COMP")
<ComponentName>:
<string> // composite name of the component to export
<LibraryLocation>:
VB Example:
oComponentManager.Export Array("NAME:mylib", "Nexxim Circuit Elements\BJTs:Level01_NPN"),"Per-
sonalLib"
Note:
GetData allows the user to access definition information, make modifications, and then use the Edit or EditWithComps
script commands to save the modified definition. Accordingly, for each type of definition, the array data returned to GetData
should be the same array information that is supplied to the Edit or EditWithComps commands.
Sub DisplayVariant(x)
Dim index
index = 0
index = index + 1
Next
End Sub
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim dnpInfo
Dim index
Dim componentNames
componentNames = oComponentManager.GetNames()
index = 0
For Each name In componentNames
name = componentNames(index)
message = "NPort data for component " + name
Msgbox message
dnpInfo = oComponentManager.GetNPortData(name)
DisplayVariant dnpInfo
index = index + 1
Next
GetSolverOnDemandData
Use: This method looks for a local component of the name passed in, and in this component it looks for an SOD model of the name
passed in and returns the SOD data pertaining to that model.
Parameters: BSTR component name.
Parameters: BSTR SOD model name
Return Value: VARIANT which is the SOD data.
GetSolverOnDemandModelList
Use: This method looks for a local component of the name passed in, and returns a list of SOD model names defined in the com-
ponent.
Parameters: BSTR component name.
Return Value: VARIANT which is a list of SOD model names.
IsUsed [component manager]
Used to determine if a component is used in the design.
Command: None
Syntax: IsUsed(<ComponentName>)
Return Value: <Boolean> // true if the specified component is used in the design
Parameters: <ComponentName>:
<string>
VB Example:
Dim isUsed
isUsed = oComponentManager.IsUsed("MyComponent")
<IsProjectComponent>:
<bool>
<LibraryName>:
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oComponentManager.Remove "Nexxim Circuit Elements\BJTs:Level01_NPN", _ true, "Project"
RemoveSolverOnDemandModel
Use: This method looks for a local component of the name passed in, and in this component it looks for an SOD model of the name
passed in and deletes the SOD model definition from the component.
Parameters: BSTR component name.
Parameters: BSTR SOD model name
Return Value: None.
RemoveUnused [component manager]
Removes components that are not used in the design.
Command: Project->Remove Unused Definitions is similar but operates slightly different and does not record script commands.
Syntax: RemoveUnused()
Return Value: <bool> True if one or more components are removed.
Parameters: None
VB Example:
Dim removedDefs
removedDefs = oComponentManager.RemoveUnused()
Note:
The order of calls to RemoveUnused is significant. As a result, removing definitions in an unordered fashion may cause
other components in dependent definitions to be rendered unusable.
Also, the symbol and footprint of an unused component are not unusable until after the component itself is removed using
the Component Manager Remove script.
Remove
RemoveUnused
Add [footprint manager]
Use: Add a footprint
Command: Tools > Edit Configured Libraries > Footprints > Add Footprint
Syntax: Add Array("NAME:<FootprintName>,
"ModTime:=", <ModifiedOnInfo>,
"Library:=", "",
"LibLocation:=", "Project",
"OkayToMirror:=", <bool>,
"DefUnits:=", <UnitType>,
Array(NAME:Lyrs",
"Layer:=", <LayerArray>,
"Layer:=", <LayerArray>…,
"SLayer:=", <StackupLayerArray>,
"SLayer:=", <StackupLayerArray>...),
"ActLyr:=", <string>, // name of active layer
"Tol:=", <ToleranceArray> // optional
<PrimitivesInfo>, // optional
<PinsInfo>, // optional
<ViasInfo>, // optional
<EdgeportsInfo>, // optional
<ComponentPropertyInfo>,
<ScriptInfo>) // optional, specified for scripted footprints
Parameters: <FootprintName>:
<string> // simple name of footprint to create
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<UnitType>:
<string> // default length units to use if units are not specified in other
// parameters
<LayerArray>:
Array("N:=", <string>, // layer name
"ID:=", <int> ,
"T:=", <LayerTypeInfo>, // layer type
"TB:=", <TopBottomInfo>,
"Col:=", <int>, // optional - color
"Pat:=", <int>, // optional - fill pattern
"Vis:=", <bool>, // optional - are objects on layer visible
"Sel:=", <bool>, // optional - are objects on layer selectable
"L:=", <bool>) // optional
// are objects on layer locked (can't be edited)
<LayerTypeInfo>:
<string> // one of: signal, dielectric, metalized signal, assembly, silkscreen, soldermask, solderpaste, glue, or user
<TopBottomInfo>:
<string> // one of: top, neither, bottom, or template
<StackupLayerArray>:
Array(<LayerArray>,
"Elev:=", <ElevationInfo>,
<ElevationInfo>:
<string> // "top" - snap to top
// "mid" - snap to middle
// "bot" - snap to bottom
// "edit" - manual edit
// "none"
<Dimension>:
<string> // real number, may include units
<MaterialInfo>:
<string> // name of the layer material
<ToleranceArray>:
Array(<real>, // distance tolerance
<real>, // angle tolerance (radians)
<PrimitivesInfo>:
Array("NAME:Prims",
// one or more of the following
<RectInfo>,
<CircleInfo>,
<ArcInfo>,
<LineInfo>,
<PolygonInfo>,
<TextInfo>,
<ImageInfo>)
<RectInfo>:
"Rect:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // angle, in radians
<real>, // x position of center
<real>, // y position of center
<real>, // width
<CircleInfo>:
"Circle:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>) // radius
<ArcInfo>:
"Arc:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>, // radius
<real>, // start angle, in radians
<end>) // end angle, in radians
<LineInfo>:
"Line:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<PointInfo>, // must specify at least 2 points
<PointInfo>...)
<PointInfo>:
<real>, // x position
<real> // y position
<PolygonInfo>:
"Polygon:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<PointInfo>, // must specify at least 3 points
<PointInfo>...)
<TextInfo>:
"Text:=", Array(<real>, // x position
<real>, // y position
<real>, // angle, in radians
<Justification>,
<bool>, // is plotter font
<string>, // font name
<int>, // color
<string>) // text string
<Justification>: <int>
// 0 : left top
// 1 : left base
// 2 : left bottom
// 3 : center top
// 4 : center base
// 5 : center bottom
// 6 : right top
// 7 : right base
// 8 : right bottom
<ImageInfo>:
"Image:=", Array(<RectInfo>,
<ImageData>,
<bool>) // is mirrored
<ImageData>:
<string>, // file path
<int>, // 0 : use the file path and link to it
// 1 : ignore file path and use next parameter
<string> // text data, only present if preceding int is 1
<PinsInfo>:
Array("NAME:Pins",
"P:=", <PinArray>,
"P:=", <PinArray>,...)
<PinArray>:
Array("Port:=", Array("Id:=", <int>,
"Clr:=", <real>, // optional - clearance
"N:=", <string>), // pin name
"Pos:=", Array("x:=", <Location>, // padstack (x,y) position
"y:=", <Location>),
"VRt:=", <Angle>, // optional - rotation
"HD:=", <Size>, // optional - hole diameter
<PadstackImplementationInfo>)
<Location>:
<string> specifying real number and units (may use variables)
<Angle>:
<string> specifying angle with a real number and units
<Size>:
<string> specifying size with a real number and units
<PadstackImplementationInfo>:
If another with the same implementation has already been specified:
"Ref:=", <int> // id of the other
If not:
"Ref:=", <string>, // name
"Frm:=", <int>, // id of highest layer
"To:=", <int>, // id of lowest layer
<LayerPlacementInfo>,
"Man:=", <int>, // optional, 1 if manually placed, 0 if not (default)
"Use:=", Array(<PadUseInfo>, <PadUseInfo>…) // array may be empty
<LayerPlacementInfo>:
"Lyr:=", Array("Mrg:=", <int>, // optional,
// 1 if all layers have been merged (default)
// 0 if layer are not merged
"Flp:=", <int>, // optional,
// 1 if placed bottom up
// 0 if not (default)
"Map:=", <ParentToLocalLayerInfo>)
<ParentToLocalLayerInfo>:
Array("U:=", <DirectionOfUniqueness>,
"F:=", Array(<int>, <int>, …), // forward mapping
// -1 is not mapped
"B:=", Array(<int>, <int>, …)) // backward mapping
// -1 is not mapped
<PadUseInfo>:
"Pad:=", Array("Lid:=", <int>, // layer id
"T:=", <string>, // type : "connected", "thermal",
// "no_pad, "not_connected",
// or "not_connected_thermal"
"Man:=", <int>) // optional, 1 if manually placed
// 0 if not (default)
<DirectionOfUniqueness>:
<string> // one of "forward", "backward", or "two ways"
<ViasInfo>:
Array("NAME:Vias", <ViaInfo>, <ViaInfo>…)
<ViaInfo>:
"V:=", Array("Id:=", <int>,
"N:=", <string>, // name
"Pos:=", Array("x:=", <Location>, // via (x,y) position
"y:=", <Location>),
"VRt:=", <Angle>, // optional - rotation
<ImplementationInfo>
<EdgeportsInfo>:
Array("NAME:EPorts", <EdgePortArray>, <EdgePortArray>…)
<EdgePortArray>:
Array("NAME:EP",
"LP:=", Array("Id:=", <int>, // port id
"N:=", <string>), // port name
"Eo:=", Array(<edge description>, <edge description>,...))
<start Y Location>:
doubles that are the X, Y location of the start point of the edge arc <end X location>
<end Y Location>:
doubles that are the X, Y location of the end point of the edge arc
<arc height>: double giving the height of the edge arc (0 for a straight edge)
<radians>: double giving the arc size in radians (0 for a straight edge)
<ComponentPropertyInfo>:
Array("NAME:CProps",
"VariableProp:=", <VariableInfo>,
"VariableProp:=", <VariableInfo>,
…)
<VariableInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: number, variable, or expression
<ScriptInfo>:
Array("NAME:script",
"language:=", <string>, // one of "javascript" or "vbscript"
"UsesScript:=", true,
"script:=", <string>) // contents of script
VB Example:
oFootprintManager.Add (Array("NAME:BCL", _
"ModTime:=", 1023388445, _
"Library:=", "", _
"LibLocation:=", "Project", _
"OkayToMirror:=", false, _
"DefUnits:=", "mm", _
Array("NAME:Lyrs", _
"Layer:=", Array("N:=", "Measures", _
"ID:=", 8, _
"T:=", "measures", _
"Col:=", 4144959, _
"Pat:=", 1), _
"Layer:=", Array("N:=", "Rats", _
"ID:=", 1, _
"T:=", "rat", _
"Col:=", 16711680, _
"Pat:=", 1), _
"Layer:=", Array("N:=", "Errors", _
"ID:=", 2, _
"T:=", "error", _
"Col:=", 255, _
"Pat:=", 1, _
"L:=", true), _
"Layer:=", Array("N:=", "Symbols", _
"ID:=", 3, _
"T:=", "symbol", _
"Col:=", 8323199, _
"Pat:=", 4), _
"Layer:=", Array("N:=", "Assembly", _
"ID:=", 4, _
"T:=", "assembly", _
"TB:=", "top", _
"Col:=", 16711680, _
Pat:=", 3), _
"Layer:=", Array("N:=", "Silkscreen", _
"ID:=", 5, _
"T:=", "silkscreen", _
TB:=", "top", _
"Col:=", 8454143, _
"Pat:=", 6), _
SLayer:=", Array("Layer:=", Array("N:=", "Cover", _
"ID:=", 12, _
"T:=", "metalizedsignal", _
"Col:=", 32639, _
Pat:=", 7), _
"Elev:=", "mid", _
"SubL:=", Array("Th:=", "0mm", _
"LElev:=", "118.110236220472mil", _
"R:=", "0mm", _
"Mat:=", "")), _
"ID:=", 7, _
"T:=", "dielectric", _
"Col:=", 127, _
"Pat:=", 7), _
"Elev:=", "none", _
"SubL:=", Array("Th:=", "1mm", _
"LElev:=", "0mil", _
"R:=", "0mil", _
"Mat:=", "")), _
"SLayer:=", Array("Layer:=", Array("N:=", "Ground", _
"ID:=", 9, _
"T:=", "metalizedsignal", _
"Col:=", 4144959, _
"Pat:=", 6), _
"Elev:=", "mid", _
"SubL:=", Array("Th:=", "0mil", _
"LElev:=", "0mil", _
"R:=", "0mil", _
"Mat:=", ""))), _
"ActLyr:=", "Trace2", _
Array("NAME:Prims",
"rect:=", Array("Id:=", 10003, _
"Lyr:=", 10, _
"N:=", "rect101", _
"x:=", "0mm", _
"y:=", "0mm", _
"w:=", "P", _
"h:=", "W", _
"Vds:=", Array()), _
"rect:=", Array("Id:=", 10103, _
"Lyr:=", 0, _
"N:=", "rect103", _
"x:=", "0mm", _
"y:=", "0mm", _
"w:=", "P", _
"h:=", "W", _
"Vds:=", Array())), _
Array("NAME:Pins",
"P:=", Array("Port:=", Array("Id:=", 3, "N:=", "n1"), _
"Pos:=", Array("x:=", "-P/2", "y:=", "0mm"), _
"VRt:=", "180deg", _
<ViasInfo>, // optional
<EdgeportsInfo>, // optional
<ComponentPropertyInfo>,
<ScriptInfo>, // optional, specified for scripted footprints
Array(<ListofComponentNames>) // Component names
Return Value: <string>
// composite name of the footprint.
// If the name requested conflicts with the name of an existing
// footprint, the requested name is altered to be unique.
// The name returned reflects any change made to be unique.
Parameters: <FootprintName>:
<string> // composite name of the footprint being edited
<NewFootprintName>:
<string> // new simple name for the footprint
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<UnitType>:
<string> // default length units to use if units are not specified in other
// parameters
<LayerArray>:
Array("N:=", <string>, // layer name
"ID:=", <int> ,
"T:=", <LayerTypeInfo>, // layer type
"TB:=", <TopBottomInfo>,
"Col:=", <int>, // optional - color
"Pat:=", <int>, // optional - fill pattern
"Vis:=", <bool>, // optional - are objects on layer visible
"Sel:=", <bool>, // optional - are objects on layer selectable
"L:=", <bool>) // optional
// are objects on layer locked (can't be edited)
<LayerTypeInfo>:
<string> // one of: signal, dielectric, metalized signal, assembly, silkscreen, soldermask, solderpaste, glue, or user
<TopBottomInfo>:
<StackupLayerArray>:
Array(<LayerArray>,
"Elev:=", <ElevationInfo>,
"SubL:=", Array("Th:=", <Dimension>,
"LElev:=", <Dimension>,
"R:=", <Dimension>,
"M:=", <MaterialInfo>))
<ElevationInfo>:
<string> // "top" - snap to top
// "mid" - snap to middle
// "bot" - snap to bottom
// "edit" - manual edit
// "none"
<Dimension>:
<string> // real number, may include units
<MaterialInfo>:
<ToleranceArray>:
Array(<real>, // distance tolerance
<real>, // angle tolerance (radians)
<real>) // dimensionless tolerance
<PrimitivesInfo>:
Array("NAME:Prims",
// one or more of the following
<RectInfo>,
<CircleInfo>,
<ArcInfo>,
<LineInfo>,
<PolygonInfo>,
<TextInfo>,
<ImageInfo>)
<RectInfo>:
"Rect:=", Array(<real>, // line width
<CircleInfo>:
"Circle:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>) // radius
<ArcInfo>:
"Arc:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<real>, // x position of center
<LineInfo>:
"Line:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<PointInfo>, // must specify at least 2 points
<PointInfo>...)
<PointInfo>:
<real>, // x position
<real> // y position
<PolygonInfo>:
"Polygon:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<PointInfo>, // must specify at least 3 points
<PointInfo>...)
<TextInfo>:
"Text:=", Array(<real>, // x position
<real>, // y position
<real>, // angle, in radians
<Justification>,
<bool>, // is plotter font
<string>, // font name
<int>, // color
<string>) // text string
<Justification>: <int>
// 0 : left top
// 1 : left base
// 2 : left bottom
// 3 : center top
// 4 : center base
// 5 : center bottom
// 6 : right top
// 7 : right base
// 8 : right bottom
<ImageInfo>:
"Image:=", Array(<RectInfo>,
<ImageData>,
<bool>) // is mirrored
<ImageData>:
<string>, // file path
<int>, // 0 : use the file path and link to it
// 1 : ignore file path and use next parameter
<string> // text data, only present if preceding int is 1
<PinsInfo>:
Array("NAME:Pins",
"P:=", <PinArray>,
"P:=", <PinArray>,...)
<PinArray>:
Array("Port:=", Array("Id:=", <int>,
"Clr:=", <real>, // optional - clearance
<Location>:
<string> specifying real number and units (may use variables)
<Angle>:
<string> specifying angle with a real number and units
<Size>:
<string> specifying size with a real number and units
<PadstackImplementationInfo>:
If another with the same implementation has already been specified:
"Ref:=", <int> // id of the other
If not:
"Ref:=", <string>, // name
<LayerPlacementInfo>:
"Lyr:=", Array("Mrg:=", <int>, // optional,
// 1 if all layers have been merged (default)
// 0 if layer are not merged
"Flp:=", <int>, // optional,
// 1 if placed bottom up
// 0 if not (default)
"Map:=", <ParentToLocalLayerInfo>)
<ParentToLocalLayerInfo>:
Array("U:=", <DirectionOfUniqueness>,
"F:=", Array(<int>, <int>, …), // forward mapping
// -1 is not mapped
"B:=", Array(<int>, <int>, …)) // backward mapping
// -1 is not mapped
<PadUseInfo>:
"Pad:=", Array("Lid:=", <int>, // layer id
"T:=", <string>, // type : "connected", "thermal",
// "no_pad, "not_connected",
// or "not_connected_thermal"
"Man:=", <int>) // optional, 1 if manually placed
// 0 if not (default)
<DirectionOfUniqueness>:
<string> // one of "forward", "backward", or "two ways"
<ViasInfo>:
Array("NAME:Vias", <ViaInfo>, <ViaInfo>…)
<ViaInfo>:
"V:=", Array("Id:=", <int>,
"N:=", <string>, // name
"Pos:=", Array("x:=", <Location>, // via (x,y) position
"y:=", <Location>),
<EdgeportsInfo>:
Array("NAME:EPorts", <EdgePortArray>, <EdgePortArray>…)
<EdgePortArray>
Array("NAME:EP",
"LP:=", Array("Id:=", <int>, // port id
"N:=", <string>), // port name
"Eo:=", Array(<edge description>, <edge description>,...))
<arc height>: double giving the height of the edge arc (0 for a straight edge)
<radians>: double giving the arc size in radians (0 for a straight edge)
<ComponentPropertyInfo>:
Array("NAME:CProps",
"VariableProp:=", <VariableInfo>,
"VariableProp:=", <VariableInfo>,
…)
<VariableInfo>:
Array(<string>, // name
<FlagLetters>,
<string>, // description
"CB:=", <string>, // optional - script for call back
<string>) // value: number, variable, or expression
<ScriptInfo>:
Array("NAME:script",
"language:=", <string>, // one of "javascript" or "vbscript"
"UsesScript:=", true,
"script:=", <string>) // contents of script
<ListOfComponentNames>:
<string>,<string> ...
// The list may be empty. When not empty, each string that is listed is a component
// that references the footprint to be edited. Prior to editing, a clone of the footprint is
// made, and the components that are listed are modified so that they now refer to
// the clone.
VB Example:
Dim nam
oFootprintManager.EditWithComps _
("Nexxim Circuit Elements\Distributed\Distributed:bendo", _
Array("NAME:bendo new name", _
"ModTime:=", 1152722165, _
"Library:=", "Nexxim Circuit Elements\Distributed\Distributed", _
"LibLocation:=", "SysLibrary", _
Array("NAME:PinDef", _
"Pin:=", Array( "n1", _
-0.00254, _
0.00254, _
0, _
"N", _
0, _
0, _
false, _
0, _
true, _
"", _
false, _
false)), _
Array("NAME:PinDef", _
"Pin:=", Array( "n2", _
0.00254, _
-0.00254, _
1.5708, _
"N", _
0, _
0, _
false, _
0, _
true, _
"", _
false, _
false)), _
Array("NAME:Graphics", _
"Polygon:=", Array( 0, 0, 12566272, 0, 0.00381, 0, .00127, 0.00127, _
0.00127, 0.00127, 0, 0.00381, 0, 0.00381, _
0.002032, 0.00127, 0.00381), _
<FootprintName>...),
<LibraryLocation>
Return Value: None
Parameters: <LibraryName>:
<string> // name of the library
<FootprintName>:
<string> // composite name of footprint to export
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oFootprintManager.Export Array("NAME:mylib", "Distributed Footprints:BPAD"), "PersonalLib"
GetData [footprint manager]
FootprintGetData
Use: Gets data that describes the definition.
Command: None
Syntax: GetData(<DefinitionName>)
Note:
GetData allows the user to access definition information, make modifications, and then use the Edit or EditWithComps
script commands to save the modified definition. Accordingly, for each type of definition, the array data returned to
GetData should be the same array information that is supplied to the Edit or EditWithComps commands.
<IsProjectFootprint>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oFootprintManager.Remove "BPAD", true, "Distributed Footprints", "Project"
oFootprintManager.Remove "BPAD", false, "MyLib", "PersonalLib"
RemoveUnused [footprint manager]
Use: Removes footprints that are not used in the design.
Command: Project->Remove Unused Definitions is similar but operates slightly different and does not record script commands.
Syntax: RemoveUnused()
Return Value: <bool> True if one or more footprints are removed.
Parameters: None
VB Example:
Dim removedDefs
removedDefs = oFootprintManager.RemoveUnused()
Note:
The order of calls to RemoveUnused is significant. As a result, removing definitions in an unordered fashion may cause
other footprints in dependent definitions to be rendered unusable.
Also, the symbol and footprint of an unused component are not unusable until after the component itself is removed using
the Component ManagerRemove script.
materialNames = oMaterialMgr.GetNames()
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.NewProject
oProject.InsertDesign "Nexxim Circuit", "Nexxim1", "", ""
Set oMaterialMgr = oProject.GetDefinitionManager().GetManager("Material")
oMaterialMgr.Add( Array("NAME:MyMaterial1", "CoordinateSystemType:=", "Cartesian", "per-
mittivity:=", "0.123") )
oMaterialMgr.Add( Array("NAME:MyMaterial2", "CoordinateSystemType:=", "Cartesian", "per-
mittivity:=", "0.456")
Dim materialNames
materialNames = oMaterialMgr.GetNames()
UI Access NA
Parameters: <modelName>:
<string> // simple name of the model being added
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<PinDefInfo>:
Array("NAME:PinDef",
"Pin:=", Array (<string>, // pin name
<real>, // x location
<real>, // y location
<real>, // angle in radians
<PinType>,
<real>, // line width
<real>, // line length
<bool>, // mirrored
<int>, // color
<bool>, // true if visible, false if not
<string>, // hidden net name
<OptionalPinInfo>, // optional info
<PropDisplayMapInfo>)) // optional
<PinType>:
<string> // "N" : normal pin
// "I" : input pin
<OptionalPinInfo>:
// Specify both or neither
<bool>, // true if name is to be shown
<bool>, // true if number is to be shown
<PropDisplayMapInfo>:
Array("NAME:PropDisplayMap",
<PropDisplayInfo>,
<PropDisplayInfo>,...)
<PropDisplayInfo>:
<NameString>, Array(<DisplayTypeInfo>,
<DisplayLocationInfo>,
<int>, // optional, level number
<TextInfo>)
<NameString>:
<string> // PropertyName:=, where PropertyName is the name of
<DisplayTypeInfo>:
<int> // 0 : No display
// 1 : Display name only
// 2 : Display value only
// 3 : Display both name and value
// 4: Display evaluated value only
// 5: Display both name and evaluated value
<DisplayLocationInfo>:
<int> // 0 : Left
// 1 : Top
// 2 : Right
// 3 : Bottom
// 4 : Center
// 5 : Custom placement
<GraphicsDataInfo>:
Array("NAME:Graphics",
// one or more of the following
<RectInfo>,
<CircleInfo>,
<ArcInfo>,
<LineInfo>,
<PolygonInfo>,
<TextInfo>,
<ImageInfo>)
<RectInfo>:
"Rect:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // angle, in radians
<real>, // x position of center
<real>, // y position of center
<real>, // width
< real>) // height
<CircleInfo>:
"Circle:=", Array(<real>, // line width
<ArcInfo>:
"Arc:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>, // radius
<real>, // start angle, in radians
<end>) // end angle, in radians
<LineInfo>:
"Line:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<PointInfo>, // must specify at least 2 points
<PointInfo>...)
<PointInfo>:
<real>, // x position
<real> // y position
<PolygonInfo>:
"Polygon:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<PointInfo>, // must specify at least 3 points
<PointInfo>...)
<TextInfo>:
"Text:=", Array(<real>, // x position
<real>, // y position
<real>, // angle, in radians
<Justification>,
<bool>, // is plotter font
<string>, // font name
<int>, // color
<Justification>:
<int> // 0 : left top
// 1 : left base
// 2 : left bottom
// 3 : center top
// 4 : center base
// 5 : center bottom
// 6 : right top
// 7 : right base
// 8 : right bottom
<ImageInfo>:
"Image:=", Array(<RectInfo>,
<ImageData>,
<bool>) // is mirrored
<ImageData>:
<string>, // file path
<int>, // 0 : use the file path and link to it
VB Example:
oModelManager.Add Array("NAME:MyModel",_
"ModTime:=", 1070989137, _
"Library:=", "", _
"LibLocation:=", "Project", _
Array("NAME:PinDef", _
"Pin:=", Array ("newpin0", _
0.00254, _
0, _
0, _
"N",_
0, _
0.00254, _
false, _
0, _
true, _
"",_
false, _
false)), _
Array("NAME:PinDef", _
"Pin:=", Array ("newpin1", _
-0.00254, _
0, _
3.14159265358979, _
"N",_
0, _
0.00254, _
false, _
0, _
true, _
"",_
false, _
false)),
Array("NAME:Graphics", _
"Rect:=", Array(0, _
0, _
12566272, _
0, _
4.33680868994202e-019, _
-0.000635, _
0.00508, _
0.002794), _
"Circle:=", Array(0, _
0, _
12566272, _
0.000127, _
-0.000635, _
0.000635)))
ConvertToDynamic
Use: Build a new dynamic model based on an existing parametric model.
Command: Right-click on a model under Definitions/Models in the Project Tree and choose ConvertToDynamic.
Syntax: ConvertToDynamic(defName, newname)
Return Value: <newname> // Name of the new model added
Parameters: <defName> // Model that is the base for the new conversion
VB Example:
Dim newname
newname = oModelManager.ConvertToDynamic([in] BSTR defName, [out, retval] BSTR* newName);
ConvertToParametric
Use: Build a new parametric model based on an existing dynamic model.
Command: Right-click on a model under Definitions/Models in the Project Tree and choose ConvertToParametric.
Syntax: ConvertToParametric(defName, newname)
Return Value: <newname> // Name of the new model added
Parameters: <defName> // Model that is the base for the new conversion
VB Example: Dim newname
newname = oModelManager.ConvertToParametric([in] BSTR defName, [out, retval] BSTR* newName);
Edit [deprecated]
Deprecated command — please use EditWithComps.
EditWithComps [model manager]
Use: Edit an existing model.
Command: None
Syntax: EditWithComps <ModelName>,
Array("NAME:<NewModelName>",
"ModTime:=", <ModifiedTimeInfo>,
"Library:=", <string>, // Library name
"LibLocation:=", <string>, // Project Location
<PinDefInfo>,
<PinDefInfo>,... // optional, to define pins
<GraphicsDataInfo>, // optional, to define graphics
<PropDisplayMapInfo>), // optional, to define property displays
Array(<ListOfComponentNames>) // Component names
Parameters: <ModelName>:
<string> // composite name of the model being edited
<NewModelName>:
<string> // new simple name for the model
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<PinDefInfo>:
Array("NAME:PinDef",
"Pin:=", Array (<string>, // pin name
<real>, // x location
<real>, // y location
<real>, // angle in radians
<PinType>,
<real>, // line width
<real>, // line length
<bool>, // mirrored
<int>, // color
<bool>, // true if visible, false if not
<string>, // hidden net name
<OptionalPinInfo>, // optional info
<PropDisplayMapInfo>)) // optional
<PinType>:
<string> // "N" : normal pin
// "I" : input pin
// "O" : output pin
<OptionalPinInfo>:
// Specify both or neither
<bool>, // true if name is to be shown
<PropDisplayMapInfo>:
Array("NAME:PropDisplayMap",
<PropDisplayInfo>,
<PropDisplayInfo>,...)
<PropDisplayInfo>:
<NameString>, Array(<DisplayTypeInfo>,
<DisplayLocationInfo>,
<int>, // optional, level number
<TextInfo>)
<NameString>:
<string> // PropertyName:=, where PropertyName is the name of
// the property to be displayed
<DisplayTypeInfo>:
<int> // 0 : No display
// 1 : Display name only
<DisplayLocationInfo>:
<int> // 0 : Left
// 1 : Top
// 2 : Right
// 3 : Bottom
// 4 : Center
// 5 : Custom placement
<GraphicsDataInfo>:
Array("NAME:Graphics",
// one or more of the following
<RectInfo>,
<CircleInfo>,
<ArcInfo>,
<LineInfo>,
<PolygonInfo>,
<TextInfo>,
<ImageInfo>)
<RectInfo>:
"Rect:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // angle, in radians
<real>, // x position of center
<real>, // y position of center
<real>, // width
< real>) // height
<CircleInfo>:
"Circle:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>) // radius
<ArcInfo>:
"Arc:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>, // radius
<real>, // start angle, in radians
<end>) // end angle, in radians
<LineInfo>:
"Line:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<PointInfo>, // must specify at least 2 points
<PointInfo>...)
<PointInfo>:
<real>, // x position
<real> // y position
<PolygonInfo>:
"Polygon:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<PointInfo>, // must specify at least 3 points
<PointInfo>...)
<TextInfo>:
"Text:=", Array(<real>, // x position
<real>, // y position
<real>, // angle, in radians
<Justification>,
<bool>, // is plotter font
<string>, // font name
<int>, // color
<string>) // text string
<Justification>:
<int> // 0 : left top
// 1 : left base
// 2 : left bottom
// 3 : center top
// 4 : center base
// 5 : center bottom
// 6 : right top
// 7 : right base
// 8 : right bottom
<ImageInfo>:
"Image:=", Array(<RectInfo>,
<ImageData>,
<bool>) // is mirrored
<ImageData>:
<string>, // file path
<int>, // 0 : use the file path and link to it
// 1 : ignore file path and use next parameter
<string> // text data, only present if preceding int is 1
<ListOfComponentNames>:
<string>,<string> ...
// The list may be empty. When not empty, each string that is listed is a component
// that references the model to be edited. Prior to editing, a clone of the model is
// made, and the components that are listed are modified so that they now refer to
// the clone.
VB Example:
Dim nam
oModelManager.EditWithComps_
("Nexxim Circuit Elements\Distributed\Distributed:bendo", _
Array("NAME:bendo new name", _
"ModTime:=", 1152722165, _
"Library:=", "Nexxim Circuit Elements\Distributed\Distributed", _
"LibLocation:=", "SysLibrary", _
Array("NAME:PinDef", _
"Pin:=", Array( "n1", _
-0.00254, _
0.00254, _
0, _
"N", _
0, _
0, _
false, _
0, _
true, _
"", _
false, _
false)), _
Array("NAME:PinDef", _
"Pin:=", Array( "n2", _
0.00254, _
-0.00254, _
1.5708, _
"N", _
0, _
0, _
false, _
0, _
true, _
"", _
false, _
false)), _
Array("NAME:Graphics", _
"Polygon:=", Array( 0, 0, 12566272, 0, 0.00381, 0, .00127, 0.00127, _
0.00127, 0.00127, 0, 0.00381, 0, 0.00381, _
0.002032, 0.00127, 0.00381), _
"Line:=", Array(0, 1, 12566272, -0.00254, 0.00254, 0, .00254), _
"Line:=", Array(0, 1, 12566272, 0.00254, -0.00254, .00254, 0)), _
Array("NAME:PropDisplayMap", _
"W:=", Array(3, _
5, _
0, _
"Text:=", Array( 2.1684E-019, _
0.00504119, _
0, _
1, _
5, _
false, _
"Arial", _
0, _
"W=***"))))), _
rray("MY_COMP")
<ModelName>:
<string> // composite name of model to export
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oModelManager.Export _
Array("NAME Nexxim Circuit Elements\Distributed\Distributed:bendo:mylib", _ "myModel"), "Per-
sonalLib"
Note:
GetData allows the user to access definition information, make modifications, and then use the Edit or EditWithComps
script commands to save the modified definition. Accordingly, for each type of definition, the array data returned to GetData
should be the same array information that is supplied to the Edit or EditWithComps commands.
Parameters: <ModelName>:
<string>
VB Example:
Dim isUsed
isUsed = oModelManager.IsUsed("MyModel")
<IsProjectModel>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oModelManager.Remove "Nexxim Circuit Elements\Distributed\Distributed:bendo", true, "Project"
VB Example:
Dim removedDefs
removedDefs = oModelManager.RemoveUnused()
Note:
The order of calls to RemoveUnused is significant. As a result, removing definitions in an unordered fashion may cause
other models in dependent definitions to be rendered unusable.
Also, the model and footprint of an unused component are not unusable until after the component itself is removed using
the Component Manager Remove script.
ExportFullWaveSpice
ExportNetworkData
ExportNMFData
ExportFullWaveSpice
Use: Export FullWaveSpice data in a format of your choice.
Command: File > Export MacroModel > Broadband (SYZ, FWS….)
Syntax: ExportFullWaveSpice
"DesignName", // Design name. Can be left blank, if loading solution from a file.
true/false, // true - solution loaded from file, false- loaded from design
"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
"variation", // Pick a particular variation. Leave blank if no variation.
Array("NAME:Frequencies"), // Optional; if none defined all frequencies are used
Array("NAME:SpiceData", // Spice export options object
"SpiceType:=", "SSS", // SpiceType can be "PSpice", "HSpice", "Spectre", "SSS",
// "Simplorer", "TouchStone1.0", "TouchStone2.0"
"EnforcePassivity:=", false, // Enforce Passivity true/false
"EnforceCausality:=", false, // Enforce Causality true/false
"UseCommonGround:=", false, // Use common ground true/false
"FittingError:=", 0.5, // Fitting error
"MaxPoles:=", 400, // Maximum Order
UI Access N/A
<Precision> Integer Optional. Touchstone number of digits precision. Default if not spe-
cified is 15.
<UseExportFreqs> Boolean Specifies whether to use export frequencies.
<IncludeGammaComments> Boolean Specifies whether to include Gamma and Impedance comments.
<SupportNonStdExport> Boolean Specifies whether to support non-standard Touchstone extensions
for mixed reference impedance.
oModule.ExportNetworkData "width=’2in’", _
Array("Setup1:Sweep1", "Setup1:Sweep2"), 3, _
"c:\mydir\out.s2p", Array(1.0e9, 1.5e9, 2.0e9), _
true, 50.0
ExportNMFData
Type: <Double>
Reference impedance
<FrequencyArray>
Type: <Array of doubles>
Value: Array(<double>,<double>….)
Frequency points in the sweep that is exported.
<DesignVariation>
Type: <String>
Design variation at which the solution is exported.
<Format>
Type: <String>
Values: "MagPhase", "RealImag", "DbPhase".
The format in which the sparameters will be exported.
<Length>
Type:<String>
Length for exporting sparameters.
<PassNumber>
Type:<integer>
Pass number.
VB Example:
ExportNMFData(
"",
# Empty string.
1,
#The number 1.
"Name",
# This is the full path of the file from which the solution is loaded
"ExportFile",
# full path of file to export to
Python Syntax
["NAME:Frequencies"],
#optional, if none defined all frequencies are used
["NAME:NMFOptions",
#Export NMF options object
"DataTypes:=", ["S"],
#DataTypes can be "S", "Y","Z", "G", and "Z0", for S , Y, Z matrix, Gamma and Z0 (zero)
"DisplayFormat:=", "MA",
#DisplayFormat "MA", "RI", "DB"
"FileType:=", "",
"MatrixSize:=", 2,
#Matrix size, optional (used in nmf file header)
"CreateNPortModel:=", true
#Create a model based on the exported file true/false
])
oTool = oDesktop.GetTool("NdExplorer")
oTool.ExportNetworkData("", True,
"C:/.../100OHM.S2P", "$SYSLIB/Test.s2p", "",
[
"NAME:Frequencies",
500000000,
1000000000,
10000000000,
Python Example
25000000000,
50000000000,
75000000000,
100000000000
],
[
"NAME:TSOptions",
"DataTypes:=" , ["S"],
"DisplayFormat:=" , "DB",
"FileType:=" , 3,
"Renormalize:=" , True,
"RefImpedance:=" , 50,
"Precision:=" , 6,
"UseMultipleCores:=" , False,
"NumberOfCores:=" , 1,
"Comments:=" , True,
"Noise:=" , False
])
Export
GetData
GetNames
IsUsed
Remove
RemoveUnused
Add [padstack manager]
Use: Add a padstack
Command: Tools > Edit Configured Libraries > Padstacks > Add Padstack
Syntax: Add Array("NAME:<PadstackName>",
"ModTime:=", <ModifiedOnInfo>,
"Library:=", "", // name of the library
"LibLocation:=", "Project", // location of the named library
Array("NAME:psd",
"nam:= ", <PadstackName>,
"lib:=", "", // name of the library
"mat:=", "", // hole plating material
"plt:=", "0", // percent of hole's radius filled by plating
Array("NAME:pds",
<LayerGeometryArray>,
<LayerGeometryArray....),
"hle:=", <PadInfo>
"hRg:=", <HoleRange>,
"sbsh:=", <SolderballShape>,
"sbpl:=", <SolderballPlacement>,
"sbr:=", <string>, // solderball diameter, real with units
"sb2:=", <string>, // solderball mid diameter, real with units
"sbn:=", <string>), // name of solderball material
"ppl:=", <PadPortLayerArray>)
Return Value: simple name of the added padstack
// If the name requested conflicts with the name of an existing
// padstack, the requested name is altered to be unique.
// The name returned reflects any change made to be unique.
Parameters: <PadstackName>:
<string> // simple name of padstack to create
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<LayerGeometryArray>:
Array("Name:lgm",
"lay:=", <string>, // definition layer name
"id:=", <int>, // definition layer id
"pad:=", <PadInfo>, // pad
"ant:=", <PadInfo>, // antipad
"thm:=", <PadInfo>, // themal pad
"X:=", <string>, // pad x connection, real with units
"Y:=", <string>, // pad y connection, real with units
"dir:=", <DirectionString>) // pad connection direction
<PadInfo>:
Array("shp:=", <PadShape>,
"Szs:=", <DimensionArray>,
"X:=", <string>, // x offset, real with units
"Y:=", <string>, // y offset, real with units
"R:=", <string>) // rotation, real with units
<PadShape>:
<string> one of these choices
"No" // no pad
"Cir" // Circle
"Sq" // Square
"Rct" // Rectangle
"Ov" // Oval
"Blt" // Bullet
"Ply" // Polygons
"R45" // Round 45 thermal
"R90" // Round 90 thermal
"S45" // Square 45 thermal
"S90" // Square 90 thermal
<DimensionArray>:
Array(<string>, ...) // each string is a real with units for one of the dimensions of the shape
<DirectionString>:
<string> one of these choices
"No" // no direction
"Any" // any direction
"0" // 0 degrees
"45" // 45 degrees
"90" // 90 degrees
"135" // 135 degrees
"180" // 180 degrees
"225" // 225 degrees
"270" // 270 degrees
"315" // 315 degrees
<HoleRange>:
<string> one of these choices
"Thr" // through all layout layers
"Beg" // from upper pad layer to lowest layout layer
"End" // from upper layout layer to lowest pad layer
"UTL" // from upper pad layer to lowest pad layer
<SolderballShape>:
<string> one of these choices
"None" // no solderball
"Cyl" // cylinder solderball
"Sph" // spheroid solderball
<SolderballPlacement>:
<string> one of these choices
"abv" // above padstack
<PadPortLayerArray>:
Array( <int>, <int>,....) where each int is a layer id
VB Example:
"3mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array("shp:=", "No", "Szs:=", Array
(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"Ground", "id:=", 3, "pad:=", Array("shp:=", "No", "Szs:=", Array(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "No", "Szs:=", Array(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "R90", "Szs:=", Array( _
"3mm", "0.75mm", "1mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", _
"0mm", "dir:=", "Any"), Array("NAME:lgm", "lay:=", "Bottom signal", "id:=", 5, "pad:=", Array
("shp:=", _
"Cir", "Szs:=", Array("1mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array
("shp:=", _
"Cir", "Szs:=", Array("2mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array
("shp:=", _
"No", "Szs:=", Array(), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", _
"0mm", "dir:=", "Any")), "hle:=", Array("shp:=", "Cir", "Szs:=", Array("1.5mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "hRg:=", "End", "sbsh:=", "Sph", "sbpl:=", _
"abv", "sbr:=", "750um", "sb2:=", "1200um", "1200um", "sbn:=", "solder"), "ppl:=", Array( _
0, 1, 2, 3, 5))
Edit [padstack manager]
Use: Edit an existing padstack.
Command: Tools > Edit Configured Libraries > Padstacks > Edit Padstack
Syntax: Edit <PadstackName>,
Array("NAME:<NewPadstackName>",
"ModTime:=", <ModifiedOnInfo>,
"Library:=", "", // name of the library
"LibLocation:=", "Project", // location of the named library
Array("NAME:psd",
"nam:= ", <PadstackName>,
"lib:=", "", // name of the library
"mat:=", "", // hole plating material
"plt:=", "0", // percent of hole's radius filled by plating
Array("NAME:pds",
<LayerGeometryArray>,
<LayerGeometryArray....),
"hle:=", <PadInfo>
"hRg:=", <HoleRange>,
"sbsh:=", <SolderballShape>,
"sbpl:=", <SolderballPlacement>,
"sbr:=", <string>, // solderball diameter, real with units
"sb2:=", <string>, // solderball mid diameter, real with units
"sbn:=", <string>), // name of solderball material
"ppl:=", <PadPortLayerArray>)
Parameters: <PadstackName>:
<string> // composite name of padstack to edit
<NewPadstackName>:
<string> // new simple name for padstack
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<LayerGeometryArray>:
Array("Name:lgm",
"lay:=", <string>, // definition layer name
"id:=", <int>, // definition layer id
"pad:=", <PadInfo>, // pad
"ant:=", <PadInfo>, // antipad
<PadInfo>:
Array("shp:=", <PadShape>,
"Szs:=", <DimensionArray>,
"X:=", <string>, // x offset, real with units
"Y:=", <string>, // y offset, real with units
"R:=", <string>) // rotation, real with units
<PadShape>:
<string> one of these choices
"No" // no pad
"Cir" // Circle
"Sq" // Square
"Rct" // Rectangle
"Ov" // Oval
"Blt" // Bullet
"Ply" // Polygons
"R45" // Round 45 thermal
"R90" // Round 90 thermal
"S45" // Square 45 thermal
"S90" // Square 90 thermal
<DimensionArray>:
Array(<string>, ...) // each string is a real with units for one of the
// dimensions of the shape
<DirectionString>:
<string> one of these choices
"No" // no direction
"Any" // any direction
"0" // 0 degrees
"45" // 45 degrees
"90" // 90 degrees
"135" // 135 degrees
"180" // 180 degrees
"225" // 225 degrees
"270" // 270 degrees
<HoleRange>:
<string> one of these choices
"Thr" // through all layout layers
"Beg" // from upper pad layer to lowest layout layer
"End" // from upper layout layer to lowest pad layer
"UTL" // from upper pad layer to lowest pad layer
<SolderballShape>:
<string> one of these choices
"None" // no solderball
"Cyl" // cylinder solderball
"Sph" // spheroid solderball
<SolderballPlacement>:
<string> one of these choices
"abv" // above padstack
"blw" // below padstack
<PadPortLayerArray>:
Array( <int>, <int>,....) where each int is a layer id
VB Example:
oPadstackManager.Edit "Circle - through1", Array("NAME:Circle - through1", "ModTime:=", _
1235765635, "Library:=", "", "LibLocation:=", "Project", Array("NAME:psd", "nam:=", _
"Circle - through1", "lib:=", "", "mat:=", "", "plt:=", "0", Array("NAME:pds", Array("NAME:lgm",
"lay:=", _
"Top Signal", "id:=", 0, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2.5mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3.5mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "No", "Szs:=", Array
(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"SignalA", "id:=", 1, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "No", "Szs:=", Array(),
"X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"SignalB", "id:=", 2, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array("shp:=", "No", "Szs:=", Array
(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
Parameters: <PadstackName>:
<string> // composite name of the padstack being edited
<NewPadstackName>:
<string> // new simple name for the padstack
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<LayerGeometryArray>:
Array("Name:lgm",
"lay:=", <string>, // definition layer name
"id:=", <int>, // definition layer id
"pad:=", <PadInfo>, // pad
<PadInfo>:
Array("shp:=", <PadShape>,
"Szs:=", <DimensionArray>,
"X:=", <string>, // x offset, real with units
"Y:=", <string>, // y offset, real with units
"R:=", <string>) // rotation, real with units
<PadShape>:
<string> one of these choices
"No" // no pad
"Cir" // Circle
"Sq" // Square
"Rct" // Rectangle
"Ov" // Oval
"Blt" // Bullet
"Ply" // Polygons
"R45" // Round 45 thermal
"R90" // Round 90 thermal
"S45" // Square 45 thermal
"S90" // Square 90 thermal
<DimensionArray>:
Array(<string>, ...) // each string is a real with units for one of the
// dimensions of the shape
<DirectionString>:
<string> one of these choices
"No" // no direction
"Any" // any direction
"0" // 0 degrees
"45" // 45 degrees
"90" // 90 degrees
"135" // 135 degrees
"180" // 180 degrees
"225" // 225 degrees
<HoleRange>:
<string> one of these choices
"Thr" // through all layout layers
"Beg" // from upper pad layer to lowest layout layer
"End" // from upper layout layer to lowest pad layer
"UTL" // from upper pad layer to lowest pad layer
<SolderballShape>:
<string> one of these choices
"None" // no solderball
"Cyl" // cylinder solderball
"Sph" // spheroid solderball
<SolderballPlacement>:
<string> one of these choices
"abv" // above padstack
"blw" // below padstack
<PadPortLayerArray>:
Array( <int>, <int>,....) where each int is a layer id
<ListOfComponentNames>:
<string>,<string> ...
// The list may be empty. When not empty, each string that is listed is a component
// that references the padstack to be edited. Prior to editing, a clone of the padstack is
// made, and the components that are listed are modified so that they now refer to
// the clone.
VB Example:
oPadstackManager.EditWithComps "Circle - through1", Array("NAME:Circle - through1", "ModTime:=",
_
1235765635, "Library:=", "", "LibLocation:=", "Project", Array("NAME:psd", "nam:=", _
"Circle - through1", "lib:=", "", "mat:=", "", "plt:=", "0", Array("NAME:pds", Array("NAME:lgm",
"lay:=", _
"Top Signal", "id:=", 0, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2.5mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3.5mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "No", "Szs:=", Array
(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"SignalA", "id:=", 1, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "No", "Szs:=", Array(),
"X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"SignalB", "id:=", 2, "pad:=", Array("shp:=", "Cir", "Szs:=", Array("2mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "Cir", "Szs:=", Array( _
"3mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array("shp:=", "No", "Szs:=", Array
(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", "0mm", "dir:=", "Any"), Array("NAME:lgm",
"lay:=", _
"Ground", "id:=", 3, "pad:=", Array("shp:=", "No", "Szs:=", Array(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array("shp:=", "No", "Szs:=", Array(), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0"), "thm:=", Array("shp:=", "R90", "Szs:=", Array( _
"3mm", "0.75mm", "1mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", _
"0mm", "dir:=", "Any"), Array("NAME:lgm", "lay:=", "Bottom signal", "id:=", 5, "pad:=", Array
("shp:=", _
"Cir", "Szs:=", Array("1mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "ant:=", Array
("shp:=", _
"Cir", "Szs:=", Array("2mm"), "X:=", "0mm", "Y:=", "0mm", "R:=", "0deg"), "thm:=", Array
("shp:=", _
"No", "Szs:=", Array(), "X:=", "0mm", "Y:=", "0mm", "R:=", "0"), "X:=", "0mm", "Y:=", _
"0mm", "dir:=", "Any")), "hle:=", Array("shp:=", "Cir", "Szs:=", Array("1.5mm"), "X:=", _
"0mm", "Y:=", "0mm", "R:=", "0deg"), "hRg:=", "End", "sbsh:=", "Sph", "sbpl:=", _
"abv", "sbr:=", "750um", "sb2:=", "1200um", "1200um", "sbn:=", "solder"), "ppl:=", Array( _
0, 1, 2, 3, 5), Array("")
Export [padstack manager]
Use: Export a padstack to a library
Command: Tools > Edit Configured Libraries > Padstacks > Export to Library
Syntax: Export Array("NAME:<LibraryName>",
<PadstackName>,
<PadstackName>...),
<LibraryLocation>
Return Value: None
Parameters: <LibraryName>:
<string> // name of the library
<PadstackName>:
<string> // simple name of padstack to export
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
Note:
GetData allows the user to access definition information, make modifications, and then use the Edit or EditWithComps
script commands to save the modified definition. Accordingly, for each type of definition, the array data returned to
GetData should be the same array information that is supplied to the Edit or EditWithComps commands.
Parameters: None
VB Example:
Dim padstackNames
padstackNames = oPadstackManager.GetNames()
IsUsed [padstack manager]
Use: Used to determine if a component is used in the design.
Command: None
Syntax: IsUsed(<PadstackName>)
Return Value: <Boolean> // true if the specified padstack is used in the design
Parameters: <PadstackName>:
<string>
VB Example:
Dim isUsed
isUsed = oPadstackManager.IsUsed("MyPadstack")
Remove [padstack manager]
Use: Removes a padstack from a library
Command: Tools > Edit Configured Libraries > Padstacks > Remove Padstacks
Syntax: Remove <PadstackName>,
<IsProjectPadstack>,
<LibraryName>,
<LibraryLocation>
Return Value: None
Parameters: <PadstackName>:
<string> // simple name of the padstack to remove
<IsProjectPadstack>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
Syntax: RemoveUnused()
Return Value: <bool> True if one or more padstacks are removed.
Parameters: None
VB Example:
Dim removedDefs
removedDefs = oPadstackManager.RemoveUnused()
Note:
The order of calls to RemoveUnused is significant. As a result, removing definitions in an unordered fashion may cause
other padstacks in dependent definitions to be rendered unusable.
AddScript
Adds a script to the definition manager.
UI Access N/A
EditScript
Edits a script in the definition manager.
UI Access N/A
oDefinitionManager.EditScript("MyScript",
["NAME:MyNewScript",
"ScriptLang:=", "vbscript",
Python Example
"ScriptText:=", "MsgBox(\"HelloAgain\")"
]
)
ExportScript
Use: Export to Library in the script definition manager
Command: None
Syntax: ExportScript <ExportData>,<Library location>
Return Value: None
Parameters: <ExportData>
Array("NAME:<LibraryName>",<ScriptName>,<ScriptName>,…)
VB Example:
oProject.ExportComponent Array("NAME:mylib", "myscript"), "PersonalLib"
oProject.ExportComponent
Python Example
(["NAME:mylib", "myscript"], "PersonalLib")
ModifyLibraries
Use: Configure Libraries on the Tools menu
Command: None
Syntax: ModifyLibraries <DesignName>,Array(<ConfigLibArray>)
Return Value: None
Parameters: <DesignName>
Type: <string>
<ConfigLibArray>
Array("NAME:<LibraryType>,<ConfiguredLib>,<ConfiguredLib>,…),…
<ConfiguredLib> // blank to leave unchanged
<DefinitionType>
Array("<libraryname >","<libraryname>",…)
VB Example:
oDefinitionManager.ModifyLibraries "MyCircuit", _
Array("NAME:PersonalLib"), _
Array("NAME:UserLib"), _
Array("NAME:SystemLib", _
"Symbols:=", Array( "Circuit Elements", "Symbols", _
"ParamExtraElements\PE_Symbols", _
"Vendor Elements\Nonlinear"))
RemoveScript
Use: Remove Script in the script definition manager
Command: None
Syntax: RemoveScript <ScriptName>,<IsProjectScript>, <LibraryName>,<LibraryLocation>
Return Value: None
Parameters: <ScriptName>
Type: <string>
<IsProjectScript>
Type: <bool>
<LibraryName>
Type: <string>
<LibraryLocation>
Type: <string>
VB Example:
oDefinitionManager.RemoveScript "myscript", true, "Local", "Project"
EditWithComps
Export
GetData
GetNames
IsUsed
Remove
RemoveUnused
Add [symbol manager]
Use: Add a symbol
Command: Tools > Edit Configured Libraries > Symbols > Add Symbol
Syntax: Add Array("NAME:<SymbolName>",
"ModTime:=", <ModifiedTimeInfo>,
"Library:=", "", // Library name
"LibLocation:=", "Project", // Project Location
<PinDefInfo>,
<PinDefInfo>,... // optional, to define pins
<GraphicsDataInfo>, // optional, to define graphics
<PropDisplayMapInfo>)) // optional, to define property displays
Parameters: <SymbolName>:
<string> // simple name of the symbol being added
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<PinDefInfo>:
Array("NAME:PinDef",
"Pin:=", Array (<string>, // pin name
<real>, // x location
<real>, // y location
<real>, // angle in radians
<PinType>,
<real>, // line width
<real>, // line length
<bool>, // mirrored
<int>, // color
<bool>, // true if visible, false if not
<string>, // hidden net name
<OptionalPinInfo>, // optional info
<PropDisplayMapInfo>)) // optional
<PinType>:
<string> // "N" : normal pin
// "I" : input pin
// "O" : output pin
<OptionalPinInfo>:
// Specify both or neither
<bool>, // true if name is to be shown
<bool>, // true if number is to be shown
<PropDisplayMapInfo>:
Array("NAME:PropDisplayMap",
<PropDisplayInfo>,
<PropDisplayInfo>,...)
<PropDisplayInfo>:
<NameString>, Array(<DisplayTypeInfo>,
<DisplayLocationInfo>,
<int>, // optional, level number
<TextInfo>)
<NameString>:
<string> // PropertyName:=, where PropertyName is the name of
// the property to be displayed
<DisplayTypeInfo>:
<int> // 0 : No display
// 1 : Display name only
// 2 : Display value only
// 3 : Display both name and value
// 4: Display evaluated value only
// 5: Display both name and evaluated value
<DisplayLocationInfo>:
<int> // 0 : Left
// 1 : Top
// 2 : Right
// 3 : Bottom
// 4 : Center
// 5 : Custom placement
<GraphicsDataInfo>:
Array("NAME:Graphics",
// one or more of the following
<RectInfo>,
<CircleInfo>,
<ArcInfo>,
<LineInfo>,
<PolygonInfo>,
<TextInfo>,
<ImageInfo>)
<RectInfo>:
"Rect:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // angle, in radians
<real>, // x position of center
<real>, // y position of center
<real>, // width
< real>) // height
<CircleInfo>:
"Circle:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>) // radius
<ArcInfo>:
"Arc:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<real>, // x position of center
<LineInfo>:
"Line:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<PointInfo>, // must specify at least 2 points
<PointInfo>...)
<PointInfo>:
<real>, // x position
<real> // y position
<PolygonInfo>:
"Polygon:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<PointInfo>, // must specify at least 3 points
<PointInfo>...)
<TextInfo>:
"Text:=", Array(<real>, // x position
<real>, // y position
<real>, // angle, in radians
<Justification>,
<bool>, // is plotter font
<string>, // font name
<int>, // color
<string>) // text string
<Justification>:
<int> // 0 : left top
// 1 : left base
// 2 : left bottom
// 3 : center top
// 4 : center base
// 5 : center bottom
// 6 : right top
// 7 : right base
// 8 : right bottom
<ImageInfo>:
"Image:=", Array(<RectInfo>,
<ImageData>,
<bool>) // is mirrored
<ImageData>:
<string>, // file path
<int>, // 0 : use the file path and link to it
// 1 : ignore file path and use next parameter
<string> // text data, only present if preceding int is 1
VB Example:
oSymbolManager.Add Array("NAME:MySymbol",_
"ModTime:=", 1070989137, _
"Library:=", "", _
"LibLocation:=", "Project", _
Array("NAME:PinDef", _
"Pin:=", Array ("newpin0", _
0.00254, _ 0, _
0, _
"N",_
0, _
0.00254, _
false, _
0, _
true, _
"",_
false, _
false)), _
Array("NAME:PinDef", _
"Pin:=", Array ("newpin1", _
-0.00254, _
0, _
3.14159265358979, _
"N",_
0, _
0.00254, _
false, _
0, _
true, _
"",_
false, _
false)),
Array("NAME:Graphics", _
"Rect:=", Array(0, _
0, _
12566272, _
0, _
4.33680868994202e-019, _
-0.000635, _
0.00508, _
0.002794), _
"Circle:=", Array(0, _
0, _
12566272, _
0.000127, _
0.000635, _
0.000635)))
Edit [deprecated]
Deprecated command — please use EditWithComps.
EditWithComps [symbol manager]
Use: Edit an existing symbol.
Command: None
Syntax: EditWithComps <SymbolName>,
Array("NAME:<NewSymbolName>",
"ModTime:=", <ModifiedTimeInfo>,
"Library:=", <string>, // Library name
"LibLocation:=", <string>, // Project Location
<PinDefInfo>,
<PinDefInfo>,... // optional, to define pins
Parameters: <SymbolName>:
<string> // composite name of the symbol being edited
<NewSymbolName>:
<string> // new simple name for the symbol
<ModifiedOnInfo>:
An integer that corresponds to the number of seconds that have elapsed
since 00:00 hours, Jan 1, 1970 UTC from the system clock.
<PinDefInfo>:
Array("NAME:PinDef",
"Pin:=", Array (<string>, // pin name
<real>, // x location
<real>, // y location
<real>, // angle in radians
<PinType>,
<real>, // line width
<real>, // line length
<bool>, // mirrored
<int>, // color
<bool>, // true if visible, false if not
<string>, // hidden net name
<OptionalPinInfo>, // optional info
<PropDisplayMapInfo>)) // optional
<PinType>:
<string> // "N" : normal pin
// "I" : input pin
// "O" : output pin
<OptionalPinInfo>:
// Specify both or neither
<bool>, // true if name is to be shown
<bool>, // true if number is to be shown
<PropDisplayMapInfo>:
Array("NAME:PropDisplayMap",
<PropDisplayInfo>,
<PropDisplayInfo>,...)
<PropDisplayInfo>:
<NameString>, Array(<DisplayTypeInfo>,
<DisplayLocationInfo>,
<int>, // optional, level number
<TextInfo>)
<NameString>:
<string> // PropertyName:=, where PropertyName is the name of
// the property to be displayed
<DisplayTypeInfo>:
<int> // 0 : No display
// 1 : Display name only
// 2 : Display value only
// 3 : Display both name and value
// 4: Display evaluated value only
// 5: Display both name and evaluated value
<DisplayLocationInfo>:
<int> // 0 : Left
// 1 : Top
// 2 : Right
// 3 : Bottom
// 4 : Center
// 5 : Custom placement
<GraphicsDataInfo>:
Array("NAME:Graphics",
// one or more of the following
<RectInfo>,
<CircleInfo>,
<ArcInfo>,
<LineInfo>,
<PolygonInfo>,
<TextInfo>,
<ImageInfo>)
<RectInfo>:
"Rect:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // angle, in radians
<real>, // x position of center
<real>, // y position of center
<real>, // width
< real>) // height
<CircleInfo>:
"Circle:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<real>, // x position of center
<ArcInfo>:
"Arc:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<real>, // x position of center
<real>, // y position of center
< real>, // radius
<real>, // start angle, in radians
<end>) // end angle, in radians
<LineInfo>:
"Line:=", Array(<real>, // line width
<int>, // line pattern
<int>, // color
<PointInfo>, // must specify at least 2 points
<PointInfo>...)
<PointInfo>:
<real>, // x position
<real> // y position
<PolygonInfo>:
"Polygon:=", Array(<real>, // line width
<int>, // fill pattern
<int>, // color
<PointInfo>, // must specify at least 3 points
<PointInfo>...)
<TextInfo>:
"Text:=", Array(<real>, // x position
<real>, // y position
<real>, // angle, in radians
<Justification>,
<bool>, // is plotter font
<string>, // font name
<int>, // color
<string>) // text string
<Justification>:
<ImageInfo>:
"Image:=", Array(<RectInfo>,
<ImageData>,
<bool>) // is mirrored
<ImageData>:
<string>, // file path
<int>, // 0 : use the file path and link to it
// 1 : ignore file path and use next parameter
<string> // text data, only present if preceding int is 1
<ListOfComponentNames>:
<string>,<string> ...
// The list may be empty. When not empty, each string that is listed is a component
// that references the symbol to be edited. Prior to editing, a clone of the symbol is
// made, and the components that are listed are modified so that they now refer to
// the clone.
VB Example:
Dim nam
oSymbolManager.EditWithComps _
("Nexxim Circuit Elements\Distributed\Distributed:bendo", _
Array("NAME:bendo new name", _
"ModTime:=", 1152722165, _
"Library:=", "Nexxim Circuit Elements\Distributed\Distributed", _
"LibLocation:=", "SysLibrary", _
Array("NAME:PinDef", _
"Pin:=", Array( "n1", _
-0.00254, _
0.00254, _
0, _
"N", _
0, _
0, _
false, _
0, _
true, _
"", _
false, _
false)), _
Array("NAME:PinDef", _
"Pin:=", Array( "n2", _
0.00254, _
-0.00254, _
1.5708, _
"N", _
0, _
0, _
false, _
0, _
true, _
"", _
false, _
false)), _
Array("NAME:Graphics", _
"Polygon:=", Array( 0, 0, 12566272, 0, 0.00381, 0, .00127, 0.00127, _
0.00127, 0.00127, 0, 0.00381, 0, 0.00381, _
0.002032, 0.00127, 0.00381), _
"Line:=", Array(0, 1, 12566272, -0.00254, 0.00254, 0, .00254), _
"Line:=", Array(0, 1, 12566272, 0.00254, -0.00254, .00254, 0)), _
Array("NAME:PropDisplayMap", _
"W:=", Array(3, _
5, _
0, _
"Text:=", Array( 2.1684E-019, _
0.00504119, _
0, _
1, _
5, _
false, _
"Arial", _
0, _
"W=***"))))), _
Array("MY_COMP")
<SymbolName>:
<string> // composite name of symbol to export
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
oSymbolManager.Export _
Array("NAME Nexxim Circuit Elements\Distributed\Distributed:bendo:mylib", _ "mySymbol"), "Per-
sonalLib"
GetData [symbol manager]
Use: Gets data that describes the definition.
Command: None
Syntax: GetData(<DefinitionName>)
Return Value: <DefinitionData> This is an array of data for the definition.
Parameters: <DefinitionName>:
<string> // composite name of the definition to edit
VB Example:
Dim symbolData
symbolData = oSymbolManager.GetData("Nexxim Circuit Elements\Hspice:nexx_bjt_npn")
Note:
GetData allows the user to access definition information, make modifications, and then use the Edit or EditWithComps
script commands to save the modified definition. Accordingly, for each type of definition, the array data returned to
GetData should be the same array information that is supplied to the Edit or EditWithComps commands.
<IsProjectSymbol>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
VB Example:
Note:
The order of calls to RemoveUnused is significant. As a result, removing definitions in an unordered fashion may cause
other symbols in dependent definitions to be rendered unusable.
Also, the symbol and footprint of an unused component are not unusable until after the component itself is removed using
the Component Manager Remove script.
AddRuleSet
Use: Adds a rule set to the design
Command: Right-click Design Verification in the Project Tree and choose Add Rule Set
Syntax: AddRuleSet Array("NAME:<RuleSetName>",
"ScriptNames:=", <ScriptInfo>,
"ScriptActiveFlags:=", <ScriptFlags>)
Return Value: None
Parameters: <RuleSetName>:
<string> // name of the rule set to create
<ScriptInfo>:
Array(<string>, <string>,...) // names of scripts to be in the rule set
<ScriptFlags>:
sequence of "t" and "f" characters
t indicates a script that is active (used in when the rule set is run)
f indicates a script is not currently active (used when the rule set is run)
applied to the scripts as ordered in <ScriptInfo>
<string>
VB Example:
oModule.AddRuleSet Array("NAME:Rule Set 9", _
"ScriptNames:=", Array("And", _
"Find Shorts"), _
"ScriptActiveFlags:=", "tf")
AddRun
Use: Adds a run to a rule set already in the design
Command: Right-click on a rule set item under Design Verification in the Project Tree and choose Add Run
Syntax: AddRun <RuleSetName>,
Array("NAME:<RunName>",
"TargetType:=", <TargetTypeInfo>, // optional
"TargetObjects:=", <TargetObjectsInfo>, // optional
"IgnoredObjects:=", <IgnoredObjectsInfo>, // optional
"ArcTolerance:=", <ToleranceString>) // optional
Return Value: None
Parameters: <RuleSetName>:
<string> // name of an existing rule set
<RunName>:
<string> // name of the run to create
<TargetTypeInfo>:
<int> // 0 for entire layout (default if not specified)
// 1 for specified portion of layout
<TargetObjectsInfo>:
objects on which to perform the check
may specify if TargetTypeInfo is 1 (specified portion of layout)
"<ObjectName>, <ObjectName>, ..."
<ObjectName>:
<string> // name of a layout object
<IgnoredObjectsInfo>:
objects which to ignore when performing the check
may specify if TargetTypeInfo is 0 (entire layout)
"<ObjectName>, <ObjectName>, ..."
<ToleranceString>:
<string> // real number and units
// if not specified, the current layout arc tolerance is used
VB Example:
oModule.AddRun "Rule Set 10", _
Array("NAME:All", _
"TargetType:=", 0)
oModule.AddRun "Rule Set 10", _
Array("NAME:Selected Objs2", _
"TargetType:=", 1, _
"TargetObjects:=", "line_975,line_1015")
oModule.AddRun "Rule Set 10", _
Array("NAME:Objects to Ignore2", _
"TargetType:=", 0, _
"IgnoredObjects:=", "via_209,line_736")
DeleteRuleSet
Use: Deletes a rule set from the design
Command: Right-click on a rule set item under Design Verification in the Project Tree and choose Delete
Syntax: DeleteRuleSet <RuleSetName>
Return Value: None
Parameters: <RuleSetName>:
<string> // name of the rule set to delete
VB Example: oModule.DeleteRuleSet "Rule Set 9"
DeleteRun
Use: Deletes a run from an existing a rule set
Command: Right-click on a run item under Design Verification in the Project Tree and choose Delete
Syntax: DeleteRun <RuleSetName>, <RunName>
Return Value: None
Parameters: <RuleSetName>:
<string> // name of an existing rule set
<RunName>:
<string> // name of the run to delete
VB Example: oModule.DeleteRun "Rule Set 10", "All
EditRuleSet
Use: Edits a existing rule set
Command: Right-click on a rule set item under Design Verification in the Project Tree and choose Properties.
Syntax: EditRuleSet <ExistingRuleSetName>,
Array("NAME:<RuleSetName>",
"ScriptNames:=", <ScriptInfo>,
"ScriptActiveFlags:=", <ScriptFlags>)
Return Value: None
Parameters: <ExistingRuleSetName>:
<string> // name of the rule set to change
<RuleSetName>:
<string> // name of the rule set after change
<ScriptInfo>:
Array(<string>, <string>,...) // names of scripts to be in the rule set
<ScriptFlags>:
sequence of "t" and "f" characters
t indicates a script that is active (used in when the rule set is run)
f indicates a script is not currently active (used when the rule set is run)
applied to the scripts as ordered in <ScriptInfo>
<string>
VB Example: oModule.EditRuleSet "Rule Set 9", _
Array("NAME:Rule Set 10", _
"ScriptNames:=", Array("And", _
"Find Shorts"), _
"ScriptActiveFlags:=", "tt")
EditRun
Use: Edits an existing run.
Command: Right-click on a run item under Design Verification in the Project Tree and choose Properties.
Syntax: EditRun <RuleSetName>,
<ExistingRunName>,
Array("NAME:<RunName>",
"TargetType:=", <TargetTypeInfo>, // optional
"TargetObjects:=", <TargetObjectsInfo>, // optional
"IgnoredObjects:=", <IgnoredObjectsInfo>, // optional
"ArcTolerance:=", <ToleranceString>) // optional
Return Value: None
Parameters: <RuleSetName>:
<string> // name of an existing rule set
<ExistingRunName>:
<string> // name of the run to change
<RunName>:
<string> // name of the run after the changes
<TargetTypeInfo>:
RenameRuleSet
Use: Renames a existing rule set
Command: Right-click on a rule set item under Design Verification in the Project Tree and choose Rename
Syntax: RenameRuleSet <ExistingRuleSetName>, <NewRuleSetName>
Return Value: None
Parameters: <ExistingRuleSetName>:
<string> // name of the rule set to change
<NewRuleSetName>:
<string> // new name for the rule set
VB Example: oModule.RenameRuleSet "Rule Set 12", "Rule Set 30"
RenameRun
Use: Renames an existing run.
Command: Right-click on a run item under Design Verification in the Project Tree and choose Rename
Syntax: RenameRun <RuleSetName>, <ExistingRunName>, <NewRunName>
Return Value: None
Parameters: <RuleSetName>:
<string> // name of an existing rule set
<ExistingRunName>:
<string> // name of the run to change
<NewRunName>:
<string> // new name for the run
VB Example: oModule.RenameRun "Rule Set 30", "New All", "Sel Objects"
RunAllDV
Use: Executes all runs in the Design Verification Project Tree item.
Command: Right-click on Design Verification in the Project Tree and choose Run All
Syntax: RunAllDV
Return Value: None
Parameters: None
VB Example: oModule.RunAllDV
RunAllRuleSetDV
Use: Executes all runs in an existing rule set
Command: Right-click on a rule set item under Design Verification in the Project Tree and choose Run All
Syntax: RunAllRuleSetDV <RuleSetName>
Return Value: None
Parameters: <RuleSetName>:
<string> // name of an existing rule set
VB Example: oModule.RunAllRuleSetDV "Rule Set 30"
RunDV
Use: Executes the specified run in an existing rule set
Command: Right-click on a run item under Design Verification in the Project Tree and choose Run
Syntax: RunDV <RuleSetName>, <RunName>
Return Value: None
Parameters: <RuleSetName>:
<string> // name of an existing rule set
<RunName>:
<string> // name of the run to execute
VB Example: oModule.RunDV "Rule Set 30", "Run 2"
33-12
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
AddErrorMessage
Adds an error message to the Message Manager window. AddErrorMessageis a function of
CoreGlobalScriptContextFunctions.
UI Access N/A
Python AddErrorMessage(<message>)
Syntax
import CoreGlobalScriptContextFunctions
Python
Example CoreGlobalScriptContextFunctions.AddErrorMessage('My error
message.')
VB Syntax N/A
VB Example N/A. Script cannot be run in VBScript.
AddFatalMessage
Adds a fatal error message to the Message Manager window. AddFatalMessageis a function of
CoreGlobalScriptContextFunctions.
UI Access N/A
Python AddFatalMessage(<message>)
Syntax
Python
import CoreGlobalScriptContextFunctions
Exampl- CoreGlobalScriptContextFunctions.AddFatalMessage('My fatal
e error message.')
VB Syntax N/A
VB Example N/A. Script cannot be run in VBScript.
AddInfoMessage
Adds an informational message to the Message Manager window. AddInfoMessageis a func-
tion of CoreGlobalScriptContextFunctions.
UI Access N/A
Python AddInfoMessage(<message>)
Syntax
VB Syntax N/A
VB Example N/A. Script cannot be run in VBScript.
AddWarningMessage
Adds a warning message to the Message Manager window. AddWarningMessageis a function
of CoreGlobalScriptContextFunctions.
UI Access N/A
Python AddWarningMessge(<message>)
Syntax
import CoreGlobalScriptContextFunctions
Python
Example CoreGlobalScriptContextFunctions.AddWarningMessage('My warn-
ing.')
VB Syntax N/A
VB Example N/A. Script cannot be run in VBScript.
LogDebug
Adds a debug line to the log specified at Tools > Debug Logging. LogDebugis a function of
CoreGlobalScriptContextFunctions.
UI Access N/A
Python LogDebug(<message>)
Syntax
import CoreGlobalScriptContextFunctions
Python
Example CoreGlobalScriptContextFunctions.LogDebug('My debug mes-
sage.')
VB Syntax N/A
VB Example N/A. Script cannot be run in VBScript.
LogError
Adds an error line to the log specified at Tools > Debug Logging. LogErroris a function of
CoreGlobalScriptContextFunctions.
UI Access N/A
Python LogError(<error>)
Syntax
VB Syntax N/A
VB Example N/A. Script cannot be run in VBScript.
35 - Example Scripts
This section contains VBScript and IronPython example scripts.
arr(0) = Trim(arr(0))
arr(1) = Trim(arr(1))
arr(2) = Trim(arr(2))
if cint(arr(2)) <> 1 then
del_f = (arr(1)-arr(0))/(arr(2)-1)
else
del_f = 0
end if
temp = InputBox("Input the Setup and Sweep number to use:"_
& chr(13) & "(e.g. input 1,2 for Setup1 and Sweep2)", _
"Solution Data","1,1",50,50)
arr2 = split(temp,",")
stn = arr2(0)
swn = arr2(1)
stn = Trim(stn)
swn = Trim(swn)
'
' Loop through the freq points.
'
for i=1 to arr(2) step 1
freq = arr(0) + (cint(i)-1)*del_f
x=freq
cfreq="Freq='" & freq & "Ghz'"
'
' Get the values of the output variables for the desired freq.
'
val = oDesign.GetOutputVariableValue("re_S","Setup" & _
stn & " :Sweep" & swn,cfreq, "")
y = val
val = oDesign.GetOutputVariableValue("im_S","Setup" & _
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
’ Declare the arrays and variables needed for building the polyline.
’
Dim points(), segments()
Dim NumPoints, R(2), P(2), PointsPerTurn, Turns, Units
’
’ Establish the constant Pi.
Pi = 4*Atn(1)
’ Retrieve the variable helix parameters from the user.
’ Start with the input for unit selection.
’
Units = InputBox("Select the units:"&Chr(13)& _
"(cm,mm,um,in,mil)", "Variable Helix","mil",50,50)
’
’ Check to make sure it is a valid unit.
’
Select Case Units
Case "m"
Units = ""
Case "cm"
Case "mm"
Case "um"
Case "in"
Case "mil"
Case Else
MsgBox("Invalid Units - defaults to m")
Units = ""
End Select
’
’ Obtain the other user-defined parameters.
’
Turns = InputBox("Select the number of turns (must be
integer):","Variable Helix", 2,50,50)
PointsPerTurn = InputBox("Select the points per turn:", _
"Variable Helix",16,50,50)
R(0) = InputBox("Select the initial Radius: ", _
"Variable Helix",10,50,50)
R(1) = InputBox("Select the final Radius: ", _
"Variable Helix",10,50,50)
P(0) = InputBox("Select the initial Pitch: ", _
"Variable Helix", 4,50,50)
P(1) = InputBox("Select the final Pitch: ", _
"Variable Helix", 4,50,50)
NumPoints = Turns*PointsPerTurn
’
’ Initialize the points and segments arrays.
’
Redim points(NumPoints+1)
Redim segments(NumPoints)
points(0) = "NAME:PolylinePoints"
segments(0) = "NAME:PolylineSegments"
’
’ Build the Point and Segment Arrays needed in the HFSS polyline call.
’
For n = 1 To (NumPoints+1)
Angle = (n-1)*2*Pi/PointsPerTurn
oEditor.CreateCircle _
Array("NAME:CircleParameters", "IsCovered:=", true, "XCenter:=",_
cstr(R(0))&Units, "YCenter:=", 0, "ZCenter:=", 0, "Radius:=", _
"1"&Units, "WhichAxis:=", "Y"), _
Array("NAME:Attributes", "Name:=", "Circle_Helix", "Flags:=", _
"", "Color:=", "(132 132 193)", "Transparency:=", 0.4, _
"PartCoordinateSystem:=", "Global", "MaterialName:=", "vacuum", _
"SolveInside:=", true)
’
’ Sweep the cross-section along the path.
’
oEditor.SweepAlongPath _
Array("NAME:Selections", "Selections:=", _
"Circle_Helix,Line_Helix"),
Array("NAME:PathSweepParameters", "DraftAngle:=", "0deg", _
"DraftType:=", "Round", "TwistAngle:=", "0deg")
GetPropNames and GetPropValues for Layered Impedance Boundary
Script
The following example script used Object Oriented commands to GetPropName for a Layered
Impedance Boundary, and then use the names to use GetPropValue for those properties.
' ----------------------------------------------
' Script Recorded by Ansys Electronics Desktop Version 2022.1.0
' 14:55:18 Oct 25, 2022
' ----------------------------------------------
Option Explicit
test_layered_impedance()
Sub test_layered_impedance()
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Dim oBoundaries
Dim Layered_Boundaries
Dim single_boundary
Dim oBoundary
Dim Get_Boundary_Properties
Dim Layer_Name
Dim Layer_Type
Dim Layer_Roughness
Dim Layer_Inf_Ground_Plane
Dim Layer_Two_Sided
Dim Layer_Shell_Element
Dim Layer_Number_of_Layers
Dim Layer_L1_Thickness
Dim Layer_L1_Material
Dim Layer_L2_Thickness
Dim Layer_L2_Material
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop.2022.1")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("test1")
Set oDesign = oProject.SetActiveDesign("HFSSDesign1")
Set oModule = oDesign.GetModule("BoundarySetup")
'Get_Boundary_Properties = oBoundary.GetPropNames()
Layer_Name = oBoundary.GetPropValue("Name")
Layer_Type = oBoundary.GetPropValue("Type")
Layer_Roughness = oBoundary.GetPropValue("Roughness")
Layer_Inf_Ground_Plane = oBoundary.GetPropValue("Inf Ground
Plane")
Layer_Two_Sided = oBoundary.GetPropValue("Two sided")
Layer_Shell_Element = oBoundary.GetPropValue("Shell Ele-
ment")
Layer_Number_of_Layers = oBoundary.GetPropValue("Number of
Layers")
Layer_L1_Thickness = oBoundary.GetPropValue("Layer 1/Thick-
ness")
Layer_L1_Material = oBoundary.GetPropValue("Layer 1/Ma-
terial")
Layer_L2_Thickness = oBoundary.GetPropValue("Layer 2/Thick-
ness")
Layer_L2_Material = oBoundary.GetPropValue("Layer 2/Ma-
terial")
MsgBox ("Name = " & Layer_Name & vbNewLine _
& "Type = " & Layer_Type & vbNewLine _
& "Roughness = " & Layer_Roughness & vbNewLine _
& "Inf Ground = " & Layer_Inf_Ground_Plane & vbNewLine _
& "Two-Sided = " & Layer_Two_Sided & vbNewLine _
& "Shell Element = " & Layer_Shell_Element & vbNewLine _
& "Number of Layers = " & Layer_Number_of_Layers & vbNewLine
_
& "Layer 1 Thickness = " & Layer_L1_Thickness & vbNewLine _
& "Layer 1 Material = " & Layer_L1_Material & vbNewLine _
& "Layer 2 Thickness = " & Layer_L2_Thickness & vbNewLine _
& "Layer 2 Material = " & Layer_L2_Material)
Next
End Sub
To recreate this tab file, paste the text below the script into a text editor and save as Posco_BH_
curve.tab.
The script itself includes comment lines, which are preceded by # and offer explanations for the
subsequent line(s).
Script Contents
# specify path to the file with BH coordinates
path_to_file = r"D:\Posco_BH_curve.tab"
# specify name of the material
material_name = "Posco 35PN250"
oProject = oDesktop.GetActiveProject()
oDefinitionManager = oProject.GetDefinitionManager()
""" create list with B and H points to pass to AddMaterial command
bh_coordinates list is a three dimensional array: 1D: name, 2D:
Coordinate list, 3D: BH point"""
bh_coordinates = ["NAME:BHCoordinates", ["NAME:DimUnits", "", ""]]
with open(path_to_file) as input_file:
for line in input_file:
h, b = line.split()
bh_coordinates.append(["NAME:Coordinate", [
"NAME:CoordPoint",
float(h),
float(b)
]
])
# create a new magnetic material with BH curve
oDefinitionManager.AddMaterial(
[
"NAME:" + material_name,
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic"]
],
[
"NAME:permeability",
"property_type:=" , "nonlinear",
"BTypeForSingleCurve:=" , "normal",
"HUnit:=" , "A_per_meter", # unit can be specified as
variable
"BUnit:=" , "tesla", # unit can be specified as variable
"IsTemperatureDependent:=", False,
bh_coordinates,
[
"NAME:Temperatures"
]
],
"conductivity:=" , "1818181.82",
[
"NAME:magnetic_coercivity",
"property_type:=" , "VectorProperty",
"Magnitude:=" , "0A_per_meter",
"DirComp1:=" , "1",
"DirComp2:=" , "0",
"DirComp3:=" , "0"
]
])
Posco_BH_Curve.tab Contents
0 0.000
10 0.050
20 0.130
23 0.152
25 0.175
28 0.202
30 0.229
33 0.257
35 0.287
38 0.318
40 0.356
43 0.395
45 0.435
48 0.477
52 0.523
56 0.574
60 0.626
66 0.683
72 0.740
78 0.795
87 0.850
97 0.906
112 0.964
130 1.024
151 1.084
175 1.140
200 1.189
225 1.228
252 1.258
282 1.283
317 1.304
357 1.324
402 1.343
450 1.360
500 1.375
550 1.387
602 1.398
657 1.407
717 1.417
784 1.426
867 1.437
974 1.448
1117 1.461
1299 1.478
1515 1.495
1752 1.513
2000 1.529
2253 1.543
2521 1.557
2820 1.570
3167 1.584
3570 1.600
4021 1.617
4503 1.634
5000 1.652
5503 1.669
6021 1.685
6570 1.701
7167 1.717
7839 1.733
8667 1.749
9745 1.769
11167 1.793
12992 1.820
15146 1.851
17518 1.882
20000 1.909
22552 1.931
25417 1.948
28906 1.961
33333 1.971
38932 1.981
Equation Based Curve Python Script
This sample Python script creates an equation based curve that produces a helix.
from math import pi, sin, cos
oProject = oDesktop.GetActiveProject()
oDesign = oProject.GetActiveDesign()
oEditor = oDesign.SetActiveEditor("3D Modeler")
Start_t = 0
End_t = pi*2
Npoint = 128
Nsection = Npoint-1
d_t = (End_t-Start_t)/Nsection
for n in range(1,Nsection):
P1 = Start_t+d_t*(n-1)
P2 = P1+d_t
X_t1 = cos(P1*6)
Y_t1 = sin(P1*6)
Z_t1 = P1
X_t2 = cos(P2*6)
Y_t2 = sin(P2*6)
Z_t2 = P2
oEditor.CreatePolyline(
[
"NAME:PolylineParameters",
"IsPolylineCovered:=" , True,
"IsPolylineClosed:=" , False,
[
"NAME:PolylinePoints",
[
"NAME:PLPoint",
"X:=" , '1mm*' + str(X_t1),
"Y:=" , '1mm*' + str(Y_t1),
"Z:=" , '1mm*' + str(Z_t1)
],
[
"NAME:PLPoint",
"X:=" , '1mm*' + str(X_t2),
"Y:=" , '1mm*' + str(Y_t2),
"Z:=" , '1mm*' + str(Z_t2)
]
],
[
"NAME:PolylineSegments",
[
"NAME:PLSegment",
"SegmentType:=" , "Line",
"StartIndex:=" , 0,
"NoOfPoints:=" , 2
]
],
[
"NAME:PolylineXSection",
"XSectionType:=" , "None",
"XSectionOrient:=" , "Auto",
"XSectionWidth:=" , "0mm",
"XSectionTopWidth:=" , "0mm",
"XSectionHeight:=" , "0mm",
"XSectionNumSegments:=" , "0",
"XSectionBendType:=" , "Corner"
]
],
[
"NAME:Attributes",
"Name:=" , "Polyline"+str(n),
"Flags:=" , "",
"Color:=" , "(132 132 193)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"vacuum\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , True,
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
The next asks for start, stop and step values for in an interpolating frequency sweep.
The following figure shows the waveguide array generated by the defaults.
After running the simulation, the plots defined by the script shows the following results.
import clr
clr.AddReferenceByPartialName("Microsoft.VisualBasic")
from Microsoft.VisualBasic.Constants import
vbOKOnly,vbOKCancel,vbAbortRetryIgnore,vbYesNoCancel,vbYesNo,vbRetryC-
ancel
from Microsoft.VisualBasic.Constants import
vbOK,vbCancel,vbAbort,vbRetry,vbIgnore,vbYes,vbNo
from Microsoft.VisualBasic.Interaction import InputBox, MsgBox
oProject = oDesktop.GetActiveProject()
oDesign = oProject.GetActiveDesign()
oEditor = oDesign.SetActiveEditor("3D Modeler")
#Ask for the start, stop, and step of the interpolating frequency
sweep
#--------------------------------------------------------------------
--
inputText = InputBox("Please enter the start, stop, and step of the
interpolating " +
"frequency sweep.", "Waveguide array generator",
"8GHz,12GHz,50MHz")
StartFrequency, StopFrequency, StepFrequency = inputText.split(',')
# Make variables and set them equal to the values from the user input
# -------------------------------------------------------------------
oDesign.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:LocalVariableTab",
[
"NAME:PropServers",
"LocalVariables"
],
[
"NAME:NewProps",
[
"NAME:a", "PropType:=", "VariableProp", "UserDef:=", True,
"Value:=", a_str
],
[
"NAME:b", "PropType:=", "VariableProp", "UserDef:=", True,
"Value:=", b_str
],
[
oEditor.CreateBox(
[
"NAME:BoxParameters",
"XPosition:=" , "-a/2-RadBoundDist",
"YPosition:=" , "-b/2-RadBoundDist",
"ZPosition:=" , "0mm",
"XSize:=" , "NumX*a+(NumX-1)*Lambda/2+2*RadBoundDist",
"YSize:=" , "NumY*b+(NumY-1)*Lambda/2+2*RadBoundDist",
"ZSize:=" , "RadBoundDist"
],
[
"NAME:Attributes",
"Name:=" , "RadiationBox",
"Flags:=" , "",
"Color:=" , "(132 132 193)",
"Transparency:=" , 0.8,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"vacuum\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , True,
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
[
"NAME:BoxParameters",
"XPosition:=" , "-a/2",
"YPosition:=" , "-b/2",
"ZPosition:=" , "0mm",
"XSize:=" , "a",
"YSize:=" , "b",
"ZSize:=" , "-WaveguideLength"
],
[
"NAME:Attributes",
"Name:=" , "Element1",
"Flags:=" , "",
"Color:=" , "(132 132 193)",
"Transparency:=" , 0.8,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"vacuum\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , True,
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
ElementNum += 1
"SaveAnyFields:=" , True,
"IESolverType:=" , "Auto",
"LambdaTargetForIESolver:=", 0.15,
"UseDefaultLambdaTgtForIESolver:=", True
])
oModule.InsertFrequencySweep("Setup1",
[
"NAME:InterpolatingSweep",
"IsEnabled:=" , True,
"RangeType:=" , "LinearStep",
"RangeStart:=" , StartFrequency,
"RangeEnd:=" , StopFrequency,
"RangeStep:=" , StepFrequency,
"Type:=" , "Interpolating",
"SaveFields:=" , False,
"InterpTolerance:=" , 0.5,
"InterpMaxSolns:=" , 50,
"InterpMinSolns:=" , 0,
"InterpMinSubranges:=" , 1,
"ExtrapToDC:=" , False,
"InterpUseS:=" , True,
"InterpUsePortImped:=" , False,
"InterpUsePropConst:=" , True,
"UseDerivativeConvergence:=", False,
"InterpDerivTolerance:=", 0.2,
"UseFullBasis:=" , True,
"EnforcePassivity:=" , True,
"PassivityErrorTolerance:=", 0.0001
])
"ThetaStart:=" , "-90deg",
"ThetaStop:=" , "90deg",
"ThetaStep:=" , "1deg",
"PhiStart:=" , "0deg",
"PhiStop:=" , "90deg",
"PhiStep:=" , "90deg",
"UseLocalCS:=" , True,
"CoordSystem:=" , "RelativeCS1"
])
"Frequency:=" , ["Nominal"]
],
[
"X Component:=" , "Theta",
"Y Component:=" , ["im(rEPhi)","re(rEPhi)","im(rETheta)","re
(rETheta)"]
], [])
#For phi = 90
#------------
oModule.CreateReport("Etheta/Ephi Re/Im Components for Phi=90", "Far
Fields",
"Rectangular Plot", "Setup1 : LastAdaptive",
[
"Context:=" , "Infinite Sphere1"
],
[
"Theta:=" , ["All"],
"Phi:=" , ["90deg"],
"Freq:=" , ["All"],
"a:=" , ["Nominal"],
"b:=" , ["Nominal"],
"NumX:=" , ["Nominal"],
"NumY:=" , ["Nominal"],
"WaveguideLength:=" , ["Nominal"],
"Frequency:=" , ["Nominal"]
],
[
"X Component:=" , "Theta",
"Y Component:=" , ["im(rEPhi)","re(rEPhi)","im(rETheta)","re
(rETheta)"]
], [])
35-38
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
2 DeleteEmptyGroups 11-57
Index-1
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetEdgeIDFromNameForFirstOper- GetVertexIDFromNameForFirstOperation
ation 11-189 11-220
Index-2
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-3
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-4
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-5
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-6
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
B AssignImpedance 14-73
Index-7
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-8
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-9
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-10
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-11
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-12
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-13
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-14
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-15
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-16
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-17
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-18
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-19
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-20
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-21
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
EnterQty 19-20
G
EnterScalar 19-21
general method script commands 31-48
EnterScalarFunc 19-22
GenerateAllUserDefinedModels 11-173
EnterSurf 19-22
GenerateHistory 11-89
EnterVector 19-23
GenerateUserDefinedModel 11-174
EnterVectorFunc 19-24
GenerateVariationData Parametric, para-
EnterVol 19-24 metric command 17-29, 17-103, 17-
ExportOnGrid 19-25 154
Index-22
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-23
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-24
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-25
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-26
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-27
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-28
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
L AreSurfaceMaterialPropertiesEqual
32-51
LaunchJobMonitor 3-43
CloneMaterial 5-29, 32-65
Layers Methods 30-78
EditMaterial 5-37, 32-97
layout
ExportMaterial 5-47, 32-115
script interrogation methods 30-
41 GetExtendedDefinitionObject 11-
192
Layout Interrogation 30-41
RemoveMaterial 5-73, 32-126
Layout Scripting 1-89, 30-1, 30-119
UpdateDefFromBlock 32-134
Layout3DMeshOverlay 26-6
Materials Scripting Support 6-23
LayoutMeshOverlay 26-6
Index-29
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-30
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
ModifyLibraries 32-334
O
ModifyNetClass 30-92
oAnsoftApp object 1-76
ModifyPMLGroup 14-229
Object Identifiers and Script Record-
module script commands ing 30-2
boundary/excitation 14-3 Object Movement and Modification
general method 31-48 Methods 30-31
Index-31
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-32
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-33
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-34
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-35
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-36
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-37
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-38
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-39
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-40
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-41
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
Index-42
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
StartAnalysis 9-149 U
statistical commands
UnassignIERegions 14-225
EditSetup 17-188
UncoverFaces 11-140
InsertSetup 17-191
underscore ( _ ) character 1-12, 1-14
Statistical Script Commands 17-188
Undo 9-151
Stitch 11-133
project-level command 5-86
StitchLines 30-161
Ungroup 11-142, 30-77
StopSimLink 9-149
UnGroupPlotCurvesInGroup 13-125
Stretch 24-60
Unite 11-141, 30-65, 30-65, 30-66,
string concatenation operator 1-7 30-66
Index-43
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
HFSS Scripting Guide
GetUserDefinedSolutionProperties
23-6 Z
Index-44
Ansys Electromagnetics Suite 2023 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.