Maxwell Scripting Guide
Maxwell Scripting Guide
Release 2024 R1
ANSYS, Inc. January 2024
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
Maxwell Scripting Guide
2
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell 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
Comparison Operators 1-7
Logical Operators 1-7
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-9
VBScript Procedures 1-10
Function Procedures 1-10
Sub Procedures 1-10
Contents-1
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-2
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-3
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Structures 1-39
Return Values for UDM and UDP Functions 1-40
Constants 1-40
Methods 1-40
Output Parameters 1-40
Comparison with C function: 1-41
'List Size' Parameters 1-41
Comparison with C function: 1-42
Added Parameters 1-43
Developing a UDM/UDP 1-44
Creation 1-44
Location 1-44
Organize 1-44
Edit/Reload 1-45
UDPExtension 1-45
Import 1-45
Main class: UDPExtension 1-45
IUDPExtension methods 1-45
Mandatory methods. 1-45
GetLengthParameterUnits() 1-45
GetPrimitiveTypeInfo() 1-45
GetPrimitiveParametersDefinition2() 1-45
AreParameterValuesValid2(errorMsg, udpParams) 1-46
CreatePrimitive2(funcLib, udpParams) 1-46
Optional methods 1-46
GetPrimitiveParameters() 1-46
GetRegisteredFaceNames() 1-46
GetRegisteredEdgeNames() 1-46
GetRegisteredVertexNames() 1-46
MapParametersDefinitionVersions2(oldVersion, oldUDPParams) 1-47
Contents-4
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetOldPrimitiveParametersDefinition2(version ) 1-47
Example UDP 1-47
UDMExtension 1-47
Import 1-47
Main class: UDMExtension 1-48
IUDMExtension methods 1-48
Mandatory methods. 1-48
GetInfo() 1-48
IsAttachedToExternalEditor() 1-48
CreateInstance(funcLib) 1-48
GetUnits(instanceId) 1-48
ReleaseInstance(instanceId) 1-49
GetAttribNameForEntityId() 1-49
GetAttribNameForPartId() 1-49
Optional methods 1-49
GetInstanceSourceInfo(instanceId) 1-50
ShouldAttachDefinitionFilesToProject() 1-50
Example UDM 1-50
UDMFunctionLibrary 1-51
Functions list: 1-52
UDM/UDP Functions 1-53
Return Values for Each UDM and UDP Function 1-53
UDP/UDM Structures and Constants 1-56
UDP/UDM Structures 1-56
List of structures 1-57
UDP/UDM Constants 1-63
Enum constants: 1-63
UDP Python Example 1-65
Introduction to CPython 1-70
Creating an External Script 1-70
Contents-5
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-6
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-7
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetDefinitionManager 2-41
GetDependentFiles 2-42
GetDesign 2-42
GetEDBHandle 2-43
GetLegacyName 2-43
GetName [Project] 2-44
GetPath 2-45
GetTopDesignList 2-46
InsertDesign 2-46
InsertDesignWithWorkflow 2-47
InsertToolObject 2-49
Paste (Project Object) 2-49
Redo [Project Level] 2-50
Rename 2-50
RestoreProjectArchive 2-51
Save 2-52
SaveAs 2-53
SaveAsStandAloneProject 2-55
SaveProjectArchive 2-56
SetActiveDefinitionEditor 2-57
SetActiveDesign 2-58
SimulateAll 2-58
Undo [Project] 2-59
UpdateDefinitions 2-60
3 - Application Object Script Commands 3-1
GetAppDesktop 3-2
GetApp 3-2
4 - Desktop Object Script Commands 4-1
AddMessage 4-5
ClearMessages 4-7
Contents-8
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
CloseAllWindows 4-11
CloseProject 4-11
CloseProjectNoForce 4-12
Count 4-13
DeleteProject 4-14
EnableAutoSave 4-15
ExportOptionsFiles 4-16
GetActiveProject 4-16
GetAutoSaveEnabled 4-17
GetBuildDateTimeString 4-18
GetCustomMenuSet 4-19
GetDefaultUnit 4-19
GetDesigns 4-22
GetDesktopConfiguration 4-23
GetDistributedAnalysisMachines 4-23
GetDistributedAnalysisMachinesForDesignType 4-24
GetExeDir 4-25
GetGDIObjectCount 4-26
GetLibraryDirectory 4-26
GetLocalizationHelper 4-28
GetMessages 4-28
GetName [Desktop] 4-30
GetPersonalLibDirectory 4-31
GetProcessID 4-32
GetProjects 4-32
GetProjectDirectory 4-33
GetProjectList 4-34
GetSchematicEnvironment 4-35
GetScriptingToolsHelper 4-35
GetSysLibDirectory 4-36
Contents-9
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetTempDirectory 4-37
GetUserLibDirectory 4-38
GetVersion 4-38
ImportANF 4-39
ImportAutoCAD 4-40
ImportGDSII 4-41
ImportODB 4-42
LaunchJobMonitor 4-43
NewProject 4-44
OpenAndConvertProject 4-45
OpenMultipleProjects 4-46
OpenProject 4-47
OpenProjectWithConversion 4-47
Paste (Project Object) 4-48
Paste (Project Object) 4-48
PauseRecording 4-49
PauseScript 4-50
Print 4-50
QuitApplication 4-51
RefreshJobMonitor 4-52
ResetLogging 4-53
RestoreProjectArchive 4-54
RestoreWindow 4-55
ResumeRecording 4-55
RunACTWizardScript 4-56
RunProgram 4-56
RunScript 4-57
RunScriptWithArguments 4-59
SelectScheduler 4-60
SetActiveProject 4-62
Contents-10
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
SetActiveProjectByPath 4-63
SetCustomMenuSet 4-63
SetDesktopConfiguration 4-65
SetLibraryDirectory 4-66
SetProjectDirectory 4-66
SetSchematicEnvironment 4-67
SetTempDirectory 4-68
ShowDockingWindow 4-69
Sleep 4-69
SubmitJob 4-70
TileWindows 4-71
Desktop Commands For Registry Values 4-72
DoesRegistryValueExist 4-73
GetRegistryInt 4-74
GetRegistryString 4-75
SetRegistryFromFile 4-76
SetRegistryInt 4-76
SetRegistryString 4-77
5 - Running Instances Manager Script Commands 5-1
GetAllRunningInstances 5-1
GetRunningInstanceByProcessID 5-2
GetRunningInstancesMgr 5-2
6 - Property Script Commands 6-1
Object Script Property Function Summary 6-3
Object Path 6-3
Property Object 6-4
Project Object 6-5
Design Object 6-6
3D Modeler Object 6-7
Variable Object 6-7
Contents-11
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-12
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
ExportConvergence 7-24
ExportElementBasedHarmonicForce 7-25
ExportHarmonicTransientForce 7-26
ExportMeshStats 7-28
ExportProfile 7-28
GetConfigurableData 7-29
GetData 7-30
GetDesignValidationInfo 7-30
GetGeometryMode 7-31
GetManagedFilesPath 7-32
GetModule 7-33
GetName 7-34
GetNominalVariation 7-35
GetNoteText 7-35
GetPostProcessingVariables 7-36
GetSelections [Design] 7-37
GetSolutionType 7-37
GetVariationVariableValue 7-37
InitializeSystemCoupling 7-38
Is2D 7-39
Is3D 7-39
Redo [Design] 7-40
RenameDesignInstance 7-41
ResetToTimeZero 7-41
SetActiveEditor 7-42
SetConductivityThreshold 7-43
SetDesignSettings [Maxwell] 7-43
SetFastTransformationForLayoutComponent 7-57
SetObjectAttributesForLayoutComponent 7-58
SetObjectDeformation 7-60
Contents-13
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
SetObjectTemperature 7-63
SetShowAllLayoutComponents 7-65
SetShowLayoutForLayoutComponent 7-65
SetSolutionType (Maxwell) 7-66
Solve 7-67
StopSimLink 7-67
RunToolkit 7-68
Undo [Design] 7-70
ValidateDesign 7-70
ValidateLink 7-71
8 - 3D Modeler Editor Script Commands 8-1
Conventions Used in this Chapter: 8-1
<AttributesArray> 8-1
<SelectionsArray> 8-2
Draw Menu Commands 8-4
Create3DComponent 8-6
CreateBondwire 8-10
CreateBox 8-14
CreateCircle 8-16
CreateCone 8-19
CreateCutplane 8-22
CreateCylinder 8-24
CreateEllipse 8-26
CreateEquationCurve 8-29
CreateEquationSurface 8-33
CreateHelix 8-36
CreatePoint 8-38
CreateUserDefinedPart 8-40
CreatePolyline 8-47
CreateRectangle 8-53
Contents-14
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
CreateRegion 8-55
CreateRegularPolyhedron 8-59
CreateRegularPolygon 8-62
CreateSphere 8-65
CreateSpiral 8-67
CreateTorus 8-69
CreateUserDefinedModel 8-72
CreateUserDefinedPart 8-79
Edit3DComponent 8-87
[Beta] EditNativeComponentDefinition [Maxwell] 8-89
EditPolyline 8-92
Get3DComponentParameters 8-97
Get3DComponentDefinitionNames 8-97
Get3DComponentInstanceNames 8-98
Get3DComponentMaterialNames 8-99
Get3DComponentMaterialProperties 8-99
Insert3DComponent 8-100
InsertNativeComponent [Layout Component to Maxwell with CS] 8-101
InsertPolylineSegment 8-105
SweepAlongPath 8-107
SweepAlongVector 8-109
SweepAroundAxis 8-112
SweepFacesAlongNormal 8-114
SweepFacesAlongNormalWithAttributes 8-116
UpdateComponentDefinition 8-119
Edit Menu Commands 8-120
Copy 8-120
DeletePolylinePoint 8-121
DuplicateAlongLine 8-122
DuplicateAroundAxis 8-125
Contents-15
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
DuplicateMirror 8-128
Mirror 8-131
Move 8-133
OffsetFaces 8-134
Paste (Model Editor) 8-136
Rotate 8-137
Scale 8-138
Modeler Menu Commands 8-140
AssignMaterial 8-142
Chamfer 8-145
Connect 8-147
CoverLines 8-148
CoverSurfaces 8-149
CreateEntityList 8-150
CreateFaceCS 8-152
CreateGroup 8-157
CreateObjectCS 8-158
CreateObjectFromEdges 8-165
CreateObjectFromFaces 8-166
CreateRelativeCS 8-168
DeleteEmptyGroups 8-170
DeleteLastOperation 8-171
DetachFaces 8-172
EditEntityList 8-173
EditFaceCS 8-175
EditObjectCS 8-181
EditRelativeCS 8-188
Export 8-190
ExportModelImageToFile 8-192
Fillet 8-196
Contents-16
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
FlattenGroup 8-198
GenerateHistory 8-199
HealObject 8-200
GetActiveCoordinateSystem 8-204
GetCoordinateSystems 8-205
Import 8-206
ImportDXF [Modeler] 8-209
ImportGDSII [Modeler] 8-213
Intersect 8-217
MoveCStoEnd 8-218
MoveEntityToGroup 8-219
MoveFaces 8-220
ProjectSheet 8-223
PurgeHistory 8-224
Section 8-225
SeparateBody 8-226
SetModelUnits 8-227
SetWCS 8-229
ShowWindow 8-230
Split 8-230
Subtract 8-233
SweepFacesAlongNormal 8-235
ThickenSheet 8-236
UncoverFaces 8-238
Unite 8-240
Ungroup 8-241
WrapSheet 8-242
Other oEditor Commands 8-243
AddDefinitionFromBlock 8-246
AddDefinitionFromLibFile 8-251
Contents-17
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
AddViewOrientation 8-255
BreakUDMConnection 8-262
ChangeProperty 8-263
Delete 8-270
GetBodyNamesByPosition 8-271
GetEdgeByPosition 8-272
GetEdgeIDsFromFace 8-274
GetEdgeIDsFromObject 8-275
GetFaceArea 8-275
GetFaceCenter 8-276
GetFaceByPosition 8-277
GetFaceIDs 8-278
GetGeometryModelerMode 8-279
GetModelBoundingBox 8-280
GetObjectIDByName 8-280
GetObjectName 8-281
GetObjectNameByFaceID 8-281
GetObjectsByMaterial 8-282
GetObjectsInGroup 8-283
GetMatchedObjectName 8-284
GetModelUnits 8-285
GetNumObjects 8-285
GetSelections [Model Editor] 8-286
GetUserPosition 8-287
GetVertexIDsFromEdge 8-287
GetVertexIDsFromFace 8-288
GetVertexIDsFromObject 8-289
GetVertexPosition 8-289
OpenExternalEditor 8-290
PageSetup 8-291
Contents-18
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
RenamePart 8-293
9 - Output Variable Script Commands 9-1
CreateOutputVariable (Maxwell) 9-1
DeleteOutputVariable 9-3
DoesOutputVariableExist 9-3
EditOutputVariable 9-4
GetOutputVariableValue 9-6
10 - Reporter Editor Script Commands 10-1
AddCartesianLimitLine 10-4
AddCartesianXMarker 10-6
AddCartesianYMarker 10-7
AddDeltaMarker 10-8
AddMarker 10-9
AddNote 10-10
AddTraceCharacteristics 10-12
AddTraces 10-13
ChangeProperty[ReportSetup] 10-16
ClearAllMarkers 10-20
ClearAllTraceCharacteristics 10-20
CopyTracesData 10-21
CopyReportsData 10-22
CopyReportDefinitions 10-23
CopyTraceDefinitions 10-23
CreateReportFromFile 10-24
CreateReport (Maxwell) 10-25
CreateReportFromTemplate 10-35
CreateReportOfAllQuantities 10-36
DeleteMarker 10-37
DeleteAllReports 10-38
DeleteReports 10-39
Contents-19
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
DeleteTraces 10-39
ExportImageToFile [Reporter] 10-40
ExportPlotImageToFile 10-41
ExportReport 10-43
ExportToFile 10-44
ExportToFile [Reporter] 10-46
ExportMarkerTable 10-47
FFTOnReport 10-47
GetAllReportNames 10-48
GetAllCategories 10-49
GetAllQuantities 10-50
GetAvailableDisplayTypes 10-51
GetAvailableReportTypes 10-52
GetAvailableSolutions 10-52
GetDataExpressions 10-53
GetDataUnits 10-54
GetDesignVariableNames 10-55
GetDesignVariableUnits 10-56
GetDesignVariableValue 10-57
GetDesignVariationKey 10-58
GetDisplayType (Maxwell) 10-59
GetImagDataValues 10-59
GetPerQuantityPrimarySweepValues 10-60
GetPropertyValue 10-61
GetRealDataValues 10-63
GetReportTraceNames 10-64
GetSolutionContexts 10-65
GetSolutionDataPerVariation 10-66
GetSweepNames 10-68
GetSweepUnits 10-69
Contents-20
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetSweepValues 10-70
GroupPlotCurvesByGroupingStrategy 10-71
ImportIntoReport 10-72
IsDataComplex 10-72
IsPerQuantityPrimarySweep 10-73
MovePlotCurvesToGroup 10-74
MovePlotCurvesToNewGroup 10-75
PasteReports 10-76
PasteTraces 10-77
Release Data 10-78
RenameReport 10-79
RenameTrace 10-79
ResetPlotSettings 10-80
SavePlotSettingsAsDefault 10-81
UpdateAllReports 10-82
UpdateReports 10-82
UpdateTraces 10-83
UpdateTracesContextAndSweeps 10-86
UnGroupPlotCurvesInGroup 10-88
11 - Boundary and Excitation Module Script Commands in Maxwell 11-1
General Commands Recognized by the Boundary/Excitations Module 11-2
AddAssignmentToBoundary 11-3
DeleteAllBoundaries 11-4
DeleteAllExcitations 11-5
DeleteBoundaries 11-5
GetBoundaryAssignment 11-6
GetBoundaries 11-7
GetBoundariesOfType 11-7
GetCoreLossEffect 11-8
GetCoreLossEffectOnField 11-9
Contents-21
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetDisplacementCurrent 11-9
GetEddyEffect 11-9
GetExcitations 11-10
GetExcitationsOfType 11-11
GetNumBoundaries 11-11
GetNumBoundariesOfType 11-12
GetNumExcitations 11-13
GetNumExcitationsOfType 11-13
ReassignBoundary 11-14
RemoveAssignmentFromBoundary 11-15
RenameBoundary 11-16
ReprioritizeBoundaries 11-17
Script Commands for Creating and Modifying Boundaries in Maxwell 11-18
AssignCylindricalHField 11-19
AssignDependent (2D) 11-20
AssignDependent (3D) 11-21
AssignFluxTangential 11-23
AssignImpedance (Maxwell) 11-23
AssignIndependent (Maxwell) 11-24
AssignInsulating 11-26
AssignRadiation (Maxwell) 11-26
AssignResistiveSheet 11-27
For 3D Magnetostatic, Eddy Current, and Transient designs 11-28
AssignSymmetry (Maxwell) 11-29
AssignTangentialHField 11-29
AssignThinLayer 11-30
AssignTouching 11-34
AssignVectorPotential 11-35
AssignZeroTangentialHField 11-36
EditCylindricalHField 11-36
Contents-22
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-23
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
AssignVoltageDropGroup 11-61
AssignVoltageGroup 11-61
AssignVolumeChargeDensity 11-62
AssignWindingGroup 11-62
EditCharge 11-63
EditCoilTerminal 11-64
EditCurrent 11-64
EditCurrentDensity 11-65
EditCurrentDensityTerminal 11-65
EditExternalCircuit 11-66
EditFloating 11-66
EditSink 11-66
EditVoltage 11-67
EditVoltageAPhi 11-68
EditVoltageDrop 11-69
EditVolumeChargeDensity 11-70
EditWindingGroup 11-70
SetCoreLoss 11-70
SetEddyEffect 11-71
SetMagnetizationCompute 11-72
SetMinimumTimeStep 11-73
ShowWindow 11-74
12 - Mesh Operations Module Script Commands 12-1
General Commands Recognized by the Mesh Operations Module 12-2
DeleteOp 12-2
GetOperationNames 12-3
RenameOp 12-3
Script Commands for Creating and Modifying Mesh Operations 12-4
AssignCylindricalGapOp 12-5
AssignDensityControlOp 12-8
Contents-24
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
AssignEdgeCutLayerOp 12-11
AssignLengthOp 12-12
AssignModelResolutionOp 12-15
AssignSkinDepthLayerSetting 12-17
AssignSkinDepthOp 12-18
AssignTrueSurfOp 12-19
EditCylindricalGapOp 12-22
EditDensityControlOp 12-24
EditEdgeCutLayerOp 12-26
EditLengthOp 12-27
EditModelResolutionOp 12-30
EditSkinDepthOp 12-31
EditTrueSurfOp 12-33
InitialMeshSettings 12-35
13 - Analysis Setup Module Script Commands 13-1
ClearLinkedData (Module) 13-2
CopySetup 13-2
DeleteSetups 13-3
EditSetup [Maxwell] 13-4
VB Example: 3D ElectricTransient EditSetup: 13-8
VB Example: 3D Transient EditSetup: 13-8
VB Example: 3D ACConduction EditSetup: 13-9
VB Example: 2D DCConduction EditSetup: 13-9
VB Example: 2D Transient EditSetup: 13-10
Python Example: Transient EditSetup: 13-11
ExportCircuit 13-12
ExportIcepak 13-17
ExportSolnData 13-17
GetSetupCount 13-19
GetSetups 13-19
Contents-25
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetSweepCount 13-20
GetSweeps 13-21
InsertSetup [Maxwell] 13-21
Example: 3D Magnetostatic solve setup: 13-24
Python Example: 3D EddyCurrent solve setup: 13-25
VB Example:3D EddyCurrent solve setup: 13-27
Example: 3D Transient solve setup: 13-29
Example: 3D Electrostatic solve setup 13-30
Example:3D DCConduction solve setup 13-30
Example: 3D ElectroDCConduction solve setup 13-31
Example: 3D ElectricTransient solve setup 13-31
VB Example: 3D ACConduction solve setup 13-31
Python Example:3D ACConduction solve setup 13-32
Example:2D Magnetostatic solve setup 13-33
Example:2D EddyCurrent solve setup 13-34
Example: 2D Transient solve setup 13-34
Example: 2D Electrostatic solve setup: 13-36
Example: 2D ACConduction solve setup: 13-36
Example: 2D DCConduction solve setup: 13-36
PasteSetup 13-37
PasteSweep 13-37
RenameSetup 13-38
ResetAllToTimeZero 13-38
ResetSetupToTimeZero 13-39
RevertAllToInitial 13-39
RevertAllToInitialTemperature 13-40
RevertSetupToInitial 13-41
RevertSetupToInitialTemperature 13-41
14 - Optimetrics Module Script Commands 14-1
General Commands Recognized by the Optimetrics Module 14-6
Contents-26
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
CopySetup 14-7
DeleteSetups [Optimetrics] 14-8
DistributedAnalyzeSetup 14-8
ExportDXConfigFile 14-9
ExportOptimetricsProfile 14-10
ExportOptimetricsResult 14-11
ExportParametricResults 14-12
GetSetupNames [Optimetrics] 14-13
GetSetupNamesByType [Optimetrics] 14-13
ImportSetup 14-14
PasteSetup [Optimetrics] 14-16
RenameSetup [Optimetrics] 14-16
SolveSetup [Optimetrics] 14-17
SolveAllSetup 14-18
Parametric Script Commands 14-18
EditSetup [Parametric] 14-19
ExportParametricSetupTable 14-19
GenerateVariationData [Parametric] 14-20
InsertSetup [Parametric] 14-21
Optimization Script Commands 14-28
EditSetup [Optimization] 14-28
InsertSetup [Optimization] 14-35
Sensitivity Script Commands 14-43
EditSetup [Sensitivity] 14-43
InsertSetup [Sensitivity] 14-50
Statistical Script Commands 14-54
EditSetup [Statistical] 14-54
InsertSetup [Statistical] 14-57
15 - Solutions Module Script Commands 15-1
DeleteSolutionVariation 15-1
Contents-27
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetValidISolutionList 15-2
16 - Field Overlays Module Script Commands 16-1
AddMarkerToPlot 16-2
CreateFieldPlot 16-4
Maxwell Field Line Trace Plot Examples 16-26
DeleteFieldPlot 16-36
EditSurfaceMeshSummaryData 16-36
ExportPlotImageWithViewToFile [Reporter] 16-40
ExportSurfaceMeshSummary 16-42
GetFieldPlotNames 16-43
ModifyFieldPlot 16-43
ModifyInceptionParameters 16-46
RenameFieldPlot 16-47
RenamePlotFolder 16-48
SetFieldPlotSettings 16-49
SetPlotFolderSettings 16-52
SetPlotsViewSolutionContext 16-57
UpdateAllFieldsPlots 16-58
UpdateQuantityFieldsPlots 16-59
17 - Fields Calculator Script Commands 17-1
AddNamedExpression 17-2
AddNamedExpr 17-3
CalcOp 17-4
CalcRead(deprecated) 17-4
CalculatorRead 17-5
CalcStack 17-6
CalculatorWrite 17-7
ChangeGeomSettings 17-8
ClcEval 17-9
ClcMaterial 17-10
Contents-28
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
ClearAllNamedExpr 17-11
CopyNamedExprToStack 17-11
DeleteNamedExpr 17-12
EnterComplex 17-13
EnterComplexVector 17-13
EnterLine 17-14
EnterPoint 17-15
EnterQty 17-16
EnterScalar 17-16
EnterScalarFunc 17-17
EnterSurf 17-18
EnterVector 17-18
EnterVectorFunc 17-19
EnterVol 17-20
ExportOnGrid [Fields Calculator] 17-20
ExportToFile [Fields Calculator] 17-23
GetTopEntryValue 17-26
LoadNamedExpressions 17-27
SaveNamedExpressions 17-28
18 - Motion Setup Script Commands A
DeleteMotionSetup A
ReassignMoving B
Commands to Create and Edit the Band B
AssignBand B
EditMotionSetup E
GetMotionSetupNames G
Other Commands Recognized By the ModelSetup Module G
GetSymmetryMultiplier H
SetSymmetryMultiplier H
19 - Parameter Setup Script Commands 19-1
Contents-29
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-30
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
UpdateAllDocuments 20-10
UpdateDocument 20-11
ViewHtmlDocument 20-12
ViewPdfDocument 20-13
Explication of a Sample UDD Script 20-13
Example Python Script: Defining a Document 20-15
21 - User Defined Solutions Commands 21-1
CreateUserDefinedSolution 21-1
DeleteUserDefinedSolutions 21-3
EditUserDefinedSolution 21-4
22 - Network Data Explorer Script Commands 22-1
AddDiffPair 22-4
Cascade (SPISim) 22-5
ClearDiffPairs 22-6
Clone 22-7
Close 22-8
Combine (SPISim) 22-9
Deembed (SPISim) 22-10
DeembedBack (SPISim) 22-11
DeembedFront (SPISim) 22-13
DisableDiffPairs 22-14
EnableDiffPairs 22-15
ExportCitiFile 22-16
ExportMatlab 22-18
ExportSpreadsheet 22-20
ExportTouchstone 22-22
ExportTouchstone2 22-24
Extract (SPISim) 22-27
GetFrequencies 22-28
GetFrequencyCount 22-29
Contents-31
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetName 22-30
GetPortCount 22-30
GetPortNumber 22-31
GetPostProcSettings 22-32
GetVariation 22-33
HasSameData 22-34
LoadSolution 22-36
Open 22-37
Rename (SPISim) 22-38
Renormalize (SPISim) 22-39
Reorder 22-41
Reorder (SPISim) 22-42
Reset 22-43
SetAllPortImpedances 22-44
SetPortDeembedDistance 22-45
SetPortImpedance 22-46
SetPostProcSettings 22-47
Smooth 22-48
Stretch (SPISim) 22-49
Terminate 22-51
23 - CompInstance Script Commands 23-1
Callback Scripting Using CompInstance Object 23-1
CompInstance Functions 23-2
GetComponentName 23-2
GetInstanceID [Component Instance] 23-3
GetInstanceName [Component Instance] 23-4
GetParentDesign 23-4
GetPropHost 23-5
GetPropServerName 23-5
24 - Schematic Scripting 24-1
Contents-32
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-33
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-34
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-35
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-36
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-37
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-38
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-39
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-40
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-41
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Contents-42
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell 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.
l PyAEDT (Beta) – a Python library that interacts directly with the AEDT API to make script-
ing simpler for the end user.
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.
Comparison Operators
Following is a list of VBScript’s comparison operators:
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
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:
Select Case primitive_name
Case "Box1"
<statements to execute>
Case "Cylinder1"
<statements to execute>
Case Else
<statements to execute>
End Select
Looping Through Code
Looping allows you to run a group of statements repeatedly. There are two types of loops:
l For...Next: Uses a counter to run statements a specified number of times.
l Do...Loop: Loops while or until a condition is True.
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
Repeating a Statement Until a Condition Becomes True
Following is the syntax:
Do Until condition
<statements to execute>
Loop
You can exit early from a loop by using the Exit For statement.
VBScript Procedures
In VBScript, there are two kinds of procedures, Sub and Function. These procedures are called
by name, they can receive arguments, and each performs a specific task with a group of
VBScript statements. If there is no argument, then the Sub or Function statement must include
an empty set of parentheses.
Function Procedures
A Function returns a value by assigning a value to its name in one or more statements. Following
is the syntax of a Function:
Function FunctionName([arguments])
<Function statements>
End Function
Sub Procedures
A Sub procedure is like a function procedure, except that it does not return a value through its
name. Following is the syntax of a Sub:
Sub ProcedureName([arguments])
<Procedure statements>
End Sub
Converting Between Data Types
To convert data from one subtype to another, use the following VBScript functions:
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:
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
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 con-
sult Python documentation for additional information.
Comments
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 Maxwell -runscript someScript.py to keep Maxwell GUI open after completing script
execution.
o Maxwell -features=beta -ng -runscriptandexit someScript.py to run Maxwell in a
non-graphical mode and exit after script completion. Note that this is a beta feature.
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
communicates with the desktop, and they come in four flavors addressed in the following sub-
topics:
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\v241\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\v241\Win64")
sys.path.append(r"C:\Program Files\An-
sysEM\v241\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
Introduction to CPython
An Ansys Electronics Desktop 2024R1 feature allows CPython to be used for standalone script-
ing, as an alternative to IronPython, to:
l Launch Ansys Electronics Desktop (InitializeNew)
l Connect with a running instance of Ansys Electronics Desktop (Initialize)
l Execute Ansys Electronics Desktop script functions
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.
CPython Script Engine and ansysedt process are comunicated using GRPC, the ansysedt pro-
cess started as GRPC server, the Script Script Engine acted as the GRPC clinet.
Important:
Connect() to an opened project in remote machine needs to use a share network path.
Connect Functions:
1. Connect(projectPath)
Example:
import sys
sys.path.append(r"<InstallationPath>/PythonFiles/DesktopPlugin")
import ScriptEnv
ScriptEnv.Connect(r”c:\myProjects\Project1.aedt”)
oProject = oDesktop.GetActiveProject()
print(oProject.GetName())
Note:
InitializeNew() will always launch a new instance of Electronics Desktop. Please use Ini-
tialize() to connect to an existing instance. See below.
-grpcsrv Flag
This flag will launch the application in a mode where the executable serves as a scripting server
that can be used for CPython scripting in conjunction with the CPython stand alone scripting
instructions that were mentioned earlier. The
-ng flag can be combined with -grpcsrv.
On Windows:
ansysedt.exe -grpcsrv <optional port number>.
On Linux:
ansysedt -grpcsrv <optional port number>.
If the port number is omitted, the default of 50051 will be used.
With -grpcsrv, a message will be displayed in the Messages window indicating that the server
was started. If the requested port is in use by another application, starting the sever may fail.
Related Topics:
Consult the following for details about script commands recognized by oDesktop:
l Desktop Object Script Commands.
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
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:
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:
l Analysis Module Script Commands
l Boundary and Excitation Module Script Commands
l Field Overlays Module Script Commands
l Mesh Operations Module Script Commands
l Optimetrics Module Script Commands
l Radiation Module Script Commands
l Reduce Matrix Module Script Commands
l Solutions Module Script Commands
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.
In Iron Python, the command line parameter following -scriptargs is passed without modi-
fication as a single string in the ScriptArgument python variable.
In VBscript, the command line parameter following -scriptargs is split into multiple strings
and converted to a VBscript collection which is accessible via the AnsoftScript.Arguments
collection. To access these arguments, for example:
msgbox AnsoftScript.Arguments(0) // Returns 'hello'
msgbox AnsoftScript.Arguments(1) // Returns 'there'
For more information about running a script from the command line, consult the Maxwell help
topic "Running Maxwell from the Command Line".
Direct Launch
If you run a script directly from the command line without launching Electronics Desktop, script
arguments will be in the WSH.arguments collection instead of the AnsoftScriptHost.ar-
guments collection. The following script ensures the arguments are accessed regardless of the
collection in which they reside:
on error resume next
dim args
Set args = AnsoftScript.arguments
if(IsEmpty(args)) then
Set args = WSH.arguments
End if
on error goto 0
// At this point, args has the arguments 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:
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.
If the full path to the script is not specified, Electronics Desktop searches for the specified script
in the following locations, in order:
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
l Event Callback Scripting
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.
Object-Oriented Scripting
There are five basic functions in object-oriented scripting for retrieving and setting 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
Example: GetPropNames and GetPropValues for Layered Impedance Boundary Script
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']
AddMaterial
AnalyzeAll
ChangeProperty
ClearMessages
CloneMaterial
Close
CopyDesign
CutDesign
DeleteDesign
DeleteToolObject
EditMaterial
ExportMaterial
GetActiveDesign
GetArrayVariables
GetChildNames [Project]
GetChildObject [Project]
GetChildTypes [Project]
GetConfigurableData
GetDefinitionManager
GetDependentFiles
GetDesign
GetDesign
GetDesigns
GetEDBHandle
GetLegacyName
GetName [Project]
GetObjPath [Project]
GetPath
GetPropEvaluatedValue
GetPropNames [Project]
GetPropSIValue
GetPropValue [Project]
GetProperties
GetPropertyValue
GetTopDesignList
GetVariableValue
GetVariables
InsertDesign
InsertDesign (PlanarEM)
InsertDesignWithWorkflow
InsertToolObject
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
ClearMessages
Clears information in the Messages window.
Note:
Additional options are available when using the Desktop-level ClearMessages command.
UI Access N/A
Parameters None.
VB Syntax ClearMessages
VB Example oProject.ClearMessages
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.
DeleteDesign
Deletes a specified design in the project.
DeleteToolObject
Note:
This command is for internal Ansys use only.
UI Access N/A
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
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
Use: Returns the specified design.
Command: None
Syntax: GetDesign <DesignName>
Return Value: The specified design.
Parameters: <DesignName>
Type: <string>
Name of the design to return.
VB Example: Set oDesign = oProject.GetDesign ("Maxwell3DDesign1")
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
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
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
InsertDesign
Inserts a new design in the project. For Maxwell scripts, the last argument will always be empty.
UI Access Project > [Insert Maxwell 3D Design / Insert Maxwell 2D Design / Insert RMxprt Design].
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
Rename
Renames the project and saves it. Similar to SaveAs().
RestoreProjectArchive
Restores a previously archived project to a specified path.
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
oProject.SetActiveDefinitionEditor "SymbolEditor",_
VB Example
"Simplorer Elements\Basic Elements\Circuit\Passive Elements:R"
SetActiveDesign
Sets a design to be the active design.
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
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()
GetApp
Obtains the product application object.
UI Access NA
VB Syntax GetApp(<productname>)
Dim oHFSSApp
VB Example
oHFSSApp = oAnsoftApp.GetApp("HFSS")
3-4
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetActiveScheduler
GetActiveSchedulerInfo
GetAutoSaveEnabled
GetBuildDateTimeString
GetCustomMenuSet
GetDefaultUnit
GetDesktopConfiguration
GetDistributedAnalysisMachines
GetDistributedAnalysisMachinesForDesignType
GetExeDir
GetFullGeometry
GetGDIObjectCount
GetGrpcServerPort
GetHashcode
GetIsGrpcServer
GetIsNongraphical
GetLibraryDirectory
GetLocalizationHelper
GetMessages
GetMonitorData
GetPersonalLibDirectory
GetProcessID
GetProjectDirectory
GetProjectList
GetProjects
GetRegistryInt
GetRegistryString
GetRunningInstancesMgr
GetSchematicEnvironment
GetScriptingToolsHelper
GetSysLibDirectory
GetTempDirectory
GetTool
GetUserLibDirectory
GetVersion
IsFeatureEnabled
KeepDesktopResponsive
LaunchJobMonitor
NewProject
OpenAndConvertProject
OpenMultipleProjects
OpenProject
OpenProjectWithConversion
PageSetup
PauseRecording
PauseScript
Print
QuitApplication
RefreshJobMonitor
RefreshToolkitUI
ResetLogging
RestoreProjectArchive
RestoreWindow
ResumeRecording
RunACTWizardScript
RunProgram
RunScript
RunScriptWithArguments
SelectScheduler
SetActiveProject
SetActiveProjectByPath
SetCustomMenuSet
SetDesktopConfiguration
SetLibraryDirectory
SetProjectDirectory
SetRegistryFromFile
SetRegistryInt
SetRegistryString
SetSchematicEnvironment
SetTempDirectory
ShowDockingWindow
Sleep
StopSimulations
SubmitJob
TileWindows
WaitForSimulationsToBeDone
Related Topics:
AddMessage
Add a message with severity and context to message window.
UI Access N/A
ClearMessages
For a specified project and design, this command clears all messages in a specified severity range. The user-specified integral sever-
ity level is interpreted as:
0 => info, 1 => warning, 2 => error, and 3 => fatal error.
The ClearMessages function accepts four input arguments. The first two specifies project and design, respectively. This function
clears messages in the range specified by the third (interpreted as start severity) and fourth (interpreted as stop severity) arguments.
The fourth argument has a default value of 0. The last two arguments need not be specified in any given order, i.e., they can indicate
either ascending or descendingtrend. The function clears all messages having severity level within this specified range. The start and
stop severity need not be specified in any given order (i.e., they can indicate either ascending or descending severity).
UI Access In Message Manager, right-click and select Clear messages for [ProjectName]...
<stopSeverity> Integer Optional. User-specified stop severity level until which messages will be
cleared.
l 0 = informational
l 1 = warning
l 2 = error
l 3 = fatal error
sages
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor", "Maxwell3DDesign1", 0,
1)
# startSeverity = 0 and stopSeverity = 2; clears all the Info, Warning, and Error
messages
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor", "Maxwell3DDesign1", 0,
2)
# startSeverity = 0 and stopSeverity = 3; clears all the Info, Warning, Error,
and Fatal messages
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor", "Maxwell3DDesign1", 0,
3)
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor","Maxwell3DDesign1",2)
# startSeverity = 2 and stopSeverity = 2; clears all the Error messages
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor","Maxwell3DDesign1",2, 2)
# startSeverity = 2 and stopSeverity = 3; clears all the Error and Fatal messages
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor","Maxwell3DDesign1",2, 3)
# startSeverity = 2 and stopSeverity = 0; clears all the Info, Warning, and Error
messages
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor","Maxwell3DDesign1",2, 0)
# startSeverity = 3; clears all the Info, Warning, Error, and Fatal messages;
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor","Maxwell3DDesign1",3)
# startSeverity = 3 and stopSeverity = 3; clears all the Fatal error messages
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor","Maxwell3DDesign1",3, 3)
# startSeverity = 3 and stopSeverity = 0; clears all the Info, Warning, Error,
and Fatal messages
oDesktop.ClearMessages("Ex_EC_1_Asymmetrical_Conductor","Maxwell3DDesign1",3, 0)
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.
oDesktop.CloseProjectNoForce("MyProject")
Python Example
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
Dim oAnsoftApp
Dim oDesktop
VB Example 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.
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
GetAutoSaveEnabled
Checks whether the autosave feature is enabled.
UI Access N/A
Parameters None.
Integer:
Return Value
l 1 – Autosave is 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
VB Example dnt = oDesktop.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.
UI Access Tools > Options > General Options > Default Units. Note that this menu only displays units that can be
changed, while the script can be used to view additional default units.
l "MagneticReluctance"
l "Mass"
l "MassFlowRate"
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").
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
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
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/v241/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
GetName [Desktop]
Gets names of queried projects or designs obtained by GetProjects() and GetDesigns() commands. See the example query.
UI Access N/A
Parameters N-
o-
Return Value String containing name.
n-
e-
.
VB Syntax GetName()
--------------------------------------------------------------
In this example, message box returns project name. projects(0) is the first of
the several projects. Similarly projects(1) displays name of second project
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
set projects = oDesktop.GetProjects()
project_name = projects(0).GetName()
msgbox(project_name)
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
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
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
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
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.
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
ImportANF
Imports an ANF file into a new project. For older ANFv2 files, use ImportANFv2.
ImportAutoCAD
Imports an AutoCAD file into a new project.
ImportGDSII
Imports a GDSII file into a new project.
<propertyFileName> String Optional. Full path to property mapping file. Pass empty string if none.
ImportODB
Imports an ODB++ file into a new project.
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.
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.
VB Syntax Paste
VB Example oProject.Paste
VB Syntax Paste
VB Example oProject.Paste
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.
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.
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.
Parameters
l 'EM'
l 'RF'
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
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.
<design (optional)> String Name of the design to use for batch solve.
<setup (optional)> String Name of the specific setup to solve.
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 Maxwell.
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).
oDesktop.SetRegistryFromFile("f:\\temp\\test.acf")
oDesktop.SetRegistryString("Desktop/ActiveDSOConfigurations/Maxwell", "test")
UI Access N/A
VB Syntax DoesRegistryValueExist(<KeyName>)
VB Example bExist = oDesktop.DoesRegistryValueExist("Desktop/ActiveDSOConfigurations/Maxwell")
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
VB Syn- GetRegistryInt(<KeyName>)
tax
VB num = oDesktop.GetRegistryInt("Desktop/Settings/ProjectOptions/Maxwell/Up-
Exampl- dateReportsDynamicallyOnEdits")
e
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/Maxwell")
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/Maxwell/Up-
Example dateReportsDynamicallyOnEdits', 0)
VB oDesktop.SetRegistryInt "Desktop/Settings/ProjectOptions/Maxwell/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.
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()
5-4
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell 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>
GetProperties
GetPropertyValue
GetVariables
GetVariableValue
SetPropertyValue
SetVariableValue
Example Use of Record Script and Edit Properties
Additional Property Scripting Example
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.
Array("Name:<PropTab>",
<PropServersArray>,
<NewPropsArray>,
<ChangedPropsArray>,
<DeletedPropsArray>)
<PropServersArray>
Array("Name:PropServers", <PropServer>,
<PropServer>, ...)
<NewPropsArray>
Array("Name:NewProps", <PropDataArray>,
<PropDataArray>,...)
<ChangedPropsArray>
Array("Name:ChangedProps",<PropDataArray>,
<PropDataArray>, ...)
<DeletedPropsArray>
Array("Name:DeletedProps", <PropName>,
<PropName>, ...)
<PropDataArray>
Array("NAME:<PropName>",
"PropType:=", <PropType>,
"NewName:=", <string>,
"Description:=", <string>,
"NewRowPosition:=", <int>,
"ReadOnly:=", <bool>,
"Hidden:=", <bool>,
<PropTypeSpecificArgs>)
<PropType>
Type: string
Identifies the type of property when a new property is added. In HFSS 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 variables
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
High cut-off for the distribution.
Tol
Tolerance for uniform distributions. Format is "<int>%".
Example: "20%".
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"), _
Array("NAME:ChangedProps", Array("NAME:Company Name", _
"Value:=", "My Company"))))
oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:Header", _
Array("NAME:PropServers", "XY Plot1:Header"), _
Array("NAME:ChangedProps", Array("NAME:Design Name", _
"Value:=", "WG Combiner"))))
oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:General", _
Array("NAME:PropServers", "XY Plot1:General"), _
Array("NAME:ChangedProps", Array("NAME:Back Color", _
"R:=", 128, "G:=", 255, "B:=", 255))))
oModule.ChangeProperty Array("NAME:AllTabs", Array("NAME:Axis", _
Array("NAME:PropServers", "XY Plot1:AxisX"), _
Array("NAME:ChangedProps", Array("NAME:Axis Scaling", _
"Value:=", "Log"))))
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 variables,
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 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
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.
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
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
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
6-34
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
AnalyzeAll (Maxwell)
AnalyzeDistributed
ApplyMeshOps
ClearLinkedData
ConfigureFluentConductivityCoupling
ConstructVariationString
Create3DDesign
DeleteFieldVariation
DeleteFullVariation
DeleteLinkedDataVariation
EditNotes
EnableHarmonicForceCalculation
ExportArrayMetadata
ExportConvergence
ExportElementBasedHarmonicForce
ExportHarmonicTransientForce
ExportMatrixData
ExportMeshStats
ExportProfile
ExportReport
GenerateMesh
GetActiveEditor
GetAllPorts
GetChildNames [Design]
GetChildObject [Design]
GetChildTypes [Design]
GetConfigurableData
GetData
GetDesignName
GetDesignType
GetDesignValidationInfo
GetGeometryMode
GetManagedFilesPath
GetModule
GetName
GetNominalVariation
GetNoteText
GetPostProcessingVariables
GetPropNames [Design]
GetPropValue [Design]
GetSelections
GetSolutionType
InitializeSystemCoupling
Is2D
Is3D
PasteDesign
Redo
RenameDesignInstance
RenameSource
RunToolkit
SetActiveEditor
SetConductivityThreshold
SetDesignSettings (Maxwell)
SetFastTransformationForLayoutComponent
SetObjectDeformation
SetObjectTemperature
SetPropValue [Design]
SetPropertyValue
SetShowLayoutForLayoutComponent
SetSolutionType (Maxwell)
Solve
StartAnalysis
StopSimLink
Undo
ValidateCircuit
ValidateDesign
ValidateLink
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")
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
UI Access Click Maxwell > Analyze All, or right-click a design instance in the project tree and select Analyze All.
Parameters None.
Return Value None.
VB Syntax AnalyzeAll
VB Example oDesign.AnalyzeAll
AnalyzeDistributed
Performs a distributed analysis.
UI Access N/A
Integer value:
Return Value l 0 – Success
l Else – Error
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
ConfigureFluentConductivityCoupling
Use: Configures the directory for the conductivity coupling between a Maxwell 3D magnetostatic design and Ansys Fluent.
Command: Right-click on the solution setup under Analysis in the project tree and choose Configure Fluent Conductivity Coupling.
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.
CreateParametricCircuit
Note:
This command is for internal Ansys use only.
Create3DDesign [Maxwell]
Use: Create a Maxwell 3D design from a Maxwell 2D design.
Command: Click Maxwell2D>Create 3D Design, or right-click a Maxwell 2D design instance in the project tree and select Create 3D
Design.
Syntax: Create3DDesign <DesignSettingsArray>
Return Value: None
Parameters: <DesignSettingsArray>
For a 2D design in "Cartesian, XY" geometry mode:
Array("NAME:Parameters",
"ZLength:=", <value>,
"PararmetrizeZLength:=", <bool>,
For a 2D design in "Cylindrical about Z" geometry mode:
Array("NAME:Parameters",
"SweepAngle:=", <value>,
"PararmetrizeSweepAngle:=", <bool>,
"DraftAngle:=", <value>,
"DraftType:=", <string>, (one of: "Extended", "Round", "Natural")
"NumberOfSegments:=", <integer>)
Example:
For a 2D design in "Cartesian, XY" geometry mode:
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.
DeleteVariation
Deletes a variation.
Important:
EditNotes
Updates the notes for the design.
EnableHarmonicForceCalculation
This command sets the objects for harmonic force calculation. It is used only for Maxwell designs opened in the Ansys Workbench
environment, and therefore the commands are only available for Maxwell designs opened in Ansys Workbench.
Maxwell 3D > Enable Harmonic Force Calculation, Maxwell 2D > Enable Harmonic Force Calculation, or
UI Access
right-click a design instance in the project tree and select Enable Harmonic Force Calculation
"EnabledObjects:=" , ["Cylinder1"],
"ForceType:=" , 0,
"WindowFunctionType:=" , "Rectangular",
"NumberOfRepeatedSamples:=", "1",
"UseNumberOfLastCycles:=", True,
"NumberOfLastCycles:=" , 1,
"StartTime:=" , "0s",
"UseNumberOfCyclesForStopTime:=", True,
"NumberOfCyclesForStopTime:=", 1,
"StopTime:=" , "0.01s",
"OutputFreqRangeType:=" , "Use All",
"CaculateForceType:=" , "Harmonic Force",
"EnableInverterFeedback:=", True,
"SwitchingFrequency:=" , "4000Hz",
"MaximumFrequency:=" , "8000Hz"
])
Example 3: Sample script for setting OutputFreqRangeType to "Use Range".
oDesign.EnableHarmonicForceCalculation(
[
"EnabledObjects:=" , ["Cylinder1","Cylinder2"],
"ForceType:=" , 0,
"WindowFunctionType:=" , "Rectangular",
"NumberOfRepeatedSamples:=", "1",
"UseNumberOfLastCycles:=", False,
"NumberOfLastCycles:=" , 1,
"StartTime:=" , "0s",
"UseNumberOfCyclesForStopTime:=", False,
"NumberOfCyclesForStopTime:=", 1,
"StopTime:=" , "0.01s",
"OutputFreqRangeStart:=" , "1Hz",
"OutputFreqRangeStop:=" , "3Hz",
"OutputFreqRangeType:=" , "Use Range"
])
Python Example 4: Sample script for setting OutputFreqRangeType to "Use Number".
oDesign.EnableHarmonicForceCalculation(
[
"EnabledObjects:=" , ["Cylinder1","Cylinder2"],
"ForceType:=" , 0,
"WindowFunctionType:=" , "Rectangular",
"NumberOfRepeatedSamples:=", "1",
"UseNumberOfLastCycles:=", False,
"NumberOfLastCycles:=" , 1,
"StartTime:=" , "0s",
"UseNumberOfCyclesForStopTime:=", False,
"NumberOfCyclesForStopTime:=", 1,
"StopTime:=" , "0.01s",
"OutputFreqRangeStart:=" , "1Hz",
"OutputFreqRangeNum:=" , "43",
"OutputFreqRangeType:=" , "Use Number"
])
Python Example 5: Sample script for setting OutputFreqRangeType to "Use All".
oDesign.EnableHarmonicForceCalculation(
[
"EnabledObjects:=" , ["Cylinder1","Cylinder2"],
"ForceType:=" , 0,
"WindowFunctionType:=" , "Rectangular",
"NumberOfRepeatedSamples:=", "1",
"UseNumberOfLastCycles:=", False,
"NumberOfLastCycles:=" , 1,
"StartTime:=" , "0s",
"UseNumberOfCyclesForStopTime:=", False,
"NumberOfCyclesForStopTime:=", 1,
"StopTime:=" , "0.01s",
" OutputFreqRangeType:=" , "Use All"
])
Python Example 6: Sample script for setting layout force nets and layers sets.
oDesign.EnableHarmonicForceCalculation(
[
"ForceType:=" , 0,
"WindowFunctionType:=" , "Rectangular",
"NumberOfRepeatedSamples:=", "1",
"UseNumberOfLastCycles:=", True,
"NumberOfLastCycles:=" , 1,
"StartTime:=" , "0s",
"UseNumberOfCyclesForStopTime:=", True,
"NumberOfCyclesForStopTime:=", 1,
"StopTime:=" , "0.01s",
"OutputFreqRangeType:=" , "Use All",
"CaculateForceType:=" , "Harmonic Force",
[
"NAME:NetsAndLayersChoices",
[
"NAME:LC1_1",
[
"NAME:NetLayerSetMap",
[
"NAME:net1",
"LayerSet:=" , ["Top"]
],
[
"NAME:net2",
"LayerSet:=" , ["Top"]
]
]
]
]
])
```
putFreqRangeNum>, <CalculateForceType>,<EnableInverterFeedback>,<MaximumFrequency>)
VB Example 1: Sample script for setting EnableHarmonicForceCalculation options for a 2D
Transient design with element based force type.
oDesign.EnableHarmonicForceCalculation Array(
"EnabledObjects:=", Array("Rectangle1", "Rectangle2"),
"ForceType:=", 2,
"NumberOfRepeatedWindows:=", 3,
"UseNumberOfLastCycles:=", true,
"NumberOfLastCycles:=", 1,
"StartTime:=", "0s",
"UseNumberOfCyclesForStopTime:=", true,
VB
Exa- "NumberOfCyclesForStopTime:=", 1, "StopTime:=", "0.01s",
mpl-
e "WindowFunctionType:=", "Rectangular")
Example 2: Sample Workbench script for setting EnableHarmonicForceCalculation options.
SetScriptVersion(Version="16.0")
system1 = GetSystem(Name="Maxwell2DDesign3")
Ansoft.EditSystem(System=system1)
string1 = Ansoft.ExecuteGenericDesktopCommand(
System=system1,
CommandClass="WB_ACTIVATE_GIVEN_SYSTEMID",
Argument="Maxwell",
ExecuteOnlyIfSystemIsAlreadyOpenInDesktop=True)
system1.SendAnsoftCommand(PyCommand="""oDesktop.SetActiveProject(\"test_project_from_
CADFEM\").SetActiveDesign(\"Maxwell2DDesign3\").EnableHarmonicForceCalculation(
[
\"EnabledObjects:=\ ", [\"IntegLine_0\",\"IntegLine_0_1\"],
\"UseNumberOfLastCycles:=\", False,
\"NumberOfLastCycles:=\ ", 2,
\"StartTime:=\ ", \"0.002s\",
\"UseNumberOfCyclesForStopTime:=\", False,
\"NumberOfCyclesForStopTime:=\", 2,
\"StopTime:=\ ", \"0.003s\"
\"WindowFunctionType:=\ ", \"Rectangular\"
])""")
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.
ExportElementBasedHarmonicForce
Exports a element-based harmonic force data to a .csv file.
ExportHarmonicTransientForce
Exports harmonic force solution data from transient designs for use by Ansys Motion and third-party software.
Parameters l UNV
l Romax
l LMS
l Ansys Motion
Ansys Mechanical
l
<Para- string The name of the parametric setup whose solution data is to be exported
metricSetupName>
<ExportDirectory> string The path for the exported files
<SolverSetupName> string The name of the design setup whose solution data is to be exported. If no solu-
tion setup is specified, all solve setups under the specified parametric setup
will be exported.
<ExportTimeOption> integer Export time steps: 0 for All steps, 1 for Steps from end, 2 for Range of steps.
<ExportBeginStep> integer Integer value for begin step, only valid for ExportTimeOption: Range of steps
<ExportEndStep> integer Integer value for end step, only valid for ExportTimeOption: Range of steps
ExportMeshStats
Exports mesh statistics to a file.
UI Access N/A
ExportProfile
Exports a solution profile to file.
UI Access N/A
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.
GetDesignValidationInfo
Copies a validation cache file that is generated by oDesign.ValidateDesign() or doing design validation from UI to a file. This file con-
tains more information besides messages. It also has validation results of some validation check items.
If there is no validation cache file, a file won't be generated. This happens if GetDesignValidationInfo is executed and no Val-
idateDesign was performed.
UI Access NA
Integer
Return Value 0 if invalid
1 if valid
GetGeometryMode
Returns the geometry mode for the design. For Maxwell 2D only.
UI Access N/A
String
Return Value "XY" if design is "Cartesian, XY"
"about Z" if design is "Cylindrical about Z"
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
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
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
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
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
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.
InitializeSystemCoupling
Used for system coupling workflow.
Note:
This command is for internal Ansys use only.
If you have a SystemCouplingSetupn under Optimetrics and you right-click and select Generation Configuration Files, a
system coupling configuration (.sp) file and .a py file are generated automatically. The .py file contains this line oDesign.Ini-
tializeSystemCoupling("Optimetrics:SystemCouplingSetupn") and must be preserved.
Is2D
Use: Determines whether the current design is 2D.
Command: None
Syntax: Is2D
Return Value: Boolean
True if the design is 2D.
Parameters: None
Example: oDesign.Is2D
Is3D
Use: Determines whether the current design is 3D.
Command: None
Syntax: Is3D
Return Value: Boolean
True if the design is 3D.
Parameters: None
Example: oDesign.Is3D
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.
ResetToTimeZero
Resets a simulation to time zero.
SetActiveEditor
Sets the active editor.
UI Access N/A.
SetConductivityThreshold
Use: Sets the thresholds for a perfect conductor and an insulator/conductor.
Command: Maxwell>Set Material Thresholds or right click on design instance in project tree and choose "Set Material
Thresholds"
Syntax:SetConductivityThreshold <PerfectConductorThreshold> <Insulator/ConductorThreshold>
Return Value: None
Parameters: <PerfectConductorThreshold>
Type: <double>
Perfect conductor threshold
<Insulator/ConductorThreshold>
Type: <double>
Insulator/conductor threshold
Example: oDesign.SetConductivityThreshold 1E+030, 1.00
SetDesignSettings [Maxwell]
Use: Sets design settings for the active design. Settings vary with solution type.
Command: Click Maxwell 3D > Design Settings, Maxwell 2D > Design Settings, or right-click a design instance in the project tree
and select Design Settings.
Syntax:SetDesignSettings <DesignSettingsArray>
Return Value: None.
Parameters: <DesignSettingsArray>
For 3D Transient solution type:
Array("NAME:Design Settings Data",
"SkipIntersectionChecks:=", <bool>
Example:
oDesign.SetDesignSettings(
[
"NAME:Design Settings Data",
"Allow Material Override:=", True,
"Perform Minimal validation:=", False,
"EnabledObjects:=" , [],
"PreserveTranSolnAfterDatasetEdit:=", True,
"ComputeTransientInductance:=", True,
"ComputeIncrementalMatrix:=", False,
"PerfectConductorThreshold:=", 1E+30,
"InsulatorThreshold:=" , 2500000,
"UseSkewModel:=" , False,
"EnableTranTranLinkWithSimplorer:=", False,
"SolveFraction:=" , True,
"FractionNumber:=" , "4",
"HalfPeriodicField:=" , True,
"HalfAxialGeometry:=" , True
"SkipMeshChecks:=" , False
],
[
"NAME:Model Validation Settings",
"EntityCheckLevel:=" , "Strict",
"IgnoreUnclassifiedObjects:=", True,
"SkipIntersectionChecks:=", False
])
For 3D Magnetostatic solution type:
Array("NAME:Design Settings Data",
"Allow Material Override:=", <bool>,
"ComputeIncrementalMatrix:=", <bool>,
"PerfectConductorThreshold:=", <real>,
"InsulatorThreshold:=", <real>,
"SkipMeshChecks:=" , <bool>)
For 3D Eddy Current solution type:
Array("NAME:Design Settings Data",
"Allow Material Override:=", <bool>,
"PerfectConductorThreshold:=", <real>,
"InsulatorThreshold:=", <real>,
"SymmetryMultiplier=", <real>,
"SkipMeshChecks:=" , <bool>)
"PerfectConductorThreshold:=", <real>,
"InsulatorThreshold:=", <real>,
"SkipMeshChecks:=" , <bool>)
For 2D Transient solution type:
Array("NAME:Design Settings Data",
"PreserveTranSolnAfterDatasetEdit:=", <bool>,
"ComputeTransientInductance:=", <bool>,
"PerfectConductorThreshold:=", <real>,
"InsulatorThreshold:=", <real>,
"ModelDepth:=", <real>,
"UseSkewModel:=", <bool>,
"SkewModelType:=", <string>
//possible values are: "Continuous", "Step", "V-Shape", "User Defined"
"SkewPart:=", <string>
//possible values are: "Stator", "Rotor"
"SkewAngle:=", <real>,
//for "Continuous", "Step", "V-Shape" model types only
"SkewAngleUnit:=", <string>,
//for "User Defined" model type only; possible values are: "rad", "degsec", "degmin", "deg"
"NumberOfSlices:=", <int>,
//SkewSliceTable array below is for skew model type "User Defined" only.
Array("NAME:SkewSliceTable",
Array("NAME:OneSliceInfo", "SkewAngle:=", <real>, "SliceLength:=", <real>,
...
Array("NAME:OneSliceInfo", "SkewAngle:=", <real>, "SliceLength:=", <real>,))
"EnableTranTranLinkWithSimplorer:=", <bool>,
"BackgroundMaterialName:=", <string>
"Multiplier:=", <int>)
For 2D Magnetostatic solution type:
Array("NAME:Design Settings Data",
"PerfectConductorThreshold:=", <real>,
"InsulatorThreshold:=", <real>,
"ModelDepth:=", <real>,
"ComputeIncrementalMatrix:=", <bool>,
"BackgroundMaterialName:=", <string>)
For 2D Eddy Current, Electrostatic, DC Conduction, and AC Conduction solution types:
Array("NAME:Design Settings Data",
"PerfectConductorThreshold:=", <real>,
"InsulatorThreshold:=", <real>,
"SymmetryMultiplier:=", <int>,
"ModelDepth:=", <real>,
"BackgroundMaterialName:=", <string>)
For all solution types:
Array("NAME:Validation Options",
"EntityCheckLevel:=", "Strict",
//possible values are: Strict, Basic, Warning Only, None
"IgnoreUnclassifiedObjects:=", <bool>,
"SkipIntersectionChecks:=", <bool>),
"Design Validation Settings:=", "Perform full validations"
//possible values are: Perform full validations, Perform minimal validations
Example: oDesign.SetDesignSettings(
[
"NAME:Design Settings Data",
"Perform Minimal validation:=", False,
"EnabledObjects:=" , [],
"PreserveTranSolnAfterDatasetEdit:=", False,
"ComputeTransientInductance:=", False,
"ComputeIncrementalMatrix:=", False,
"PerfectConductorThreshold:=", 1E+30,
"InsulatorThreshold:=" , 1,
"ModelDepth:=" , "1mm",
"UseSkewModel:=" , True,
"SkewModelType:=" , 0,
"SkewAngle:=" , "6deg",
"NumberOfSlices:=" , "5",
"EnableTranTranLinkWithSimplorer:=", False,
"BackgroundMaterialName:=", "vacuum",
"Multiplier:=" , "fractions"
],
[
"NAME:Model Validation Settings",
"EntityCheckLevel:=" , "Strict",
"IgnoreUnclassifiedObjects:=", True,
"SkipIntersectionChecks:=", False
])
"EnabledObjects:=" , [],
"PreserveTranSolnAfterDatasetEdit:=", False,
"ComputeTransientInductance:=", False,
"ComputeIncrementalMatrix:=", False,
"PerfectConductorThreshold:=", 1E+30,
"InsulatorThreshold:=" , 1,
"ModelDepth:=" , "1meter",
"UseSkewModel:=" , True,
"SkewType:=" , "Continuous",
"SkewPart:=" , "Stator",
"SkewAngle:=" , "5deg",
"NumberOfSlices:=" , "3",
"EnableTranTranLinkWithSimplorer:=", False,
"BackgroundMaterialName:=", "vacuum",
"SolveFraction:=" , False,
"Multiplier:=" , "1"
]
oDesign.SetDesignSettings(
[
…
"SkewType:=" , "Step",
"SkewPart:=" , "Stator",
"SkewAngle:=" , "0.6rad",
"NumberOfSlices:=" , "2",
…
]
oDesign.SetDesignSettings(
[
…
"SkewType:=" , "V-Shape",
"SkewPart:=" , "Rotor",
"SkewAngle:=" , "5deg",
"NumberOfSlices:=" , "7",
…
]
oDesign.SetDesignSettings(
[
..
"SkewType:=" , "User Defined",
"SkewPart:=" , "Rotor",
"SkewAngleUnit:=" , "deg",
"NumberOfSlices:=" , "4",
[
"NAME:SkewSliceTable",
[
"NAME:OneSliceInfo",
"SkewAngle:=" , 0.6,
"SliceLength:=" , 0.1
],
[
"NAME:OneSliceInfo",
"SkewAngle:=" , -0.9,
"SliceLength:=" , 0.2
],
[
"NAME:OneSliceInfo",
"SkewAngle:=" , 4,
"SliceLength:=" , 0.3
],
[
"NAME:OneSliceInfo",
"SkewAngle:=" , 18,
"SliceLength:=" , 0.4
]
],
…
]
VBExamples: 2D Transient solution type
oDesign.SetDesignSettings
Array("NAME:Design Settings Data",
"Perform Minimal validation:=", false,
"EnabledObjects:=", Array(),
"PreserveTranSolnAfterDatasetEdit:=", false, "ComputeTransientInductance:=", false, "Com-
puteIncrementalMatrix:=", false,
"PerfectConductorThreshold:=", 1E+30,
"InsulatorThreshold:=", 1,
"ModelDepth:=", "1meter",
"UseSkewModel:=", true,
"SkewType:=", "Continuous",
"SkewPart:=", "Rotor",
"SkewAngle:=", "3rad",
"NumberOfSlices:=", "3",
"EnableTranTranLinkWithSimplorer:=", false, "BackgroundMaterialName:=", "vacuum",
"SolveFraction:=", false,
"Multiplier:=", "1"),
Array("NAME:Model Validation Settings",
"EntityCheckLevel:=", "Strict",
"IgnoreUnclassifiedObjects:=", false,
"SkipIntersectionChecks:=", false)
oDesign.SetDesignSettings
Array(
…
"ModelDepth:=", "1meter",
"UseSkewModel:=", true,
"SkewType:=", "Step",
"SkewPart:=", "Stator",
"SkewAngle:=", "3rad",
"NumberOfSlices:=", "4",
…
)
oDesign.SetDesignSettings
Array(
…
"ModelDepth:=", "1meter",
"UseSkewModel:=", true,
"SkewType:=", "V-Shape",
"SkewPart:=", "Stator",
"SkewAngle:=", "3rad",
"NumberOfSlices:=", "5",
…
)
oDesign.SetDesignSettings
Array(
…
"ModelDepth:=", "1meter", "UseSkewModel:=", true,
"SkewType:=", "User Defined",
"SkewPart:=", "Rotor",
"SkewAngleUnit:=", "deg",
"NumberOfSlices:=", "5",
Array("NAME:SkewSliceTable",
Array("NAME:OneSliceInfo", "SkewAngle:=", "10", "SliceLength:=", "0.3"),
Array("NAME:OneSliceInfo", "SkewAngle:=", "-2.7", "SliceLength:=", "0.2"),
Array("NAME:OneSliceInfo", "SkewAngle:=", "-1.8", "SliceLength:=", "0.25"),
Array("NAME:OneSliceInfo", "SkewAngle:=", "-0.3", "SliceLength:=", "0.15"),
Array("NAME:OneSliceInfo", "SkewAngle:=", "3", "SliceLength:=", "0.1"))
…
)
SetFastTransformationForLayoutComponent
Toggles whether layout components in Maxwell show outlines of objects across layers during view changes. This improves the visu-
alization performance.
SetObjectAttributesForLayoutComponent
Sets visualization attributes for layout components in Maxwell for a named component for layers, nets, and objects.
"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.
For Maxwell magnetostatic, transient, electrostatic, and eddy current designs, sets the deformation of objects when calling Ansys Elec-
tronics Desktop from Ansys Workbench. (Can also be used for setting deformation of objects in Maxwell 2D/3D magnetostatic and
transient standalone designs.)
UI Access N/A
Python SetObjectDeformation(<ObjectArray>)
Syntax
"Enabled2DXYStressXYObjects:=", ["64.3psi","28.13psi"],
])
SetObjectTemperature
Sets the temperature of objects.
oDesign.SetObjectTemperature Array(
VB "NAME:TemperatureSettings", "IncludeTemperatureDependence:=", _
Example true, "EnableFeedback:=", true, "Temperatures:=", Array("RegularPolyhedron1", _
"22cel", "Polygon1", "22cel"))
SetShowAllLayoutComponents
This command will show/hide all layout components in a Maxwell design.
UI Access Edit Layout... View > Visibility > Show All or Hide All
SetShowLayoutForLayoutComponent
Layout visualization, rather than bounding box, for a Layout Component in a Maxwell design.
SetSolutionType (Maxwell)
Use: Sets the solution type for the design.
Command: Click Maxwell3D>Solution Type, Maxwell2D>Solution Type, or right-click a design instance in the project tree and
select Solution Type.
Syntax:SetSolutionType <SolutionType>, <GeomMode>
Return Value: None
Parameters: <SolutionType>
Type: <string>
Possible values for 3D designs are: "Magnetostatic", "EddyCurrent", "Transient", "Elec-
trostatic", "DCConduction", "ElectroDCConduction", "ElectricTransient"
Possible values for 2D designs are: "Magnetostatic", "EddyCurrent", "Transient", "Elec-
trostatic", "DCConduction", "ACConduction"
<GeomMode>
Type: <string>
Possible values for 2D geometry mode: "XY", "about Z"
Example: oDesign.SetSolutionType "ElectroDCConduction" oDesign.SetSolutionType "Electrostatic",
"XY" oDesign.SetSolutionType "EddyCurrent", "about Z"
Solve
Performs one or more simulation. The next script command will not be executed until the simulation(s) are complete.
Integer:
l 0 – Simulation(s) completed.
Return Value
l 1 – Simulation error.
l -1 – Command execution error.
StopSimLink
Stops linked simulation.
UI Access N/A
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.
Undo [Design]
Cancels the last design-level command.
VB Syntax Undo
VB Example oDesign.Undo
ValidateDesign
Returns whether a design is valid.
l 0 – Validation failed.
VB Syntax ValidateDesign
VB Example oDesign.ValidateDesign
ValidateLink
Note:
This command is for internal Ansys use only.
7-72
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
"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
CreateRectangle
CreateRegion
CreateRegularPolygon
CreateRegularPolyhedron
CreateSphere
CreateSpiral
CreateSubregion
CreateTorus
CreateUserDefinedModel
CreateUserDefinedPart
Edit3DComponent
EditPolyline
Get3DComponentDefinitionNames
Get3DComponentInstanceNames
Get3DComponentMaterialNames
Get3DComponentMaterialProperties
Get3DComponentParameters
Insert3DComponent
InsertPolylineSegment
SweepAlongPath
SweepAlongVector
SweepAroundAxis
SweepFacesAlongNormal
SweepFacesAlongNormalWithAttributes
UpdateComponentDefinition
Create3DComponent
Create a 3D component.
<EditPassword> string
<PasswordType> string
<HideContents> bool Hide selected contents?
<ReplaceNames> bool Allow replacement of object and material names?
<ComponentOutline> string "None" or "Bounding Box"
<IncludedParts> list Array of included parts
<HiddenParts> list Array of hidden parts
<IncludedCS> list Array of included coordinate system(s)
<ReferenceCS> string Reference coordinate system
<IncludedParameters> list Array of included parameters
<ParameterDescription> list Array of parameter descriptions
<IsLicensed> bool Is the component licensed?
<LicensingDllName> string License name
<Ven- string Vendor component Identifier
dorComponentIdentifier>
<PublicKeyFile> string Public Key filename - including path to the key
<NAME> string
<Excitations> list Array of excitations
<Filename> string Path and name of component being saved.
<NAME> string
<ImageFile> string
"NAME:CreateData",
"ComponentName:=" , "CoilWindingsNew",
"Company:=" , "",
"Company URL:=" , "",
"Model Number:=" , "",
"Help URL:=" , "",
"Version:=" , "1.0",
"Notes:=" , "",
"IconType:=" , "",
"Owner:=" , "J Doe",
"Email:=" , "jdoe@",
"Date:=" , "4:40:58 PM Oct 14, 2019",
"HasLabel:=" , False,
"IsEncrypted:=" , False,
"AllowEdit:=" , False,
"SecurityMessage:=" , "",
"Password:=" , "",
"EditPassword:=" , "",
"PasswordType:=" , "UnknownPassword",
"HideContents:=" , True,
"ReplaceNames:=" , True,
"ComponentOutline:=" , "None",
"IncludedParts:=" , ["Coil_1st_Section1",
"Coil_2nd_Section1"],
"HiddenParts:=" , [],
"IncludedCS:=" , [],
"ReferenceCS:=" , "Global",
"IncludedParameters:=" , ["nCond","wCurrent","wPhase"],
"ParameterDescription:=", ["nCond:=", "", "wCurrent:=", "",
"wPhase:=", ""],
"IsLicensed:=" , False,
"LicensingDllName:=" , "",
"VendorComponentIdentifier:=", "",
"PublicKeyFile:=", ""
"Excitations:=" , ["CoilTerminal1","CoilTerminal2",
"Winding1","Winding2"]
], "C:/work/3DComponents/CoilWindingsNew.a3dcomp",
[
"NAME:ImageFile",
"ImageFile:=" , ""
])
VB Create3DComponent (ComponentParameters)
Syn-
tax
CreateBondwire
Creates a bondwire.
"Distance:=", <value>,
"h1:=", <value>,
"h2:=", <value>,
"alpha:=", <value>,
"beta:=", <value>,
"WhichAxis:=", <string("X","Y", or "Z")>,
"ReverseDirection:=", <boolean>)
<AttributesArray> Array Structured array. See: AttributesArray.
"ZDir:=" , "0mm",
"Distance:=" , "2.60768096208106mm",
"h1:=" , "0.2mm",
"h2:=" , "0mm",
"alpha:=" , "80deg",
"beta:=" , "0",
"WhichAxis:=" , "Z",
"ReverseDirection:=" , True
],
["NAME:Attributes",
"Name:=" , "Bondwire1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"vacuum\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , True,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateBox
Creates a box.
"YPosition:=" , "-6.5mm",
"ZPosition:=" , "0mm",
"XSize:=" , "2mm",
"YSize:=" , "1.5mm",
"ZSize:=" , "1.5mm"
],
["NAME:Attributes",
"Name:=" , "Box3",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=" , "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=" , "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateCircle
Creates a circle.
"IsCovered:=", <boolean>,
"XCenter:=", <value>,
"YCenter:=", <value>,
"ZCenter:=", <value>,
"Radius:=", <value>,
"WhichAxis:=", <string>
"NumSegments:=", <string containing integer>)
<AttributesArray> Array Structured array. See: AttributesArray.
["NAME:Attributes",
"Name:=" , "Circle1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateCone
Creates a cone.
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
terialAppearance:=", _
false, "IsLightweight:=", false)
CreateCutplane
Creates a cutplane.
["NAME:PlaneParameters",
"PlaneBaseX:=" , "-0.6mm",
"PlaneBaseY:=" , "-0.8mm",
"PlaneBaseZ:=" , "0mm",
"PlaneNormalX:=" , "1.2mm",
"PlaneNormalY:=" , "0.2mm",
"PlaneNormalZ:=" , "0mm"
],
["NAME:Attributes",
"Name:=" , "Plane1",
"Color:=" , "(143 175 143)"
])
CreateCylinder
Creates a cylinder.
"YCenter:=" , "-4.5mm",
"ZCenter:=" , "0mm",
"Radius:=" , "0.5mm",
"Height:=" , "4.5mm",
"WhichAxis:=" , "Z",
"NumSides:=" , "0"
],
["NAME:Attributes",
"Name:=" , "Cylinder1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
VB
"", "Color:=", "(143 175 143)", "Transparency:=", 0, "PartCoordinateSystem:=", _
Exampl- "Global", "UDMId:=", "", "MaterialValue:=", "" & Chr(34) & "copper" & Chr(34) & "", "Sur-
e faceMaterialValue:=", _
"" & Chr(34) & "" & Chr(34) & "", "SolveInside:=", false, "ShellElement:=", _
false, "ShellElementThickness:=", "0mm", "IsMaterialEditable:=", true, "UseMa-
terialAppearance:=", _
false, "IsLightweight:=", false)
CreateEllipse
Creates an ellipse.
Array("NAME:EllipseParameters",
"IsCovered:=", <string>,
"XCenter:=", <string>,
"YCenter:=", <string>,
"ZCenter:=", <string>,
"MajRadius:=", <string>,
"Ratio:=", <string>,
"WhichAxis:=", <string>,
"NumSegments:=", <string>)
<AttributesArray> Array Structured array. See: AttributesArray.
"WhichAxis:=" , "Z",
"NumSegments:=" , "0"
],
["NAME:Attributes",
"Name:=" , "Ellipse1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
VB
"Ellipse2", "Flags:=", "", "Color:=", "(143 175 143)", "Transparency:=", 0,
Exampl- "PartCoordinateSystem:=", _
e "Global", "UDMId:=", "", "MaterialValue:=", "" & Chr(34) & "copper" & Chr(34) & "",
"SurfaceMaterialValue:=", _
"" & Chr(34) & "" & Chr(34) & "", "SolveInside:=", false, "ShellElement:=", _
false, "ShellElementThickness:=", "0mm", "IsMaterialEditable:=", true, "UseMa-
terialAppearance:=", _
false, "IsLightweight:=", false)
CreateEquationCurve
Creates an equation-based curve.
Parameters Array("NAME:EquationBasedCurveParameters",
"XtFunction:=", <string>,
"YtFunction:=", <string>,
"ZtFunction:=", <string>,
"tStart:=", <string>,
"tEnd:=", <string>,
"NumOfPointsOnCurve:=", <string>,
"Version:=", <integer>),
<polylineArray(optional)>)
<AttributesArray> Array Structured array. See: AttributesArray.
"XSectionType:=" , "None",
"XSectionOrient:=" , "Auto",
"XSectionWidth:=" , "0",
"XSectionTopWidth:=" , "0",
"XSectionHeight:=" , "0",
"XSectionNumSegments:=" , "0",
"XSectionBendType:=" , "Corner"
]
],
["NAME:Attributes",
"Name:=" , "EquationCurve1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateEquationSurface
Creates an equation-based surface.
["NAME:EquationBasedSurfaceParameters",
"XuvFunction:=" , "_u",
"YuvFunction:=" , "_v",
"ZuvFunction:=" , "sin(_u)+cos(_v)",
"uStart:=" , "1",
"uEnd:=" , "10",
"vStart:=" , "1",
"vEnd:=" , "10",
"Version:=" , 1
],
["NAME:Attributes",
"Name:=" , "EquationSurface1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateHelix
Creates a helix based on a sweep of specified objects.
oEditor.CreateHelix(
["NAME:Selections",
"Selections:=" , "EquationSurface2",
"NewPartsModelFlag:=" , "Model"
],
["NAME:HelixParameters",
"XCenter:=" , "10000mm",
"YCenter:=" , "40000mm",
Python Example "ZCenter:=" , "0mm",
"XStartDir:=" , "0mm",
"YStartDir:=" , "10000mm",
"ZStartDir:=" , "0mm",
"NumThread:=" , "1",
"RightHand:=" , True,
"RadiusIncrement:=" , "0mm",
"Thread:=" , "1mm"
])
CreatePoint
Creates a point.
["NAME:PointParameters",
"PointX:=" , "0.2mm",
"PointY:=" , "-0.2mm",
"PointZ:=" , "0mm"
],
["NAME:Attributes",
"Name:=" , "Point1",
])
"Name:=" , "Point1",
"Color:=" , "(143 175 143)")
CreateUserDefinedPart
Creates a user-defined part.
"Value:=" , <string>)
<Attributes> Array Structured array. See: AttributesArray.
"Name:=" , "Length",
"Value:=" , "100mm"
],
["NAME:Pair",
"Name:=" , "Skew",
"Value:=" , "0deg"
],
["NAME:Pair",
"Name:=" , "Slots",
"Value:=" , "18"
],
["NAME:Pair",
"Name:=" , "SlotType",
"Value:=" , "1"
],
["NAME:Pair",
"Name:=" , "Hs0",
"Value:=" , "1mm"
],
["NAME:Pair",
"Name:=" , "Hs1",
"Value:=" , "1mm"
],
["NAME:Pair",
"Name:=" , "Hs2",
"Value:=" , "10mm"
],
["NAME:Pair",
"Name:=" , "Bs0",
"Value:=" , "2.5mm"
],
["NAME:Pair",
"Name:=" , "Bs1",
"Value:=" , "8mm"
],
["NAME:Pair",
"Name:=" , "Bs2",
"Value:=" , "5mm"
],
["NAME:Pair",
"Name:=" , "Rs",
"Value:=" , "0mm"
],
["NAME:Pair",
"Name:=" , "FilletType",
"Value:=" , "0"
],
["NAME:Pair",
"Name:=" , "Layers",
"Value:=" , "2"
],
["NAME:Pair",
"Name:=" , "CoilPitch",
"Value:=" , "4"
],
["NAME:Pair",
"Name:=" , "EndExt",
"Value:=" , "5mm"
],
["NAME:Pair",
"Name:=" , "SpanExt",
"Value:=" , "25mm"
],
["NAME:Pair",
"Name:=" , "BendAngle",
"Value:=" , "0deg"
],
["NAME:Pair",
"Name:=" , "SegAngle",
"Value:=" , "10deg"
],
["NAME:Pair",
"Name:=" , "LenRegion",
"Value:=" , "200mm"
],
["NAME:Pair",
"Name:=" , "InfoCoil",
"Value:=" , "0"
]
]
],
["NAME:Attributes",
"Name:=" , "LapCoil1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
VB
oEditor.CreateUserDefinedPart Array("NAME:UserDefinedPrimitiveParameters", "DllName:=",
Exampl- _
e "SegmentedHelix/RectHelix.dll", "Version:=", "1.0", "NoOfParameters:=", 8, "Library:=",
_
"syslib", Array("NAME:ParamVector", Array("NAME:Pair", "Name:=", "RectHeight",
"Value:=", _
"1mm"), Array("NAME:Pair", "Name:=", "RectWidth", "Value:=", "2mm"), Array("NAME:Pair",
"Name:=", _
"StartHelixRadius", "Value:=", "10mm"), Array("NAME:Pair", "Name:=", "RadiusChange",
"Value:=", _
"0mm"), Array("NAME:Pair", "Name:=", "Pitch", "Value:=", "3mm"), Array("NAME:Pair",
"Name:=", _
"Turns", "Value:=", "2"), Array("NAME:Pair", "Name:=", "SegmentsPerTurn", "Value:=", _
"36"), Array("NAME:Pair", "Name:=", "RightHanded", "Value:=", "1"))), Array("NAME:At-
tributes", "Name:=", _
"RectHelix1", "Flags:=", "", "Color:=", "(143 175 143)", "Transparency:=", 0,
"PartCoordinateSystem:=", _
"Global", "UDMId:=", "", "MaterialValue:=", "" & Chr(34) & "copper" & Chr(34) & "", "Sur-
faceMaterialValue:=", _
"" & Chr(34) & "" & Chr(34) & "", "SolveInside:=", false, "ShellElement:=", _
false, "ShellElementThickness:=", "0mm", "IsMaterialEditable:=", true, "UseMa-
terialAppearance:=", _
false, "IsLightweight:=", false)
CreatePolyline
Creates a polyline.
"Z:=" , "0mm"
]
],
["NAME:PolylineSegments",
["NAME:PLSegment",
"SegmentType:=" , "Line",
"StartIndex:=" , 0,
"NoOfPoints:=" , 2
],
["NAME:PLSegment",
"SegmentType:=" , "Line",
"StartIndex:=" , 1,
"NoOfPoints:=" , 2
]
],
["NAME:PolylineXSection",
"XSectionType:=" , "None",
"XSectionOrient:=" , "Auto",
"XSectionWidth:=" , "0mm",
"XSectionTopWidth:=" , "0mm",
"XSectionHeight:=" , "0mm",
"XSectionNumSegments:=" , "0",
"XSectionBendType:=" , "Corner"
]],
["NAME:Attributes",
"Name:=" , "Polyline1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateRectangle
Creates a rectangle.
"YStart:=" , "-90000mm",
"ZStart:=" , "0mm",
"Width:=" , "20000mm",
"Height:=" , "30000mm",
"WhichAxis:=" , "Z"
],
["NAME:Attributes",
"Name:=" , "Rectangle1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateRegion
Creates a region containing the design.
Array("NAME:RegionParameters",
"+XPaddingType:=", <string "Percentage Offset",
"Absolute Offset", or "Absolute Position">,
"+XPadding:=", <string X value>,
"-XPaddingType:=", <string "Percentage Offset",
"Absolute Offset", or "Absolute Position">,
"-XPadding:=", <string -X value>,
"+YPaddingType:=", <string "Percentage Offset",
"Absolute Offset", or "Absolute Position">,
"+YPadding:=", <string Y value>,
"-YPaddingType:=", <string "Percentage Offset",
"Absolute Offset", or "Absolute Position">,
"-YPadding:=", <string -Y value>,
"+ZPaddingType:=", <string "Percentage Offset",
"Absolute Offset", or "Absolute Position">,
"+ZPadding:=", <string Z value>,
"-ZPaddingType:=", <string "Percentage Offset",
"Absolute Offset", or "Absolute Position">,
"-ZPadding:=", <string -Z value>)
<AttributesArray> Array Structured array. See: AttributesArray.
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"vacuum\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "nan ",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateRegularPolyhedron
Creates a regular polyhedron.
CreateRegularPolygon
Creates a regular polygon.
CreateSphere
Creates a sphere.
oEditor.CreateSphere(
["NAME:SphereParameters",
"XCenter:=" , "-40000mm",
"YCenter:=" , "-130000mm",
"ZCenter:=" , "0mm",
"Radius:=" , "22360.6797749979mm"
],
["NAME:Attributes",
"Name:=" , "Sphere1",
"Flags:=" , "",
Python Example
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateSpiral
Creates a spiral by sweeping the specified object(s).
"YCenter:=" , "50000mm",
"ZCenter:=" , "0mm",
"XStartDir:=" , "-60000mm",
"YStartDir:=" , "-10000mm",
"ZStartDir:=" , "0mm",
"NumThread:=" , "1",
"RightHand:=" , True,
"RadiusIncrement:=" , "1mm"
])
CreateTorus
Creates a torus.
"MinorRadius:=" , "0.0821854415126694mm",
"WhichAxis:=" , "Z"
],
["NAME:Attributes",
"Name:=" , "Torus1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
CreateUserDefinedModel
Creates a user-defined model.
Parameters <definitionArray>,
<optionsArray>,
<geometryParamsArray>,
"DllName:=", <string filepath>,
"Library:=", <string>,
"Version:=", <string>
"ConnectionID:=", <string>)
<definitionArray> Array Structured array containing string "NAME:Definition".
<optionsArray> Array Structured array containing string "NAME:Options".
<geometryParamsArray> Array Structured array containing arrays for individual parameters:
Array("NAME:GeometryParameters",
Array("NAME:UDMParam",
"Name:=" , <string>,
"Value:=" , <string>,
"PropType2:=" , <integer>,
"PropFlag2:=" , <integer>))
Required UDM parameters depend on the UDM being created. To see
which properties apply to a UDM, right-click the UDM in the Project
Tree and select Properties. Then select the Parameters tab.
PropType2 can be any of the following:
l 0 – Property takes a string value.
l 1 – Property is a menu option.
l 2 – Property takes a number (integer or double).
l 3 – Property takes a value (numbers, variables, or expressions).
l 4 – Property is a file name.
l 5 – Property corresponds to a check box.
l 6 – Property specifies a 3D position.
Pytho- CreateUserDefinedModel(<Parameters>)
n Syn-
tax
oEditor.CreateUserDefinedModel(
Pytho- ["NAME:UserDefinedModelParameters",
n
["NAME:Definition"],
Exam-
ple ["NAME:Options"],
["NAME:GeometryParams",
["NAME:UDMParam",
"Name:=" , "ILD Thickness (ILD)",
"Value:=" , "0.006mm",
"PropType2:=" , 3,
"PropFlag2:=" , 4
],
["NAME:UDMParam",
"Name:=" , "Line Spacing (LS)",
"Value:=" , "0.004mm",
"PropType2:=" , 3,
"PropFlag2:=" , 4
],
["NAME:UDMParam",
"Name:=" , "Line Thickness (LT)",
"Value:=" , "0.005mm",
"PropType2:=" , 3,
"PropFlag2:=" , 4
],
["NAME:UDMParam",
"Name:=" , "Line Width (LW)",
"Value:=" , "0.004mm",
"PropType2:=" , 3,
"PropFlag2:=" , 4
],
["NAME:UDMParam",
"Name:=" , "No. of Turns (N)",
"Value:=" , "2",
"PropType2:=" , 3,
"PropFlag2:=" , 2
],
["NAME:UDMParam",
"Name:=" , "Outer Diameter (OD)",
"Value:=" , "0.15mm",
"PropType2:=" , 3,
"PropFlag2:=" , 4
],
["NAME:UDMParam",
"Name:=" , "Substrate Thickness",
"Value:=" , "0.2mm",
"PropType2:=" , 3,
"PropFlag2:=" , 4
],
["NAME:UDMParam",
"Name:=" , "Inductor Type",
"Value:=" , "\"Square,Square,Octagonal,Circular,Square-Differential,Octagonal-
Differential,Circular-Differential\"",
"DataType:=" , "String",
"PropType2:=" , 1,
"PropFlag2:=" , 0
],
["NAME:UDMParam",
"Name:=" , "Underpass Thickness (UT)",
"Value:=" , "0.001mm",
"PropType2:=" , 3,
"PropFlag2:=" , 4
],
["NAME:UDMParam",
"Name:=" , "Via Thickness (VT)",
"Value:=" , "0.001mm",
"PropType2:=" , 3,
"PropFlag2:=" , 4
]
],
"DllName:=" , "Maxwell3D/OnDieSpiralInductor.py",
"Library:=" , "syslib",
"Version:=" , "2.0",
"ConnectionID:=" , ""
])
_
"Outer Diameter (OD)", "Value:=", "0.15mm", "PropType2:=", 3, "PropFlag2:=", 4), Array
("NAME:UDMParam",
"Name:=", _
"Substrate Thickness", "Value:=", "0.2mm", "PropType2:=", 3, "PropFlag2:=", 4), Array
("NAME:UDMParam",
"Name:=", _
"Inductor Type", "Value:=", _
"" & Chr(34) & "Square,Square,Octagonal,Circular,Square-Differential,Octagonal-" & _
"Differential,Circular-Differential" & Chr(34) & "", "DataType:=", "String",
"PropType2:=", _
1, "PropFlag2:=", 0), Array("NAME:UDMParam", "Name:=", "Underpass Thickness (UT)",
"Value:=", _
"0.001mm", "PropType2:=", 3, "PropFlag2:=", 4), Array("NAME:UDMParam", "Name:=", _
"Via Thickness (VT)", "Value:=", "0.001mm", "PropType2:=", 3, "PropFlag2:=", 4)),
"DllName:=", _
"Maxwell3D/OnDieSpiralInductor.py", "Library:=", "syslib", "Version:=", "2.0", "Con-
nectionID:=", _
"")
CreateUserDefinedPart
Creates a user-defined part.
["NAME:UserDefinedPrimitiveParameters",
"DllName:=" , "RMxprt/LapCoil.dll",
"Version:=" , "16.0",
"NoOfParameters:=" , 22,
"Library:=" , "syslib",
["NAME:ParamVector",
["NAME:Pair",
"Name:=" , "DiaGap",
"Value:=" , "100mm"
],
["NAME:Pair",
"Name:=" , "DiaYoke",
"Value:=" , "20mm"
],
["NAME:Pair",
"Name:=" , "Length",
"Value:=" , "100mm"
],
["NAME:Pair",
"Name:=" , "Skew",
"Value:=" , "0deg"
],
["NAME:Pair",
"Name:=" , "Slots",
"Value:=" , "18"
],
["NAME:Pair",
"Name:=" , "SlotType",
"Value:=" , "1"
],
["NAME:Pair",
"Name:=" , "Hs0",
"Value:=" , "1mm"
],
["NAME:Pair",
"Name:=" , "Hs1",
"Value:=" , "1mm"
],
["NAME:Pair",
"Name:=" , "Hs2",
"Value:=" , "10mm"
],
["NAME:Pair",
"Name:=" , "Bs0",
"Value:=" , "2.5mm"
],
["NAME:Pair",
"Name:=" , "Bs1",
"Value:=" , "8mm"
],
["NAME:Pair",
"Name:=" , "Bs2",
"Value:=" , "5mm"
],
["NAME:Pair",
"Name:=" , "Rs",
"Value:=" , "0mm"
],
["NAME:Pair",
"Name:=" , "FilletType",
"Value:=" , "0"
],
["NAME:Pair",
"Name:=" , "Layers",
"Value:=" , "2"
],
["NAME:Pair",
"Name:=" , "CoilPitch",
"Value:=" , "4"
],
["NAME:Pair",
"Name:=" , "EndExt",
"Value:=" , "5mm"
],
["NAME:Pair",
"Name:=" , "SpanExt",
"Value:=" , "25mm"
],
["NAME:Pair",
"Name:=" , "BendAngle",
"Value:=" , "0deg"
],
["NAME:Pair",
"Name:=" , "SegAngle",
"Value:=" , "10deg"
],
["NAME:Pair",
"Name:=" , "LenRegion",
"Value:=" , "200mm"
],
["NAME:Pair",
"Name:=" , "InfoCoil",
"Value:=" , "0"
]
]
],
["NAME:Attributes",
"Name:=" , "LapCoil1",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , False,
"ShellElement:=" , False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , True,
"UseMaterialAppearance:=", False,
"IsLightweight:=" , False
])
Edit3DComponent
Edits a specified 3D component.
UI Access N/A
"DesignParameters:=", <string>,
<ComponentMeshing>,
<Excitations>)
<ComponentMeshing> Array Structured array.
Array("NAME:Component Meshing",
"MeshAssembly:=", <boolean>)
<Excitations> Array Structured array containing array of suppressed excitations.
Array("NAME:Excitations",
"Suppressed:=", <array>)
"MeshAssembly:=", False],
["NAME:Excitations",
"Suppressed:=", []]
]
)
UI Access In the Project Manager, expand 3D Components, right-click on the component, and select Edit Definition.
"NAME:VariableOrders"
]
],
[
"NAME:MaterialDefinitionParameters",
[
"NAME:VariableOrders"
]
],
"NextUniqueID:=" , 0,
"MoveBackwards:=" , False,
"DatasetType:=" , "ComponentDatasetType",
[
"NAME:DatasetDefinitions"
],
[
"NAME:NativeComponentDefinitionProvider",
"Type:=" , "Layout Component",
"Unit:=" , "mm",
"Version:=" , 1.1,
"EDBDefinition:=" , "EdgeCircuitPort_Inductor1",
[
"NAME:VariableMap"
],
"ReferenceCS:=" , "U0",
"CSToImport:=" , ["Global","U0"]
],
"ComponentName:=" , "LC1",
"Company:=" , "",
"Company URL:=" , "",
"Model Number:=" , "",
"Help URL:=" , "",
"Version:=" , "1.0",
"Notes:=" , "",
"IconType:=" , "Layout Component"
])
EditPolyline
Modifies a specified polyline. See: CreatePolyline.
UI Access N/A
"X:=" , "10000mm",
"Y:=" , "-140000mm",
"Z:=" , "0mm"
]
],
["NAME:PolylineSegments",
["NAME:PLSegment",
"SegmentType:=" , "Line",
"StartIndex:=" , 0,
"NoOfPoints:=" , 2
],
["NAME:PLSegment",
"SegmentType:=" , "Line",
"StartIndex:=" , 1,
"NoOfPoints:=" , 2
]
],
["NAME:PolylineXSection",
"XSectionType:=" , "None",
"XSectionOrient:=" , "Auto",
"XSectionWidth:=" , "0mm",
"XSectionTopWidth:=" , "0mm",
"XSectionHeight:=" , "0mm",
"XSectionNumSegments:=" , "0",
"XSectionBendType:=" , "Corner"
]]
)
VB
"0mm")), Array("NAME:PolylineSegments", Array("NAME:PLSegment", "SegmentType:=", "Line",
Exa- "StartIndex:=", _
mple 0, "NoOfPoints:=", 2)), Array("NAME:PolylineXSection", "XSectionType:=", "None", "XSec-
tionOrient:=", _
"Auto", "XSectionWidth:=", "0mm", "XSectionTopWidth:=", "0mm", "XSectionHeight:=", _
"0mm", "XSectionNumSegments:=", "0", "XSectionBendType:=", "Corner")), Array("NAME:At-
tributes", "Name:=", _
"Polyline2", "Flags:=", "", "Color:=", "(143 175 143)", "Transparency:=", 0, "PartCoordin-
ateSystem:=", _
"Global", "UDMId:=", "", "MaterialValue:=", "" & Chr(34) & "copper" & Chr(34) & "", "Sur-
faceMaterialValue:=", _
"" & Chr(34) & "" & Chr(34) & "", "SolveInside:=", false, "ShellElement:=", _
false, "ShellElementThickness:=", "0mm", "IsMaterialEditable:=", true, "UseMa-
terialAppearance:=", _
false, "IsLightweight:=", false)
Get3DComponentParameters
Returns parameters for a specified 3D component.
UI Access N/A
Get3DComponentDefinitionNames
Gets names of 3D component definitions.
UI Access N/A
Parameters None.
Return Value Array of strings containing component definition names.
VB Syntax Get3DComponentDefinitionNames()
Dim defNames
VB Example
defNames = oEditor.Get3DComponentDefinitionNames()
Get3DComponentInstanceNames
Returns instance names of 3D component definitions.
UI Access N/A
Get3DComponentMaterialNames
Returns material names for a specified *.a3dcomp format 3D component.
UI Access N/A
Get3DComponentMaterialProperties
Returns material properties for a specified 3D component.
UI Access N/A
Insert3DComponent
Inserts a 3D component.
"ComponentName:=" , "LC1",
"Company:=" , "",
"Company URL:=" , "",
"Model Number:=" , "",
"Help URL:=" , "",
"Version:=" , "1.0",
"Notes:=" , "",
"IconType:=" , "Layout Component"
],
[
"NAME:GeometryDefinitionParameters",
[
"NAME:VariableOrders"
]
],
[
"NAME:DesignDefinitionParameters",
[
"NAME:VariableOrders"
]
],
[
"NAME:MaterialDefinitionParameters",
[
"NAME:VariableOrders"
]
],
"DefReferenceCSID:=" , 1,
"MapInstanceParameters:=", "DesignVariable",
"UniqueDefinitionIdentifier:=", "27e7d8f5-da68-409b-8c4d-bf2bc6d95f69",
"OriginFilePath:=" , "",
"IsLocal:=" , False,
"ChecksumString:=" , "",
"ChecksumHistory:=" , [],
"VersionHistory:=" , [],
[
"NAME:NativeComponentDefinitionProvider",
"Type:=" , "Layout Component",
"Unit:=" , "mm",
"EDBDefinition:=" , "EdgeCircuitPort_Inductor1",
[
"NAME:VariableMap"
],
"ReferenceCS:=" , "Global",
"CSToImport:=" , ["Global","U0"]
],
[
"NAME:InstanceParameters",
"GeometryParameters:=" , "",
"MaterialParameters:=" , "",
"DesignParameters:=" , ""
]
])
InsertPolylineSegment
Insets a polyline segment before or after a specified existing segment.
integers>,
"At Start:=" , <boolean>,
"SegmentType:=" , <string "Line", "Arc",
"Spline", or "AngularArc">,
<PolylinePointsArray>
<PolylinePointsArray> Array Structured array. See: CreatePolyline.
],
["NAME:PLPoint",
"X:=" , "0.6mm",
"Y:=" , "-0.8mm",
"Z:=" , "0mm"
]
]
])
SweepAlongPath
Sweeps the specified 1D or 2D parts along a path. The last 1D object specified is the path for the sweep.
"NAME:PathSweepParameters",
"DraftAngle:=" , "0deg",
"DraftType:=" , "Round",
"CheckFaceFaceIntersection:=", False,
"TwistAngle:=" , "0deg"
])
SweepAlongVector
Sweeps the specified 1D or 2D parts along a vector.
[
"NAME:VectorSweepParameters",
"DraftAngle:=" , "0deg",
"DraftType:=" , "Round",
"CheckFaceFaceIntersection:=", False,
"SweepVectorX:=" , "0mm"
"SweepVectorY:=" , "0mm"
"SweepVectorX:=" , "12mm"
])
"SweepVectorZ:=" , "12mm")
SweepAroundAxis
Sweeps the specified 1D or 2D parts around an axis.
[
"NAME:Selections",
"Selections:=" , "Rectangle1",
"NewPartsModelFlag:=" , "Model"
],
[
"NAME:AxisSweepParameters",
"DraftAngle:=" , "0deg",
"DraftType:=" , "Round",
"CheckFaceFaceIntersection:=", False,
"SweepAxis:=" , "X"
"SweepAngle:=" , "360deg"
"NumOfSegments:=" , "12"
])
"DraftAngle:=", "0deg",_
"DraftType:=", "Round",_
"CheckFaceFaceIntersection:=", False,_
"SweepAxis:=" , "X",_
"SweepAngle:=" , "360deg",_
"NumOfSegments:=" , "12")
SweepFacesAlongNormal
Sweep the specified face(s) along normal.
oEditor.SweepFacesAlongNormal(
["NAME:Selections",
"Selections:=", "Rectangle1",
"NewPartsModelFlag:=", "Model"],
Python Example ["NAME:Parameters",
"NAME:SweepFaceAlongNormalToParameters",
"FacesToDetach:=", [183],
"LengthOfSweep:=", "0.1mm"])
SweepFacesAlongNormalWithAttributes
Sweep a face along normal, and specify attributes of the new object.
Parameters "NAME:SweepFaceAlongNormalToParameters",
"FacesToDetach:=", <faceIDarray>,
"LengthOfSweep:=", "<value><units>")
<AttributesArray> Array Structured array. See: AttributesArray.
"LengthOfSweep:=", "0.1mm"],
["NAME:Attributes",
"Name:=", "Box3",
"Flags:=", "",
"Color:=", "(143 175 143)",
"Transparency:=", 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=", "",
"MaterialValue:=", "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=", False,
"ShellElement:=", False,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=", True,
"UseMaterialAppearance:=", False,
"IsLightweight:=", False])
"Selections:=", "Rectangle1",
"NewPartsModelFlag:=", "Model"),
Array("NAME:Parameters",
"NAME:SweepFaceAlongNormalToParameters",
"FacesToDetach:=", Array(57),
"LengthOfSweep:=", "0.5mm"),
Array("NAME:Attributes",
"Name:=" , "Box3",
"Flags:=" , "",
"Color:=" , "(143 175 143)",
"Transparency:=" , 0,
"PartCoordinateSystem:=", "Global",
"UDMId:=" , "",
"MaterialValue:=" , "\"copper\"",
"SurfaceMaterialValue:=", "\"\"",
"SolveInside:=" , false,
"ShellElement:=" , false,
"ShellElementThickness:=", "0mm",
"IsMaterialEditable:=" , true,
"UseMaterialAppearance:=", false,
"IsLightweight:=" , false)
)
UpdateComponentDefinition
Updates a 3D component's definition.
Parameters Array("NAME:UpdateDefinitionData",
"DefinitionNames:=", <string>,
"Passwords:=", <array of strings>)
oEditor.UpdateComponentDefinition
Array("NAME:UpdateDefinitionData",
VB Example
"DefinitionNames:=", " Connector, Magic_Tee",
"Passwords:=", Array("", ""))
UI Access N/A
DeletePolylinePoint
Deletes either a start point or an end point from an existing polyline segment.
DuplicateAlongLine
Duplicates specified parts along a line.
"Selections:=" , "Box1",
"NewPartsModelFlag:=" , "Model"
],
["NAME:DuplicateToAlongLineParameters",
"CreateNewObjects:=" , False,
"XComponent:=" , "1mm",
"YComponent:=" , "-0.7mm",
"ZComponent:=" , "0mm",
"NumClones:=" , "2"
],
["NAME:Options",
"DuplicateAssignments:=", False
],
["CreateGroupsForNewObjects:=", False
])
"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.
"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>)
"WhichAxis:=" , "Z",
"AngleStr:=" , "90deg",
"NumClones:=" , "2"
],
["NAME:Options",
"DuplicateAssignments:=", False
],
["CreateGroupsForNewObjects:=", False
])
"DuplicateAssignments:=", false)
Array("CreateGroupsForNewObjects:=", false)
DuplicateMirror
Duplicates specified parts according to a mirror plane.
Array("NAME:Options",
"DuplicateAssignments:=", <boolean>)
<CreateGroup> Array Optional. Structured array.
Array("CreateGroupsForNewObjects:=", <boolean>)
"DuplicateAssignments:=", False
],
["CreateGroupsForNewObjects:=", False
])
Array("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"
])
"MirrorNormalY:=", "0.948683298050514mm",
"MirrorNormalZ:=", "0mm")
Move
Moves specified part(s).
"NewPartsModelFlag:=" , "Model"
],
["NAME:TranslateParameters",
"TranslateVectorX:=" , "-0.5mm",
"TranslateVectorY:=" , "0.1mm",
"TranslateVectorZ:=" , "0mm"
])
OffsetFaces
Offsets the faces of selected part(s).
"Selections:=", "Box1_1",
"NewPartsModelFlag:=", "Model")
Array("NAME:OffsetParameters",
"OffsetDistance:=", "16mm")
VB Syntax Paste
VB Example oEditor.Copy Array("NAME:Selections", "Selections:=" , "Box1_2")
oEditor.Paste
Rotate
Rotates specified object(s).
"RotateAxis:=", "Z",
"RotateAngle:=", "90deg"
])
Scale
Scales specified object(s).
"Selections:=", "Box1",
"NewPartsModelFlag:=", "Model")
Array("NAME:ScaleParameters",
"ScaleX:=", "2",
"ScaleY:=", "2",
"ScaleZ:=", "2")
DeleteLastOperation
DetachFaces
EditEntityList
EditFaceCS
EditObjectCS
EditRelativeCS
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
AssignMaterial
Assigns a material to specified object(s).
Parameters 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.
"RightDistance:=" , "0.1mm",
"ChamferType:=" , "Symmetric"
]
])
Connect
Connects two or more 1D polyline objects or 2D sheet objects.
CoverLines
Covers two or more 1D objects to form a sheet.
CoverSurfaces
Covers two or more faces to form a solid object.
["NAME:Selections",
"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.
CreateFaceCS
Creates a Face Coordinate System from a selected face.
"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.
"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"
])
CreateGroup
Creates a group from objects specified in the history tree.
CreateObjectCS
Creates an object coordinate system from a selected object.
UI Access Modeler > Coordinate System > Create > Object > [Offset / Rotated / Both].
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>,
"PositionType:=" , <string "OnVertex",
"EdgeCenter", "FaceCenter", or "OnEdge">,
"UParam:=" , <float>,
"VParam:=" , <float>,
"XPosition:=" , <string>,
"YPosition:=" , <string>,
"ZPosition:=" , <string>)
<AttributesArray> Array Structured array. See: AttributesArray.
"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"
])
"Box3")
CreateObjectFromEdges
Creates an object from the specified object edge.
["NAME:Selections",
"Selections:=", "Box2",
"NewPartsModelFlag:=", "Model"
],
["NAME:Parameters",
["NAME:BodyFromEdgeToParameters",
"Edges:=", [41] ]
],
["CreateGroupsForNewObjects:=", False
])
CreateObjectFromFaces
Creates 2D objects from specified face(s).
["CreateGroupsForNewObjects:=", False
])
CreateRelativeCS
Creates a Relative Coordinate System.
UI Access Modeler > Coordinate System > Create > Relative CS > [Offset / Rotated / Both].
"XAxisYvec:=" , <string>,
"XAxisZvec:=" , <string>,
"YAxisXvec:=" , <string>,
"YAxisYvec:=" , <string>,
"YAxisZvec:=" , <string>)
<AttributesArray> Array Structured array. See: AttributesArray. CreateRelativeCS supports only
the "Name" parameter.
],
["NAME:Attributes",
"Name:=" , "RelativeCS1"
])
DeleteEmptyGroups
Deletes group(s) from the history tree.
DeleteLastOperation
Deletes the last operation performed on the specified object(s).
DetachFaces
Detaches the specified face(s) from an object.
["NAME:Selections",
"Selections:=", "Box3",
"NewPartsModelFlag:=", "Model"
],
["NAME:Parameters",
["NAME:DetachFacesToParameters",
"FacesToDetach:=", [68,67]
]
])
EditEntityList
Modifies an entity list.
Array("NAME:GeometryEntityListParameters",
"EntityType:=" , <string "Object" or
"Face">,
"EntityList:=" , <string list>
)
"Selections:=", "Objectlist1")
Array("NAME:GeometryEntityListParameters",
"EntityType:=", "Object",
"EntityList:=", "Box1, Box2, Box3")
EditFaceCS
Recreates an existing face coordinate system. See: CreateFaceCS.
"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.
"UParam:=" , 0,
"VParam:=" , 0,
"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"
])
"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.
"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>,
"PositionType:=" , <string "OnVertex",
"EdgeCenter", "FaceCenter", or "OnEdge">,
"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.
["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"
])
"PartName:=", _
"Box3")
EditRelativeCS
Edits an existing Relative Coordinate System. See: CreateRelativeCS.
Export
Exports the model to a file.
Note:
This script does not export image file types or GDSII files. See: ExportModelImageToFile and ExportGDSII.
Parameters "AllowRe-
gionDependentPartSelectionForPMLCreation:=",
<boolean>,
"AllowRegionSelectionForPMLCreation:=",
<boolean>,
Return None.
Value
Array("NAME:ExportParameters",
"AllowRegionDependentPartSelectionForPMLCreation:=", True,
"AllowRegionSelectionForPMLCreation:=", True,
"Selections:=" , "Box1,Box2,Box3",
"File Name:=" , "C:/Users/jdoe/Desktop/export.sab",
"Major Version:=" , 25,
"Minor Version:=" , 0)
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.
boolean>,
"ShowGrid:=" , <string containing
boolean>,
"ShowRuler:=" , <string containing
boolean>,
"ShowRegion:=" , <string>,
"Selections:=" , <string>,
"FieldPlotSelections:=", <string>' #
Comma delimited string. #Use to set which
field plot to show.
"FitToSelections:=" , "",
"FitToFieldPlotSelection:=" , ""
"AutoFit:=" , "True",
"Orientation:=" , <string>
"ShowOrientationGadget:=" , <False>
"Selections:=" , "",
"FieldPlotSelections:=" , "",
"FitToSelections:=" , "",
"FitToFieldPlotSelections:=", "",
"AutoFit:=" , "True",
"Orientation:=" , ""
])
"Orientation:=", ""
Fillet
Performs a fillet on specified edge(s).
["NAME:Selections",
"Selections:=" , "Box1",
"NewPartsModelFlag:=" , "Model"
],
["NAME:Parameters",
["NAME:FilletParameters",
"Edges:=" , [13],
"Vertices:=" , [],
"Radius:=" , "1mm",
"Setback:=" , "0mm"
]
])
"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)
HealObject
Heals an imported object.
"ExplodeAndStitch:=" , <boolean>,
"GeomSimplificationTol:=", <integer>,
"Max-
imumGeneratedRadiusForSimplification:=",
<integer>,
"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>)
"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
])
GetActiveCoordinateSystem
Returns the active coordinate system.
UI Access None.
Parameters None.
VB Syntax GetActiveCoordinateSystem
dim csName
VB Example
csName = oEditor.GetActiveCoordinateSystem
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()
dim csNames
VB Example
csNames = oEditor.GetCoordinateSystems
Import
Imports a 3D model file.
Note:
This script does not import DXF or GDSII models. See: ImportDXF and ImportGDSII.
"ReduceMaxError:=" , <integer>,
"ReducePercentage:=" , <integer>,
"PointCoincidenceTol:=" , <float>,
"CreateLightweightPart:=", <boolean>,
"ImportMaterialNames:=" , <boolean>,
"SeparateDisjointLumps:=", <boolean>,
"SourceFile:=" , <string>)
"HealSTL:=" , False,
"ReduceSTL:=" , False,
"ReduceMaxError:=" , 0,
"ReducePercentage:=" , 100,
"PointCoincidenceTol:=" , 1E-06,
"CreateLightweightPart:=", False,
"ImportMaterialNames:=" , False,
"SeparateDisjointLumps:=", False,
"SourceFile:=" , "C:\\Users\\jdoe\\Desktop\\export.model"
])
"STLFileUnit:=" , "Auto",
"MergeFacesAngle:=" , 0.02,
"HealSTL:=" , False,
"ReduceSTL:=" , False,
"ReduceMaxError:=" , 0,
"ReducePercentage:=" , 100,
"PointCoincidenceTol:=" , 1E-06,
"CreateLightweightPart:=", False,
"ImportMaterialNames:=" , False,
"SeparateDisjointLumps:=", False,
"SourceFile:=" , "C:\\Users\\jdoe\\Desktop\\export.model")
ImportDXF [Modeler]
Imports a DXF model file.
"DefeatureGeometry:=" , <boolean>,
"DefeatureDistance:=" , <integer>,
"RoundCoordinates:=" , <boolean>,
"RoundNumDigits:=" , <integer>,
"WritePolyWithWidthAsFilledPoly:=", <boolean>,
"ImportMethod:=" , <integer>,
"2DSheetBodies:=" , <boolean>,
<layersArray>)
<layersArray> Array Structured array.
Array("NAME:LayerInfo",
<layer>, <layer>, <layer>,...)
<layer> Array Structured array.
Array("NAME:<layerName>",
"source:=" , <string>,
"display_source:=" , <string>,
"import:=" , <boolean>,
"dest:=" , <string>,
"dest_selected:=" , <boolean>,
"layer_type:=" , <string>)
"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"
]
]
])
ImportGDSII [Modeler]
Imports a GDSII model file.
Array("NAME:options",
"FileName:=" , <string>,
"FlattenHierarchy:=" , <boolean>,
"ImportMethod:=" , <integer>,
<layerMapArray>, <layerMapArray>, <layerMapArray>,...
"OrderMap:=" ,
[ "entry:=" ,
<entry>, <entry>, <entry>,...
]
])
<layerMapArray> Array Structured array.
Array("NAME:LayerMapInfo",
"LayerNum:=" , <integer>,
"DestLayer:=" , <string>,
"layer_type:=" , <string>)
<entry> Array Structured array.
Array("order:=" , <integer LayerNum>, "layer:=" ,
<string DestLayer>)
oEditor.ImportGDSII(
["NAME:options",
"FileName:=", "C:/Users/coil2.gds",
"FlattenHierarchy:=" , True,
"ImportMethod:=" , 1,
["NAME:LayerMap",
["NAME:LayerMapInfo",
"LayerNum:=" , 12,
"DestLayer:=" , "Signal12",
"layer_type:=" , "signal"
Python Example ],
["NAME:LayerMapInfo",
"LayerNum:=" , 13,
"DestLayer:=" , "Signal13",
"layer_type:=" , "signal"
],
["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"]
]
])
"DestLayer:=", "Signal1",
"layer_type:=", "signal"]))
"OrderMap:=", Array(
"entry:=", Array(
"order:=", 0,
"layer:=", "Signal1")))
Intersect
Intersects specified objects.
],
["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.
oEditor.MoveEntityToGroup(
Python Example ["Objects:=", ["Box3"]],
["ParentGroup:=", "Box_Group"])
MoveFaces
Moves the specified faces along normal or along a vector.
UI Access Modeler > Surface > Move Faces > Along [Normal/Vector].
"OffsetDistance:=", <string>,
"MoveVectorX:=", <string>,
"MoveVectorY:=", <string>,
"MoveVectorZ:=", <string>,
"FacesToMove:=", <array>)
MoveAlongNormalFlag specifies whether to move along the
face normal or along a vector. If false, provide the MoveVectorX,
MoveVectorY, and MoveVectorZ parameters.
FacesToMove is an array of integers (the IDs of the faces to
move).
"MoveVectorZ:=" , "0mm",
"FacesToMove:=" , [183]
]
])
ProjectSheet
Project a sheet object, typically for modeling thin conformal deposits. Typically followed by Thicken Sheet.
Array("NAME:ProjectSheetParameters")
PurgeHistory
Purges the history of a specified object.
"Selections:=", "Box2",
"NewPartsModelFlag:=", "Model")
Section
Creates a 2D cross-section of the selection in the specified plane.
["NAME:SectionToParameters",
"CreateNewObjects:=" , True,
"SectionPlane:=" , "XY",
"SectionCrossObject:=" , False
])
SeparateBody
Separates the bodies of specified multi-lump objects.
SetModelUnits
Sets the model units.
"Units:=", "km",
"Rescale:=", False)
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
Split
Splits the specified object(s) along a plane.
l SplitPlane is "Dummy"
l ToolType is "EdgeTool"
l ToolEntityID is the face ID
Subtract
Subtracts the specified object(s).
The Blank Parts object has any Tool Parts overlap removed.
Either string can contain more than one object.
<Parameters> Array Structured array.
Array("NAME:SubtractParameters",
"KeepOriginals:=" , <boolean>)
SweepFacesAlongNormal
Sweep the specified face(s) along normal.
"NewPartsModelFlag:=", "Model"],
["NAME:Parameters",
"NAME:SweepFaceAlongNormalToParameters",
"FacesToDetach:=", [183],
"LengthOfSweep:=", "0.1mm"])
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>))
Unite
Unites the specified objects.
Note:
],
["NAME:UniteParameters",
"KeepOriginals:=", False,
"TurnOnNBodyBoolean:=", True
])
Ungroup
Ungroups a specified history tree group.
WrapSheet
Wraps a sheet object to another object.
UI Access None.
["NAME:Selections",
"Selections:=","Rectangle1,Box1"
],
["NAME:WrapSheetParameters",
"Imprinted:=", True
]
)
Delete
FitAll
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
P- oProject = oDesktop.NewProject()
yt-
h- oProject.InsertDesign("HFSS", "HFSSDesign1", "DrivenModal", "")
oDesign = oProject.SetActiveDesign("HFSSDesign1")
oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateBox(
"NAME:BoxParameters",
"XPosition:=" , "-0.4mm",
"YPosition:=" , "-1mm",
o-
n "ZPosition:=" , "0mm",
E-
x- "XSize:=" , "1.4mm",
a-
m- "YSize:=" , "1.6mm",
pl-
e
"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
oProject = oDesktop.NewProject()
oProject.InsertDesign("HFSS", "HFSSDesign1", "DrivenModal", "")
"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"
[
"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:OrientationVectorComponents",
Array("NAME:Direction",
<float>,
<float>,
<float>,
Array("NAME:Up",
<float>,
<float>,
<float>))
<OrientationAnglesArray> Array Structured array. Use either <Ori-
entationVectorComponents> or <OrientationAnglesArray>.
Array("NAME:OrientationAngles",
"Psi:=" , <float>,
"Theta:=" , <float>,
"Phi:=" , <float>)
<ProjectionParams> Array Optional. Structured array containing arrays of four optional
parameters: Scaling, Translation, Projection Type, and
Projection Limits.
Array("NAME:ProjectionParams",
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>
)
)
entationAnglesArray>, <ProjectionParams>)
["NAME:ProjectionParams",
["NAME:Scaling",
Python Example
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
)
)
BreakUDMConnection
Breaks a current UDM connection to SpaceClaim.
ChangeProperty
Changes the properties of an object in the history tree.
],
[
"NAME:ChangedProps",
[
"NAME:Model settings/Depth",
"Value:=" , "2.4mm"
]
]
]
])
Example Changing 2D Transient Use of Band Mapping Angle:
oEditor.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:MeshSetupTab",
[
"NAME:PropServers",
"MeshSetup:CylindricalGap1"
],
[
"NAME:ChangedProps",
[
"NAME:Use Band Mapping Angle",
"Value:=" , True
]
]
]
])
oEditor.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:MeshSetupTab",
[
"NAME:PropServers",
"MeshSetup:CylindricalGap1"
],
[
"NAME:ChangedProps",
[
"NAME:Band Mapping Angle",
"Value:=" , "2deg" ]
]
]
])
Example Edit VirtualPort Excitation by changing component properties:
oEditor.ChangeProperty(
[
"NAME:AllTabs",
[
"NAME:Component Data",
[
"NAME:PropServers",
"BoundarySetup:LC1_1_Port1"
],
[
"NAME:ChangedProps",
[
"NAME:Voltage",
"Value:=" , "10mV" ]
]
]
])
...
Array("NAME:ChangedProps",
Array("NAME:Material",
"Value:=", "\"vacuum\""
),
Array("NAME:Display Wireframe",
"Value:=", True
)
)
)
)
Example Changing the Model Depth:
oEditor.ChangeProperty
Array("NAME:AllTabs",
Array("NAME:Maxwell2D",
Array("NAME:PropServers"
"Design Settings"
),
Array("NAME:ChangedProps",
Array("NAME:Model settings/Depth",
"Value:=", "2.4mm"
)
)
)
)
Example Changing 2D Transient Use of Band Mapping Angle:
oEditor.ChangeProperty
Array("NAME:AllTabs",
Array("NAME:MeshSetupTab",
Array("NAME:PropServers"
"MeshSetup:CylindricalGap1"
),
Array("NAME:ChangedProps",
Delete
Deletes the specified object(s).
GetBodyNamesByPosition
Returns the names of objects that contact a specified point.
UI Access N/A
GetEdgeByPosition
Returns the ID for edge(s) that contact a specified point.
UI Access N/A
Array("NAME:EdgeParameters",
"BodyName:=", <string object name>,
"Xposition:=", <string>,
"YPosition:=", <string>,
"ZPosition:=", <string>)
Note:
For 2D XY Designs, ZPosition should be set to "0".
For 2D RZ Designs, YPosition should be set to "0".
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
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"
])
GetFaceIDs
Returns the face IDs associated with a specified 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.
Return Value String containing the modeling mode ("3D" or "XY").
VB Syntax GetGeometryModelerMode
VB Example oEditor.GetGeometryModelerMode
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
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
GetObjectNameByFaceID
Returns an object name given a face ID.
UI Access N/A
GetObjectsByMaterial
Returns a list of objects of a specified material.
UI Access N/A
GetObjectsInGroup
Returns a list of objects in a specified group.
UI Access N/A
GetMatchedObjectName
Returns all object names containing the input text string.
UI Access N/A
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(
UI Access N/A
Parameters None.
Return Value Array containing object IDs
VB Syntax GetSelections
VB Example oEditor.GetSelections
GetUserPosition
Returns a user's current coordinates in the 3D Modeler window.
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
OpenExternalEditor
Launches a SpaceClaim session.
PageSetup
Specifies page settings for printing.
RenamePart
Renames an object.
CreateOutputVariable (Maxwell)
Use: Adds a new output variable to the output variable list. Output variables are associated with a name and an expression. The name
of an output variable is not permitted to collide with design variables, Sim values, or other output variable names. It cannot have
spaces or any arithmetic or other operators. The definitions cannot be cyclic. For example, A = 2*B, B=3*A is not allowed.
Command: Maxwell3D>Results>Output Variables, Maxwell2D>Results>Output Variables, or RMxprt>Results>Output Vari-
ables.
Syntax:CreateOutputVariable <OutputVarName>, <Expression>, <SolutionName>, <ReportTypeName>, <simValueContext>
Return Value: None
Parameters: <OutputVarName>
Type: <string>
Name of the output variable.
<Expression>
Type: <value>
Value to assign to the variable.
<SolutionName>
Type: <string>
Name of the solution as listed in the output variable UI.
For example: "Setup1 : Last Adaptive"
<ReportTypeName>
Type: <string>
The name of the report type as seen in the output variable UI.
<simValueContext>
Type: <variant>
Context for which the output variable expression is being evaluated
Example: Set oModule = oDesign.GetModule("OutputVariable")
oModule.CreateOutputVariable "magforce", "mag(Force1.Force_x)", _
"Setup1 : LastAdaptive", "Magnetostatic", Array()
DeleteOutputVariable
Deletes an existing output variable. The variable can only be deleted if it is not in use by any traces.
UI Access Maxwell > 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.
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
<SolutionName> String Name of the solution as seen in the output variable UI.
For example, "Setup1 : Last Adaptive".
<ReportType> String The name of the report type as seen in the output vari-
able UI.
<ContextArray> Array Structured array containing context for which the output
variable expression is being evaluated.
Array("Context:=", <string>)
GetOutputVariableValue
Use: Gets the double value of an output variable. Only those expressions that return a double value are supported. The expression is
evaluated only for a single point.
Syntax:GetOutputVariableValue(<OutputVarName>, <IntrinsicVariation>, <SolutionName>, <ReportTypeName>, <SimValueCon-
text>)
Return Value: Double value of the output variable .
Parameters: <OutputVarName>
Type: <string>
Name of the output variable.
<IntrinsicVariation>
Type: <string>
A set of intrinsic variable value pairs to use when evaluating the output expression. If no variables are present, a null string
must be used.The Eddy Current solution type requires at least the specification of frequency as shown here while the tran-
sient solver will require Time as a minimum entry.
For example: "" (Null String)
"freq=‘60’" (Eddy current example)
<SolutionName>
Type: <string>
Name of the solution as listed in the output variables dialog box as shown in SimValueContext.
For example: "Setup1 : Last Adaptive" or "Setup1 : Transient"
<ReportTypeName>
Type: <string>
The name of the report type as seen in the output variable dialog box.
Note:
If the Output Variable is based upon a field quantity, then the ReportTypeName must be set to "Fields".
<SimValueContext>
Type: <Array>
Context for which the output variable expression is being evaluated. This section is related to the Parameters or Geometry
fields in the UI that specify a context for extracting data quantities. This can be an empty string if there is no context.
The Context section of the Output Variables dialog box contains the information that is required when getting the value of
the Output Variable. Note these values when using the dialog box to create an Output Variable.
Hint Variation variables can be identified by doing a Data Table report and viewing the variable specifications in the table header.
For example:
Also, as shown below, the Trace and Families tabs on the Report dialog box can be used as illustrated to identify variation vari-
ables.
Example:
Dim Val
Val= oModule.GetOutputVariableValue("tempmag", "freq='60' coilcurrent='1000' gapsize='-0.001'",
"Setup1 : LastAdaptive", "EddyCurrent", "")
Val= oModule.GetOutputVariableValue("tempmag", "coilcurrent='1000' gapsize='-0.001'", "Setup1 :
LastAdaptive", "Magnetostatic", "")
Val= oModule.GetOutputVariableValue("BFieldMag", "", "Setup1 : LastAdaptive", "Fields", "")
Val= oModule.GetOutputVariableValue("MagBatPoint1", "freq='60' coilcurrent='1000' gapsize='-
0.001' Phase=’0deg’", "Setup1 : LastAdaptive", "Fields", Array("Context:=", "Point1"))
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
ExportToFile [Reporter]
ExportMarkerTable
GetAllCategories
GetAllQuantities
GetAllReportNames
GetAvailableDisplayTypes
GetAvailableReportTypes
GetAvailableSolutions
GetChildNames
GetChildObject
GetChildTypes
GetDisplayType
GetPropertyValue
GetReportTraceNames
GetSolutionContexts
GetSolutionDataPerVariation
GroupPlotCurvesByGroupingStrategy
ImportIntoReport
MovePlotCurvesToGroup
MovePlotCurvesToNewGroup
PasteReports
PasteTraces
RenameReport
RenameTrace
ResetPlotSettings
SavePlotSettingsAsDefault
SetPropValue
UpdateAllFieldsPlots
UpdateAllReports
UpdateQuantityFieldsPlots
UpdateReports
UpdateTraces
UpdateTracesContextandSweeps
UnGroupPlotCurvesInGroup
AddCartesianLimitLine
Adds a limit line to a report on the X axis.
Array("NAME:CartesianLimitLine",
Array("NAME:XValues",0, 2, 5, 7, 10, 15),
"XUnits:=", "s",
Array("NAME:YValues",0.05, 0.3, 0.65, 0.825, 0.95, 1),
"YUnits:=", "mV", "YAxis:=", "Y1"
)
AddCartesianXMarker
Adds a marker to a report on the X axis.
AddCartesianYMarker
Adds a marker to a report on the Y axis.
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.
"DefaultYPos:=", 3177, _
"String:=", "This is a note.")
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.
<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> | <ReportQuant-
ityArray>)
<ReportQuantityArray> ex. Array("dB(S(Port1,
Port1))")
ChangeProperty[ReportSetup]
Change the properties for a Report.
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
ClearAllMarkers
Clears all markers from a report.
ClearAllTraceCharacteristics
Clears all trace characteristics from the legend in a report.
CopyTracesData
Copies trace data for a paste operation.
UI Access Select a trace in the Project tree, right-click and select Copy Data.
CopyReportsData
Copy all data corresponding to the specified reports.
UI Access Select a report in the Project tree, right-click and select Copy Data
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
CopyTraceDefinitions
Copy trace definitions for a paste operation.
UI Access Select a trace in the Project tree, right-click and select Copy Definition
CreateReportFromFile
Creates a new report from an .rdat file.
CreateReport (Maxwell)
Use: Creates a new report with a single trace and adds it to the Results branch in the project tree. To add more traces, use the
AddTraces command. To edit the display properties, use the ChangeProperty Script command.
Command: Maxwell2D or Maxwell3D>Results>Create<type> Report
Syntax: CreateReport <ReportName> <ReportType> <DisplayType> <SolutionName> <ContextArray> <Fam-
iliesArray><ReportDataArray>
Return Value: None
Parameters: <ReportName>
Type: <string>
Name of Report.
ReportType
Some possible values are:
"TransientAPhiFormulation"
"Fields"
"Noise Vibration"
"Time Averaged Fields"
"Matrix".
"DC R/L Fields".
"AC R/L Fields".
"C Fields"
"Harmonic Force"
DisplayType
"Rectangular Plot", "Rectangular Stacked Plot", "Data Table", "3D Rectangular Plot", "Rect-
angular Contour Plot".
<TraceArray>
Array("NAME:Traces",
<OneTraceArray>, <OneTraceArray>,...)
<OneTraceArray>
Array("NAME:<TraceName>,
"SolutionName:=","string",
"Context:=","string",
<DisplayTypeDependentData>)
<SolutionName>
Name of the solution as listed in the Traces dialog box.
For example: "Setup1 : Last Adaptive"
<Context> Array
Context for which the output variable expression is being evaluated.
Array("Domain:=", <DomainType>)
<DomainType>
ex. "Sweep" or "Time"
This can be an empty string if there is no context.
Example: "Line1" or ""
Field reports usually require a polyline (e.g. "Line1") unless they are integrations..
<DisplayTypeDependentData>
This data varies according to the display type. See the examples below.
<FamiliesArray>
Type: Array of strings
Contains sweep definitions for the report.
Array("<VariableName>:= ", <ValueArray>)
<ValueArray>
Array("All") or Array("Value1", "Value2", ..."Valuen")
examples of <VariableName>
"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> | <ReportQuant-
ityArray>)
<ReportQuantityArray>
"losses:=" , "0W",
"speed:=" , "0rpm",
"Resistance(PhA):=" , "0ohm",
"Resistance(PhB):=" , "0ohm",
"Resistance(PhC):=" , "0ohm",
"Inductance(PhA):=" , "0H",
"Inductance(PhB):=" , "0H",
"Inductance(PhC):=" , "0H"
],
[
"Im:=" , ["All"],
"Gamma:=" , ["Nominal"],
"speed_rpm:=" , ["Nominal"],
"poles:=" , ["Nominal"]
],
[
"X Component:=" , "Im",
"Y Component:=" , ["AvgCoreLoss"]
], [])
Python Example for Transient A-phi Formulation: oModule.CreateReport("Loss Plot 1", "Tran-
sientAPhiFormulation", "Rectangular Plot", "Setup1 : Transient",
[
"Domain:=" , "Sweep"
],
[
"Time:=" , ["All"],
"$HcRef:=" , ["Nominal"],
"$MagnetTemperature:=" , ["Nominal"]
],
[
"X Component:=" , "Time",
"Y Component:=" , ["TerminalVoltage(Voltage1)","TerminalVoltage(Voltage2)"]
])
[Beta] Python Example for Transient A-phi Formulation, LayoutForce plot: oModule.CreateReport
("LayoutForce Plot 1", "TransientAPhiFormulation", "Rectangular Plot", "Setup1 : Transient",
[
"Domain:=" , "Sweep"
],
[
"Time:=" , ["All"]
],
[
"X Component:=" , "Time",
"Y Component:=" , ["LayoutForce1.Force_mag"]
])
```
])
],
[
"X Component:=" , "Time",
"Y Component:=" , ["PerWindingStrandedLoss(WindingI3_Litz)"]
])
oModule.AddTraces("Loss Plot 4", "Setup1 : Transient",
[
"Domain:=" , "Sweep"
],
[
"Time:=" , ["All"]
],
[
"X Component:=" , "Time",
"Y Component:=" , ["PerWindingStrandedLossAC(WindingI3_Litz)"]
])
"SpatialOrder:=" , ["All"],
"fractions:=" , ["Nominal"],
"halfAxial:=" , ["Nominal"],
"endRegion:=" , ["Nominal"],
"RPM:=" , ["1500rpm"],
"ppairs:=" , ["Nominal"]
],
[
"X Component:=" , "Freq",
"Y Component:=" , "SpatialOrder",
"Z Component:=" , ["re(HarmonicForce_a)"]
])
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
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
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
ExportPlotImageToFile
Deprecated. Use ExportPlotImageWithViewToFile.
Creates field plot exports of existing field plots from a given view points, and with the model being auto-sized automatically for each
view.
UI Access N/A
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.
Dim oModule
ExportToFile
Note:
The ExportToFile script command has replaced the script command ExportReport. ExportReport remains in order to retain
backward compatibility for existing scripts, but it is strongly recommended that you now use ExportToFile.
From a data table or plot, generates 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.
oModule.ExportToFile("rETotal", "C:/Users/Documents/rETotal.csv")
Python Example
oModule.ExportToFile("S Parameter Table 1", "D:/Users/Documents/cftt.csv", False, " kV, MHz, yd ", True)
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.
oModule.ExportToFile
VB Example
"Plot1", "c:\report1.dat"
ExportMarkerTable
Exports the marker table to a .csv or .tab file.
UI Access [product] > Fields > Plot Fields > Marker > Export Marker Table.
FFTOnReport
Performs an FFT on a selected report.
UI Access Right-click on Results in the project tree, select Perform FFT On Report...
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
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
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
GetDataExpressions
Returns data expressions.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion 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 is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
VB Syntax GetDataUnits(<expressionString>)
VB Example oModule.GetDataUnits(expressions)
GetDesignVariableNames
Returns array of strings containing design variable names.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion 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 is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion 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 is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
GetDesignVariationKey
Returns a design's Variation Key.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion 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()
GetDisplayType (Maxwell)
Use: Get Display type of a report.
Command: None
Syntax:GetDisplayType <ReportName>
Return Value: String for display type
Parameters:
<ReportName>
Type: string
The name of report to find the display type for.
Example: Dim displayType
displayType = oModule.GetDisplayType("XY Plot 1")
GetImagDataValues
Returns array of imaginary data values.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
<siValue> Boolean True to return SI-value; False to return with units returned in
GetSweepUnits().
VB Syntax GetImagDataValues(<expressionString>,<siValue>)
dim imaginaryvalues
VB Example
imaginaryvalues = oModule.GetImagDataValues("expression",True)
GetPerQuantityPrimarySweepValues
Returns per quantity primary sweep values.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
Return Value Array of doubles if IsPerQuantityPrimarySweep() returned True; error if returned False
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.
GetRealDataValues
Returns array of real data values.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
VB Syntax GetRealDataValues(<expressionString>,<siValue>)
dim realvalues
VB Example
realvalues = oModule.GetRealDataValues("expression",True)
GetReportTraceNames
Gets the names of existing trace names in a plot.
UI Access N/A
GetSolutionContexts
Gets all available solution context names in a solution as an array of text strings.
UI Access N/A
GetSolutionDataPerVariation
Obtains solution data for a given report type and solution. You must have already run a simulation.
UI Access N/A
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].
GetSweepNames
Returns array of text strings containing primary sweep name(s).
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
Parameters N/A
Return Value Array of text strings
VB Syntax GetSweepNames()
dim sweepnames
VB Example
sweepnames = arr[0].GetSweepNames()
GetSweepUnits
Returns text string containing units.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
VB Syntax GetSweepUnits(<sweepName>)
dim sweepunits
VB Example
sweepunits = oModule.GetSweepUnits("Sweep 1")
GetSweepValues
Returns sweep values.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
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....
IsDataComplex
Returns whether an expression is complex.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion 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 is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion 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()
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
PasteReports
Paste copied reports to results in the current project.
VB Syntax PasteReports
VB Example oModule.PasteReports
PasteTraces
Pastes copied traces to a named plot.
UI Access Paste
Release Data
Releases all cached data. After this function is called, all subsequent function calls to the object will fail.
Important:
This is a member function of ISolutionDataResultComInterface object, which is the element of the returned array from func-
tion GetSolutionDataPerVariation.
UI Access N/A
Parameters N/A
Return Value N/A
VB Syntax ReleaseData()
VB Example oModule.ReleaseData()
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.
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.
"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.
"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"]])
UnGroupPlotCurvesInGroup
From a Stacked Plot, ungroups curves in a stack.
UI Access N/A
Related Topics
General Commands Recognized by the Boundary/Excitations Module
Script Commands for Creating and Modifying Boundaries in Maxwell
Script Commands for Creating and Modifying Excitations in Maxwell
GetDisplacementCurrent
GetEddyEffect
GetExcitations
GetExcitationsOfType
GetHybridRegions
GetHybridRegionsOfType
GetNumBoundaries
GetNumBoundariesOfType
GetNumExcitations
GetNumExcitationsOfType
ReassignBoundary
RemoveAssignmentFromBoundary
RenameBoundary
ReprioritizeBoundaries
AddAssignmentToBoundary
Adds a new geometry assignment to a boundary.
UI Access N/A
"Faces:=", <AssignmentFaces>)
DeleteAllBoundaries
Deletes all boundaries.
VB Syntax DeleteAllBoundaries
VB Example oModule.DeleteAllBoundaries
DeleteAllExcitations
Deletes all excitations.
VB Syntax DeleteAllExcitations
VB Example oModule.DeleteAllExcitations
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.
GetBoundaryAssignment
Gets a list of face IDs associated with the given boundary or excitation assignment.
UI Access N/A
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
GetCoreLossEffect
Use: Returns whether the core loss is included in the simulation for the object. Applicable to 2D and 3D Transient and to 3D Eddy Cur-
rent solution types.
Command: None
Syntax: GetCoreLossEffect(<ObjectName>)
Return Value: Returns true or false based on the check box selection. True if checked.
Parameters: <ObjectName>
Type:<string>
Object name.
For example: "inner_arm"
Example: oModule.GetCoreLossEffect("inner_arm")
GetCoreLossEffectOnField
Use: Returns whether the core loss effect on the field is being considered. Applicable to 2D and 3D Transient solution types.
Command: None
Syntax: GetCoreLossEffectOnField()
Return Value: Returns true or false based on the check box selection. True if checked.
Parameters: None
Example: oModule.GetCoreLossEffectOnField()
GetDisplacementCurrent
Use: Returns whether the displacement current calculation is activated for the object. Applicable to Eddy Current solution type.
Command: None
Syntax: GetDisplacementCurrent(<ObjectName>)
Return Value: Returns true or false based on the check box selection. True if checked.
Parameters: <ObjectName>
Type:<string>
Object name.
For example: "coil1"
Example: oModule.GetDisplacementCurrent("coil1")
GetEddyEffect
Use: Returns whether the eddy effect is activated for the object. Applicable to 2D and 3D Transient and to Eddy Current solution
types.
Command: None
Syntax: GetEddyEffect(<ObjectName>)
Return Value: Returns true or false based on the given object name. True if checked.
Parameters: <ObjectName>
Type:<string>
Object name.
For example: "inner_arm"
Example: oModule.GetEddyEffect("outer_arm")
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.
VB Syntax GetExcitations
VB Example oModule.GetExcitations
GetExcitationsOfType
Gets excitation names of the given type.
UI Access N/A
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
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
GetNumExcitationsOfType
Gets the number of excitations of the given type, including all defined modes and terminals of ports.
UI Access N/A
ReassignBoundary
Specifies a new geometry assignment for a boundary.
Parameters Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
"NAME:PerfH12",
"Faces:=", [17]
])
RemoveAssignmentFromBoundary
Removes a geometry assignment from a boundary.
Parameters Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
oModule.RemoveAssignmentFromBoundary(
[
Python Example "NAME:Rad1",
"Faces:=", [11]
])
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.
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.
"PerfE1",
"PerfH1"])
l EditIndependent
l EditDependent
l AssignRadiation
l EditRadiation
l AssignImpedance
l EditImpedance
l AssignTangentialHField
l EditTangentialHField
l AssignVectorPotential
l EditVectorPotential
l AssignCylindricalHField
l EditCylindricalHField
l AssignResistiveSheet
l EditResistiveSheet
l AssignTouching
l EditTouching
l AssignThinLayer
l EditThinLayer
AssignCylindricalHField
Use: Creates an H-Field boundary on a cylindrical face.
Command: Maxwell>Boundaries>Assign>Tangential H Field
Syntax:AssignCylindricalHField <CylindricalHFieldArray>
Return Value: None
Parameters: <CylindricalHFieldArray>
Array("NAME:<BoundName>",
"ComponentPhiReal:=", <value>,
"ComponentPhiImg:=", <value>,
"ComponentZReal:=", <value>,
"ComponentZImg:=", <value>,
"ReverseZ:=", <bool>,
"Origin:=", <LineEndPoint>)
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentObjects>)
Example: oModule.AssignCylindricalHField Array("NAME:TangentialHField4", "ComponentPhiReal:=", _
"1", "ComponentPhiImg:=", "2", "ComponentZReal:=", "3", _ "ComponentZImg:=", "4", "ReverseZ:=",
false, _ "ReferencePosDefined:=", true, "Origin:=", _ Array("1.36568542494924mm", "0.6mm",
"0mm"), _
"Faces:=", Array(75))
AssignDependent (2D)
Use: Creates a dependent boundary.
Command: Maxwell2D>Boundaries>Assign>Matching>Dependent
Syntax:AssignDependent ([DependentArray])
Return Value: None
Parameters: <DependentArray>
["NAME:<BoundName>",
Either:
l "Edges:=" , <Edge ID list>, the IDs of the edges which the boundary is assigned to.
l "Objects:=" , <list of objects>, the name(s) of the polylines the boundary is assigned to.
"ReverseU:=", <bool>,
"Independent:=", <string, name of independent>,
"RelationIsSame:=", <bool>
(where:bool == True for Hdep = Hind, False for Hdep = -Hind, and so on)
]
Example command applied to polyline:
oModule.AssignDependent(["NAME:Dependent1",
"Objects:=" , ["Dependent"],
"ReverseU:=" , False,
"Independent:=" , "Independent1",
"RelationIsSame:=" , False])
Example command applied to edge:
oModule.AssignDependent(["NAME:Dependent1",
"Edges:=" , [8],
"ReverseU:=" , True,
"Independent:=" , "Independent1",
"RelationIsSame:=" , False])
AssignDependent (3D)
Use: Creates a dependent boundary.
Command: Maxwell3D>Boundaries>Assign>Matching>Dependent
Syntax:AssignDependent ([DependentArray])
Return Value: None
Parameters: <DependentArray>
[("NAME:<BoundName>",
Either:
l "Faces:=" , <Face ID list>, the IDs of the faces which the boundary is assigned to.
l "Objects:=" <list of objects>, the name(s) of the sheets the boundary is assigned to.
AssignFluxTangential
Assigns a Flux Tangential boundary condition to the selected face(s).
oModule.AssignFluxTangential Array("NAME:FluxTangential2",
VB Example
"Faces:=", Array(285, 313))
AssignImpedance (Maxwell)
Use: Creates an impedance boundary.
Command: Maxwell3D or Maxwell2D>Boundaries>Assign>Impedance
Syntax:AssignImpedance <ImpedanceArray>
Array("NAME:<BoundName>",
<CoordSysArray>,
"ReverseV:=", <bool>,
Either:
l For 2D - <Edge ID list>: the IDs of the edges which the boundary is assigned to. The value
is a list of edge numbers.
For 2D, objects are Polylines. For 3D, objects can be sheets.
Example AssignIndependent 2D:
oModule.AssignIndependent(["NAME:Independent1",
"Edges:=" , [20], "ReverseU:=" , False])
Example command applied to polyline:
oModule.AssignIndependent(["NAME:Independent1",
"Objects:=" , ["Independent"],"ReverseU:=" , False])
Example AssignIndependent 3D:
oModule.AssignIndependent(["NAME:Independent1",
"Faces:=" , [25],["NAME:CoordSysVector",
"Origin:=" , ["0mm","0mm","82.1090449266692mm"],
"UPos:=" , ["0mm","60mm","82.1090449266692mm"]],
"ReverseV:=" , False])
Example command applied to sheet:
oModule.AssignIndependent(["NAME:Independent1",
"Objects:=" , ["IndependentSheet"],
["NAME:CoordSysVector","Origin:=" , ["0mm","0mm","0mm"],
"UPos:=" , ["60mm","0mm","0mm"]],
"ReverseV:=" , True])
AssignInsulating
Use: Creates an insulating boundary.
Command: Maxwell3D>Boundaries>Assign>Insulating
Syntax:AssignInsulating <InsulatingArray>
Return Value: None
Parameters: <InsulatingArray>
Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>
"Permittivity:=", <double value>
"Thickness:=", <value><unit>
Example: oModule.AssignInsulating Array("NAME:Insulating2", "Faces:=", Array(9), "Per-
mittivity:=", "3", "Thickness:=", "5mm")
AssignRadiation (Maxwell)
Use: Creates a radiation boundary.
Command: Maxwell3D>Boundaries>Assign>Radiation
Syntax:AssignRadiation <RadiationArray>
Return Value: None
Parameters: <RadiationArray>
Array("NAME:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example: oModule.AssignRadiation Array("NAME:Radiation1", _ "Faces:=", Array(12, 11))
AssignResistiveSheet
Use: For Maxwell 3D Magnetostatic, Eddy Current and Transient designs, creates a resistive sheet boundary between two con-
ductors.
For 3D Eddy Current and Transient designs, the user specifies a Boundary name, boundary face ID list, and a resistance value with
unit.
For 3D Magnetostatic designs, the user specifies a Boundary name, boundary face ID list, and nonlinear anode and cathode coef-
ficients.
Note: For more information on the nonlinear resistive sheet boundary condition, see Assigning a Resistive Sheet Bound-
ary for the 3D Magnetostatic Solver in the Maxwell Help.
oModule.AssignResistiveSheet(
[
"NAME:ResistiveSheet1",
Python Example
"Objects:=" , ["Circle1"],
"Nonlinear:=" , True,
"AnodeParA:=" , "300000000",
"AnodeParB:=" , "5",
"AnodeParC:=" , "110000000000000",
"AnodeParD:=" , "2",
"CathodeParA:=" , "300000000",
"CathodeParB:=" , "10",
"CathodeParC:=" , "110000000000000",
"CathodeParD:=" , "2"
])
AssignSymmetry (Maxwell)
Use: Creates a symmetry boundary.
Command: Maxwell3D or Maxwell2D>Boundaries>Assign>Symmetry
Syntax:AssignSymmetry <SymmetryArray>
Return Value: None
Parameters: <SymmetryArray>
Array( "NAME:<BoundName>",
"IsOdd:=",<bool>,//true for odd, false for even
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example: oModule.AssignSymmetry Array("NAME:Symmetry1", _ "IsOdd:=", true, "Faces:=", Array(35))
AssignTangentialHField
Use: Creates an H-Field boundary on a planar face.
"NAME:ThinLayer1",
"Thickness:=", "1mm"
])
AssignTouching
Use: For Maxwell 3D Transient designs with translational motion with a moving part touching stationary part, assigns a touching
boundary condition to a face of the moving part that touches a stationary part.
AssignVectorPotential
Use: For Maxwell 2D Eddy Current, Magnetostatic, and Transient designs, assigns a vector potential boundary condition to the spe-
cified edges.
])
AssignZeroTangentialHField
Use: Creates a zero tangential H-Field boundary.
Command: Maxwell>Boundaries>Assign>Zero Tangential H Field
Syntax:AssignZeroTangentialHField <ZeroTangentialHFieldArray>
Return Value: None
Parameters: <ZeroTangentialHFieldArray>
Array("NAME:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example: oModule.AssignZeroTangentialHField Array("NAME:ZeroTangentialHField1", "Faces:=", Array
(7))
EditCylindricalHField
Use: Edits a cylindrical H-Field boundary.
Command: Double-click the boundary in the project tree to edit it.
Syntax:EditCylindricalHField <BoundName> <CylindricalHFieldArray>
Return Value: None
Note: Refer to AssignDependent (2D) and AssignDependent (3D) examples for syntax details.
EditFluxTangential
Edits a Flux Tangential boundary condition name.
UI Access Double-click the Flux Tangential Boundaries item in the Project tree to edit the name.
oModule.EditFluxTangential "FluxTangential1",
VB Example
Array("NAME:FluxTangential_New")
EditImpedance (Maxwell)
Use: Edits an impedance boundary.
Command: Double-click the boundary in the project tree to edit it.
Syntax:EditImpedance <BoundName> <ImpedanceArray>
Return Value: None
Parameters: <BoundName>, string name of boundary
<ImpedanceArray>
Array("NAME:<BoundName>",
"Faces:=", <AssignmentFaces>)
"Conductivity:=",<value>,
"Permeability:=", <value>,
"UseMaterial:=", <true or false>,
"MaterialName:=", <Material name>,
"NonlinearCoefficient:=", <number>,
"IsPermeabilityNonlinear:=", <true or false>,
"Objects:=", <AssignmentObjects>,
Example: (UseMaterial= true)
EditInsulating
Use: Edits an insulating boundary.
Command: Double-click the boundary in the project tree to edit it.
Syntax:EditInsulating <BoundName> <InsulatingArray>
Return Value: None
Parameters: <BoundName> , string name of boundary
<InsulatingArray>
Array("Name:<BoundName>",
"Permittivity:=", <double value>
"Thickness:=", <value><unit>
Example: oModule.EditInsulating "Insulating2", Array("NAME:Insulating2", "Permittivity:=", "5",
"Thickness:=", "7meter")
EditRadiation (Maxwell)
Use: Edits a radiation boundary.
Command: Double-click the boundary in the project tree to edit it.
Syntax:EditRadiation <BoundName> <RadiationArray>
Return Value: None
EditResistiveSheet
Use: For Maxwell 3D Magnetostatic, Eddy Current, Transient designs, edits a resistive sheet boundary. A nonlinear boundary con-
dition can be used in a Maxwell 3D Magnetostatic design.
EditSymmetry
Modifies a symmetry boundary.
UI Access Double-click the symmetry boundary in the project tree to edit its settings.
])
EditTangentialHField
Use: Edits a tangential H-Field boundary.
Command: Double-click the boundary in the project tree to edit it.
Syntax:EditTangentialHField <BoundName> <TangentialHFieldArray>
Return Value: None
EditThinLayer
Use: For Maxwell 3D AC Conduction, 3D DC Conduction, 3D Magnetostatic, 3D Eddy Current, and 3D Transient designs, edit a thin
layer boundary.
boundary face ID array, and conductivity and thickness value with unit.
EditTouching
Use: For Maxwell 3D Transient designs with translational motion with a moving part touching stationary part, edits a touching bound-
ary condition.
UI Access Double-click a touching boundary condition in the Project Manager to open the Touching Boundary dialog box.
EditVectorPotential
Use: For Maxwell 2D Eddy Current, Magnetostatic, and Transient designs, edits a vector potential boundary condition.
UI Access
Double-click a vector potential boundary condition in the Project Manager to open the Vector Potential Bound-
ary dialog box.
<CoordinateSystem>)
oModule.EditVectorPotential Array("NAME:VectorPotential3",
VB Example "Edges:=", Array(21), "Phase:=", "60deg", "Value:=", "z+2",
"CoordinateSystem:=", "Global")
EditZeroTangentialHField
Use: Edits a zero tangential H-Field boundary.
Command: Double-click the boundary in the project tree to edit it.
Syntax:EditZeroTangentialHField <BoundName>, <PerfectEArray>
Return Value: None
l AssignCurrentGroup
l AssignFloating
l AssignSink
l AssignVoltage
l AssignVoltageAPhi
l AssignVolumeChargeDensity
l AssignVoltageDrop
l AssignVoltageDropGroup
l AssignVoltageGroup
l Assign Winding Group
l EditCharge
l EditCoilTerminal
l EditCurrent
l EditCurrentDensity
l EditCurrentDensityTerminal
l EditExternalCircuit
l EditFloating
l EditSink
l EditVoltage
l EditVoltageAPhi
l EditVolumeChargeDensity
l EditVoltageDrop
l EditWindingGroup
l SetCoreLoss
l SetEddyEffect
l SetMagnetizationCompute
l SetMinimumTimeStep
AddTerminalsToWinding
Use: Adds existing terminal(s) to the selected winding.
Command: Right-click a winding item in the project tree, and then select Add Terminals.
Syntax:AddTerminalsToWinding <AddTerminalsToWindingArray>
Return Value: None
Parameters: < AddTerminalsToWindingArray >
Array(" NAME:AddTerminalsToWinding", <BoundListArray>)
<BoundListArray> Array("NAME:BoundaryList",<CoilTerminalArray>)
Example:
oModule.AddTerminalstoWinding Array("NAME:AddTerminalsToWinding", _
Array("NAME:BoundaryList", Array("NAME:CoilTerminal1", _
"Point out of terminal:=", false, "Conductor number:=", _
"1", "Winding:=", "Winding1", "Faces:=", Array(12)), _
Array("NAME:CoilTerminal2", "Point out of terminal:=", _
false, "Conductor number:=", "1", "Winding:=", _
"Winding1", "Faces:=", Array(7))))
AssignCharge
Use: Creates a charge excitation.
Command: Maxwell>Excitations>Assign>Charge
Syntax:AssignCharge <ChargeArray>
Return Value: None
Parameters: <ChargeArray>
Array("NAME:<BoundName>",
"Value:=", <value>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example: oModule.AssignCharge Array("NAME:Charge1", "Value:=", _ "1", "Faces:=", Array(11))
AssignCoilGroup
Use: For Maxwell 2D designs, creates a group of coil excitations. The coil excitations can be assigned on 2D objects.
Select the desired objects (coils) on the model or in the History tree. Then, select Maxwell 2D> Excit-
ations>Assign>Coil to open the Coil Excitation dialog where you can enter the base Name for the group of
UI Access
excitations being created, the number of conductors, and the polarity to be assigned to each of the new excit-
ations.
Python Syntax AssignCoilGroup (CoilGroupArray, <NAME>, <Objects>, <Conductor number>, <Polarity type>)
oModule.AssignCoilGroup(["terminal_A_plus", "terminal_A_plus_1"],
[
Python Example "NAME:terminal_A_plus",
"Objects:=" , ["terminal_A_plus","terminal_A_plus_1"],
"Conductor number:=" , "10",
"PolarityType:=", Positive ])
AssignCoilTerminal
Use: Assigns 2D terminals
Command: Maxwell>Excitations>Assign>Coil Terminal
Syntax:AssignCoilTerminal <TerminalArray>
Parameters: <TerminalArray>
Array("NAME:AssignTerminals",
Array("Name:SourceList", Array("Name:<SourceName>",
"Excitation:=", <NetObject>, "Objects:=", <Assignment 2D>)),
Array("Name:SinkList", Array("Name:<SinkName>",
"Excitation:=", <NetObject>, "Objects:=", <Assignment 2D>)),
Select the desired objects (coils) on the model or in the History tree. Then, select Maxwell 3D> Excit-
ations>Assign>Coil Terminal to open the Coil Terminal Excitation dialog where you can enter the base
UI Access
Name for the group of excitations being created, the number of conductors, and use the Swap Direction button
to set the current direction to be assigned to each of the new excitations.
[
"NAME:CoilTerminal_1",
"Objects:=" , ["terminal_A_plus","terminal_A_plus_1"],
"Conductor number:=" , "10",
"Point out of terminal:=", False
])
AssignCurrent
Creates a current source.
UI Access Excitations>Assign>Current
<Point out of terminal> bool True sets the current direction out of the terminal
AssignCurrentDensity
Use: Creates a current density excitation.
Command: Maxwell>Excitations>Assign>Current Density
Syntax:AssignCurrentDensity <CurrentDensityArray>
Return Value: None
Parameters: <CurrentDensityArray>
Array("NAME:<BoundName>",
"CurrentDensityX:=", <value>,
"Phase:=", <value>,//for eddy current solution type
"CurrentDensityY:=", <value>,
"CurrentDensityZ:=", <bool>,
"CoordinateSystem Name:=", <string>,
"CoordinateSystem Type:=", <string>,
"Objects:=", <AssignmentObjects>)
Example: oModule.AssignCurrentDensity Array("NAME:CurrentDensity1", "CurrentDensityX:=", _
"1", "CurrentDensityY:=", "2", "CurrentDensityZ:=", _ "3", "CoordinateSystem Name:=", "Global",
_ "CoordinateSystem Type:=", "Cartesian", "Objects:=", _ Array("Box1"))
Example: oModule.AssignCurrentDensity Array("NAME:CurrentDensity1", "Phase:=", "12", _ "Cur-
rentDensityX:=", "1", "CurrentDensityY:=", _
"2", "CurrentDensityZ:=", "3", _
"CoordinateSystem Name:=", "Global",
"CoordinateSystem Type:=", "Cartesian", "Objects:=", _ Array("Box1"))
AssignCurrentDensityGroup
Use: Creates a group of current density excitations.
Command: Maxwell>Excitations>Assign>Current Density
Syntax:AssignCurrentDensityGroup <BoundNameArray> <CurrentDensityArray>
Return Value: None
AssignCurrentDensityTerminal
Use: Creates a current density terminal excitation.
Command: Maxwell>Excitations>Assign>Current Density Terminal
Syntax:AssignCurrentDensityTerminal <CurrentDensityTerminalArray>
Return Value: None
Parameters: <CurrentDensityTerminalArray>
Array("Name:<BoundName>",
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example: oModule.AssignCurrentDensityTerminal Array("NAME:CurrentDensityTeminal1", "Faces:=",
Array(7))
AssignCurrentDensityTerminalGroup
Use: Creates a group of current density terminal excitations.
Command: Maxwell>Excitations>Assign>Current Density Terminal
Syntax:AssignCurrentDensityTerminalGroup <BoundNameArray> <CurrentDensityTerminalArray>
Return Value: None
AssignCurrentGroup
Use: Creates a group of current excitations.
Command: Maxwell>Excitations>Assign>Current
Syntax:AssignCurrentGroup <BoundNameArray> <CurrentArray>
Return Value: None
AssignFloating
Use: Creates a floating excitation.
Command: Maxwell>Boundaries>Assign>Floating
Syntax:AssignFloating <FloatingArray>
Return Value: None
Parameters: <FloatingArray>
Array("NAME:<BoundName>",
"Value:=", <value>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example: oModule.AssignFloating Array("NAME:Floating1", _ "Value:=", "1", "Faces:=", Array(11))
AssignSink (Maxwell)
Use: Creates a sink.
Command: Maxwell>Excitations>Assign>Sink
Syntax:AssignSink <SinkArray>
Return Value: None
Parameters: <SinkArray>
Array("NAME:<SinkName>",
"Faces:=", <AssignmentFaces>)
UI Access Excitations>Assign>Voltage
AssignVoltageDrop
Use: Creates a voltage drop excitation.
Command: Maxwell>Excitations>Assign>Voltage Drop
Syntax:AssignVoltageDrop <VoltageDropArray>
Return Value: None
Parameters: <VoltageDropArray>
Array("NAME:<BoundName>",
"Voltage Drop:=", <value>,
"Point out of terminal:=", <bool>,
"Objects:=", <AssignmentObjects>,
"Faces:=", <AssignmentFaces>)
Example: oModule.AssignVoltageDrop Array("NAME:VoltageDrop1", _ "Voltage Drop:=", "1kV", "Point
out of terminal:=", _ true, "Faces:=", Array(7))
AssignVoltageDropGroup
Use: Creates a group of voltage drop excitations.
Command: Maxwell>Excitations>Assign>Voltage Drop
Syntax:AssignVoltageDropGroup <BoundNameArray> <VoltageDropArray>
Return Value: None
AssignVoltageGroup
Use: Creates a group of voltage excitations. The size of the bound name array must be identical to the size of assignment. This com-
mand is not supported for the Electric solution types.
Command: Maxwell>Excitations>Assign>Voltage
UI Access placeholder
Python Syntax EditCurrent_1 (<NAME>, <Current>, <IsSolid>, <CurrentExcitationModel>, <Point out of terminal>)
oModule.EditCurrent("Current7",
[
"NAME:Current7",
"Current:=" , "0mA",
Python Example
"IsSolid:=" , True,
"CurrentExcitationModel:=", 1,
"Point out of terminal:=", False
])
EditCurrentDensity
Use: Edits a current density excitation.
Command: Double-click the excitation in the project tree to edit it.
Syntax:EditCurrentDensity <BoundName> <CurrentDensityArray>
Return Value: None
EditCurrentDensityTerminal
Use: Edits a current density terminal excitation.
Note:Double-click the excitation in the project tree to edit it.
Syntax:EditCurrentDensityTerminal <BoundName> <CurrentDensityTerminalArray>
Return Value: None
EditExternalCircuit
Use: Edits the external circuit for the winding. The SourceNameArray and SourceTypeArray parameters must be of the same size and
be a one-to-one match.
Command: Maxwell>Excitations>External Circuit>Edit External Circuit
Syntax:EditExternalCircuit <fileName> <SourceNameArray> <SourceTypeArray>
Return Value: None
Parameters: <SourceNameArray> Array(<string>)
<SourceTypeArray> Array(<srcTypeEnum>)<srcTypeEnum>
1- Time dependent 2-Position dependent 3- Speed dependent
Example: oModule.EditExternalCircuit "C:\TestProjects\Tdslink\extnlckt00.ckt", Array("VC1", _
"VSA1_0", "VSA1_1", "VSA1_2"), Array(1, 2, 1, 3)
EditFloating
Use: Edits a floating excitation.
Command: Double-click the excitation in the project tree to edit it.
Syntax:EditFloating <BoundName> <FloatingArray>
Return Value: None
EditSink
Use: Edits a sink excitation.
Command: Double-click the excitation in the project tree to edit it.
Syntax:EditSink <BoundName> <SinkArray>
Return Value: None
EditVoltage
Modifies a voltage source.
UI Access Double-click the excitation in the project tree to modify its settings.
EditVoltageAPhi
Edits a voltage excitation for 3D transient A-Phi solutions.
UI Access Double-click the Voltage Excitations item in the Project tree to edit.
EditVoltageDrop
Use: Edits a voltage drop excitation.
Command: Double-click the excitation in the project tree to edit it.
Syntax:EditVoltageDrop <BoundName> <VoltageDropArray>
<objectName> string
Example: oModule.SetCoreLoss Array("Box1", "Box2"), true
SetEddyEffect
Use: Sets the eddy effect for an excitation.
Command: Maxwell>Excitations>Set Eddy Effects
Syntax:SetEddyEffect <EddyEffectSettingArray>
Return Value: None
Parameters:
<EddyEffectSettingArray>
Array("NAME:Eddy Effect Setting", <EddyEffectVectorArray>)
<EddyEffectVectorArray>
Array("NAME:EddyEffectVector", Array<EddyEffectDataArray>)
<EddyEffectDataArray>
Array(("NAME:Data",
"Object Name:=", <string>,
"Eddy Effect:=", <bool>,
"DisplacementCurrent:=", <bool>)
Example:
oModule.SetEddyEffect Array("NAME:Eddy Effect Setting", _
Array("NAME:EddyEffectVector", Array("NAME:Data", _
"Object Name:=", "Box1", "Eddy Effect:=", true, _
"Displacement Current:=", true), Array("NAME:Data", _
"Object Name:=", "Box1_1", "Eddy Effect:=", true, _
"Displacement Current:=", false)))
Note:
In the following commands, all named data can be included/excluded as desired and may appear in any order.
l AssignWindingGroup
l EditWindingGroup
l AddTerminalsToWinding
l EditExternalCircuit
l SetCoreLoss
l SetEddyEffect
l SetMinimumTimeStep
SetMinimumTimeStep
Use: Sets the minimum time step for an external circuit excitation.
Command: Maxwell>Excitations>External Circuit>Set Minimum Time Step
Syntax:SetMinimumTimeStep <value>
Return Value: None
Parameters: None
Example: oModule.SetMinimumTimeStep "1ps"
ShowWindow
Use: Sets up a Y connection among voltage windings. It will connect their negative voltage terminals to a common node of the circuit.
Only one Y Connection is allowed per design.
Syntax:SetupYConnection <YConnectionArray>
Return Value: None
Parameters: <YConnectionArray>
Type: Array of strings
When the YConnectionArray is empty, it is used to delete the Y Connection.
Array(<YConnection>)
<YConnection>
Type: Array of strings
Array("Name:YConnection", "Windings:=", <WindingNames>)
<WindingNames>
Type: String
A list of winding names separated by commas
VB Example:
Add Y Connection:
Add Y Connection
oModule.SetupYConnection(
[
[
"NAME:YConnection",
"Windings:=" , "Winding1,Winding2,Winding3,Winding4"
Python Example
]
])
Delete Y Connection
oModule.SetupYConnection()
11-76
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
"Length2")
GetOperationNames
Gets the names of mesh operations defined in a design.
UI Access N/A
RenameOp
Renames a mesh operation.
UI Access Right-click the mesh operation in the project tree, and then click Rename on the shortcut menu.
EditEdgeCutLayerOp
EditLengthOp
EditModelResolutionOp
EditSkinDepthOp
EditTrueSurfOp
"InitialMeshSettings " on page 12-35
AssignCylindricalGapOp
3D Designs
For 3D designs, assigns a cylindrical gap 3D mesh operation to enable use of Clone Mesh and associated Band Mapping Angle. For
Maxwell 2D designs, see below.
=======
Assigns a cylindrical gap 3D mesh operation to enable use of Clone Mesh and associated Band Mapping Angle.
UI Access Maxwell3D > Mesh > Assign Mesh Operation > Cylindrical Gap Treatment
"StaticSideLayers:=", 3, _
"Objects:=", Array("Box2"))
oModule.AssignCylindricalGapOp _
Array("NAME:CylindricalGap1", _
"CloneMesh:=", false, _
"Objects:=", Array("Box2"))
Maxwell 2D Designs
For Maxwell 2D Designs, assigns a cylindrical gap 2D mesh operation.
UI Access Maxwell 2D > Mesh > Assign Mesh Operation > Cylindrical Gap Treatment
([
"NAME:CylindricalGap1",
"UseBandMappingAngle:=" , True,
"BandMappingAngle:=" , "3deg",
"Objects:=", ["Circle2"]
])
AssignDensityControlOp
Assigns a density control mesh operation to specify refinement of clone mesh.
UI Access Maxwell3D > Mesh > Assign Mesh Operation > Inside Selection > Clone Mesh Density
"RefineInside:=", <bool>,
"Objects:=", <AssignmentObjects>,
"RestrictMaxElemLength:=", <bool>,
"MaxElemLength:=", <value>,
"RestrictLayersNum:=", <bool>,
"LayersNum:=", <integer>)
RefineInside
If true, Objects should be specified. Implies
apply restrictions to tetrahedra inside the
object.
If false, Faces and/or Objects can be spe-
cified. Implies apply restrictions to triangles
on the surface of the face or object.
RestrictMaxElemLength
If true, MaxElemLength should be specified.
RestrictLayersNum
If true, LayersNum should be specified.
AssignEdgeCutLayerOp
Assigns the edge cut mesh operation to specify refinement of layer mesh.
UI Access Maxwell 3D > Mesh > Assign Mesh Operation > Inside Selection > Edge Cut Based
Parameters Array("NAME:<OpName>",
"Objects:=", <AssignmentObjects>,
"Layer Thickness:=", <value>)
Array("NAME:EdgeCut1", _
"Objects:=", Array("Rotor"), _
"Layer Thickness:=", "0.55mm")
AssignLengthOp
Assigns length-based operations to the selection.
UI Access Maxwell 3D > Mesh > Assign Mesh Operation > On Selection | Inside Selection > Length Based
oModule.AssignLengthOp
([
"NAME:Length1",
"RefineInside:=", False,
"Edges:=", [58,73],
"RestrictElem:=", True,
"NumMaxElem:=", 1000,
"RestrictLength:=", True,
"MaxLength:=", "1mm"
"ApplyToInitialMesh:=", True
])
"RestrictLength:=", true,
"MaxLength:=", "1mm")
"ApplyToInitialMesh:=", True
oModule.AssignLengthOp Array("NAME:Length1", _
"RefineInside:=", false,
"Edges:=", Array(58,73),
"RestrictElem:=", true,
"NumMaxElem:=", 1000,
"RestrictLength:=", true,
"MaxLength:=", "1mm")
"ApplyToInitialMesh:=", True
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 Maxwell 3D > Mesh > Assign Mesh Operation > Model Resolution
Parameters Array("NAME:<ModelResName>",
"Objects:=", <array of object names>,
"UseAutoLength:=", <boolean>,
"DefeatureLength:=", "<value><units>")
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 Maxwell 3D > Mesh > Assign Mesh Operation > On Selection > Skin Depth Based
"NAME:SkinDepth1",
"Faces:=", [7],
"RestrictElem:=", True,
"NumMaxElem:=", 1000,
"SkinDepth:=", "1mm",
"SurfTriMaxLength:=", "1mm",
"NumLayers:=", 2
])
AssignTrueSurfOp
Assigns a true surface-based mesh operation on the selection.
UI Access Maxwell 3D > Mesh > Assign Mesh Operation > Surface Approximation
<RadioOption>
Type: <int>
0: Ignore
1: Use defaults
2: Specify the value
oModule.AssignTrueSurfOp
([
"NAME:TrueSurf1",
"Faces:=", [9],
"SurfDevChoice:=", 2,
Python Example
"SurfDev:=", "0.04123105626mm",
"NormalDevChoice:=", 2,
"NormalDev:=", "15deg",
"AspectRatioChoice:=", 1
])
EditCylindricalGapOp
Modifies an existing cylindrical gap 3D mesh operation to enable/disable use of Clone Mesh and associated Band Mapping Angle.
Modifies an existing cylindrical gap 2D mesh operation to enable/disable use of Band Mapping Angle.
UI Access Double-click the operation in the project tree to modify its settings.
"StaticSideLayers:=", 3)
Maxwell 2D Example
oModule.EditCylindricalGapOp "CylindricalGap1", _
Array("NAME:CylindricalGap1",
"UseBandMappingAngle:=", true,
"BandMappingAngle:=", 3deg)
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.
"Faces:=", <AssignmentFaces>,
"Edges:=", <AssignmentEdges>,
"RestrictElem:=", <bool>,
"NumMaxElem:=", <integer>,
"RestrictLength:=", <bool>,
"MaxLength:=", <value>
"ApplyToInitialMesh:=", <bool>)
RefineInside
If true, Objects should be specified. Implies apply restrictions to tet-
rahedra inside the object.
If false, Edges, 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.
[
"NAME:Length1",
"RefineInside:=", True,
"Objects:=", ["Circle2", "Rectangle1"],
"RestrictElem:=", False,
"NumMaxElem:=", 1000,
"RestrictLength:=", True,
"MaxLength:=", "2mm",
"ApplyToInitialMesh:=", False
])
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.
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.
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
"AspectRatio:=", 10)
InitialMeshSettings
Assigns a true surface-based mesh operation to the selection.
oModule.InitialMeshSettings
([
"NAME:MeshSettings",
[
"NAME:GlobalSurfApproximation",
"CurvedSurfaceApproxChoice:=", "UseSlider",
"SliderMeshSettings:=" , 5
],
[
"NAME:GlobalCurvilinear",
Python Example
"Apply:=", False
],
[
"NAME:GlobalModelRes",
"UseAutoLength:=", True
],
[
"NAME:GlobalLengthMeshSetup",
"RefineInside:=", True,
"ID:=", -1,
"Type:=", "LengthBased",
"RestrictElem:=", False,
"NumMaxElem:=", "1000",
"RestrictLength:=", True,
"MaxLength:=", "45mm",
"ApplyToInitialMesh:=", True,
"IsGlobal:=", True
],
"MeshMethod:=", "Auto",
"UseLegacyFaceterForTAUVolumeMesh:=", False,
"DynamicSurfaceResolution:=", False,
"UseFlexMeshingForTAUvolumeMesh:=", False,
"UseAlternativeMeshMethodsAsFallBack:=", False,
"AllowPhiForLayeredGeometry:=", True
])
12-40
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
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
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.
EditSetup [Maxwell]
Modifies an existing solution setup.
UI Access Double-click a solution setup in the Project Manager tree to modify its settings.
Note: For Eddy Current designs, Frequency also supports use of variables and expressions.
3D Eddy Current:
Python Example
oModule.EditSetup("EddyCurrent",
[
"NAME:EddyCurrent",
"Enabled:=" , True,
[
"NAME:MeshLink",
"ImportMesh:=" , False
],
"MaximumPasses:=" , 4,
"MinimumPasses:=" , 2,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"SolveFieldOnly:=" , False,
"PercentError:=" , 0.1,
"SolveMatrixAtLast:=" , True,
"UseNonLinearIterNum:=" , False,
[
"NAME:ExpressionCache",
[
"NAME:CacheItem",
"Title:=" , "eddy_loss1",
"Expression:=" , "eddy_loss",
"Intrinsics:=" , "Phase=\'0deg\'",
"ReportType:=" , "Fields",
[
"NAME:ExpressionContext"
]
]
],
"UseCacheFor:=" , ["Pass"],
"UseIterativeSolver:=" , False,
"RelativeResidual:=" , 0.0001,
"NonLinearResidual:=" , 0.0001,
"SmoothBHCurve:=" , False,
"Frequency:=" , "200Hz",
"HasSweepSetup:=" , False,
"UseHighOrderShapeFunc:=", False,
"UseMuLink:=" , False,
"LossAdaptiveCtrl:=" , "0.3"
])
3D Eddy Current:
oModule.EditSetup "Setup1",
Array("NAME:Setup1", "Enabled:=", true,
Array("NAME:MeshLink", "ImportMesh:=", false),
"MaximumPasses:=", 10,
"MinimumPasses:=", 2,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"SolveFieldOnly:=", false,
"PercentError:=", 1,
"SolveMatrixAtLast:=", true,
"UseNonLinearIterNum:=", false,
"UseCacheFor:=", Array("Pass"),
"UseIterativeSolver:=", false,
"RelativeResidual:=", 1E-05,
"NonLinearResidual:=", 0.0001,
VB Example "SmoothBHCurve:=", true,
"Frequency:=", "60Hz",
"HasSweepSetup:=", true,
Array("NAME:SweepRanges",
Array("NAME:Subrange",
"RangeType:=", "LinearStep",
"RangeStart:=", "10Hz"
"RangeEnd:=", "1000Hz",
"RangeStep:=", "10Hz"),
Array("NAME:Subrange",
"RangeType:=", "SinglePoints",
"RangeStart:=", "1000Hz",
"RangeEnd:=", "1000Hz",
"SaveSingleField:=", false)),
"SaveAllFields:=", true,
"UseHighOrderShapeFunc:=", false,
"UseMuLink:=", false)
"SaveFieldsType:=", "None",
"UseNonLinearIterNum:=", false,
"CacheSaveKind:=", "Count",
"NumberSolveSteps:=", 1,
"RangeStart:=", "0s",
"RangeEnd:=", "0.1s")
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"SolveFieldOnly:=", false,
"PercentError:=", 1,
"SolveMatrixAtLast:=", true,
"UseOutputVariable:=", false,
"PreAdaptMesh:=", false)
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>
<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, _
ExportIcepak
Use: Exports Icepak data to the specified output directory.
Command: Right-click a setup under Analysis in the project tree, and select Create Icepak Design. From the dialog box, select an
appropriate solution setup and variation, enter the path to the output dierctory, and click the OK button.
Syntax: ExportIcepak <SetupName>, <Variation>, <Output Directory>
Return Value: None
Parameters: <SetupName>
Type: string
Setup name.
<Variation>
Type: string
Variation values.
<Output Directory>
Type: string
Path to the output directory in which the Icepak design files will be saved.
Example: oModule.ExportIcepak "Setup1", "air_gap=’1mm’ diameter=’120mm", "D:\Work\Icepak\"
ExportSolnData
Use: Exports solution data to a file.
Command: Right-click a parameter setup under Parameters in the project tree, and select ViewSolution. From the dialog box,
select an appropriate solution type, and click the Export Solution button.
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
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
InsertSetup [Maxwell]
Use: Adds a new solution setup.
Command: Maxwell 3D or Maxwell 2D > Analysis Setup > Add Solution Setup
Syntax: InsertSetup <SetupType>, <AttributesArray>
Return Value: None
Parameters:
<SetupType>
Type: <string>
Possible values for 3D designs are: "Magnetostatic", "EddyCurrent", "Transient", "Electrostatic", "DCConduction", "Elec-
troDCConduction",
"ElectricTransient", and "ACConduction".
Possible values for 2D designs are: "Magnetostatic", "EddyCurrent", "Transient", "Electrostatic",
"ACConduction", "DCConduction".
<AttributesArray>
Array("NAME:<SetupName>", <NamedParameters>)
<NamedParameters>
The named parameters vary according to the setup type and settings selected for a setup. Please see the typical examples below for
each solution type. The parameters correspond to fields in the Setup dialog box. For example, here is a default dialog for a Maxwell 3D
Magnetostatic design.
Some of the attributes Array correspond to these fields on the General tab of the Setup.
oModule.InsertSetup "Magnetostatic", Array("NAME:Setup1",
"MaximumPasses:=", 10,
...
"SolveMatrixAtLast:=", true,
Other parameters correspond to fields in the Convergence tab of the Setup.
"MinimumPasses:=", 2,
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
Still other parameters correspond to fields in the Solver tab of the Setup.
"NonLinearResidual:=", 0.001,
UseNonLinearIterNum:=" , True,
"MinIterNum:=" , 5,
"MaxIterNum:=" , 10,
Each different example below corresponds to the fields for each different setup.
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=", 30,
"SolveFieldOnly:=", false,
"PercentError:=", 1,
"SolveMatrixAtLast:=", true,
"UseOutputVariable:=", false,
"PreAdaptMesh:=", false,
"UseNonLinearIterNum:=" , True,
"MinIterNum:=" , 5,
"MaxIterNum:=" , 10,
"NonLinearResidual:=", 0.001,
"MuNonLinearBH:=", true,
"ComputeHc:=", false,
"HcNonLinearBH:=", true,
"UserOverrideMu:=", true,
"UserExePath:=", "E:\views\projects\ucp.exe",
"UserExeArg:=", "-3D")
"MinimumConvergedPasses:=", 1,
"PercentRefinement:=" , 30,
"SolveFieldOnly:=" , False,
"PercentError:=" , 0.1,
"SolveMatrixAtLast:=" , True,
"UseNonLinearIterNum:=" , False,
[
"NAME:ExpressionCache",
[
"NAME:CacheItem",
"Title:=" , "eddy_loss1",
"Expression:=" , "eddy_loss",
"Intrinsics:=" , "Phase=\'0deg\'",
"ReportType:=" , "Fields",
[
"NAME:ExpressionContext"
]
]
],
"UseCacheFor:=" , ["Pass"],
"UseIterativeSolver:=" , False,
"RelativeResidual:=" , 0.0001,
"NonLinearResidual:=" , 0.0001,
"SmoothBHCurve:=" , False,
"Frequency:=" , "200Hz",
"HasSweepSetup:=" , False,
"UseHighOrderShapeFunc:=", False,
"UseMuLink:=" , False,
"LossAdaptiveCtrl:=" , "0.3"
])
"ThermalFeedback:=", true,
"Frequency:=", "60Hz",
Note: For Eddy Current designs, Frequency also supports use of variables and expressions.
"HasSweepSetup:=", true,
Array("NAME:SweepRanges", Array("NAME:Subrange", "RangeType:=", "LinearStep", "RangeStart:=",
"10Hz", "RangeEnd:=", "1000Hz", "RangeStep:=", "10Hz"),
Array("NAME:Subrange", "RangeType:=", "SinglePoints", "RangeStart:=", "1000Hz", "RangeEnd:=",
"1000Hz", "SaveSingleField:=", false)), "SaveAllFields:=", true,
"UseHighOrderShapeFunc:=", false)
"UseNonLinearIterNum:=", true,
"MinIterNum:=", 1,
"MaxIterNum:=", 100,
"UseIterativeSolver:=", false,
"RelativeResidual:=", 1E-06,
"NonLinearResidual:=", 0.001,
"Frequency:=", "60Hz",
"HasSweepSetup:=", false)
"SolveMatrixAtLast:=" , True,
"UseNonLinearIterNum:=" , True,
"MinIterNum:=" , 1,
"MaxIterNum:=" , 100,
"UseIterativeSolver:=" , False,
"RelativeResidual:=" , 1E-06,
"NonLinearResidual:=" , 0.001,
"Frequency:=" , "60Hz",
"HasSweepSetup:=" , False
])
"UserOverrideMu:=", true,
"UserExePath:=", "E:\views\projects\ucp.exe",
"UserExeArg:=", "-3D")
Note: For Eddy Current designs, Frequency also supports use of variables and expressions.
"NonLinearResidual:=", 0.0001,
"HasSweepSetup:=", false)
"StopTime:=", "0.02s",
"TimeStep:=", "0.0005s",
"OutputError:=", false,
"OutputPerObjectCoreLoss:=", true,
"OutputPerObjectSolidLoss:=", false,
"UseControlProgram:=", false,
"ControlProgramName:=", "",
"ControlProgramArg:=", " ",
"CallCtrlProgAfterLastStep:=", false,
"FastReachSteadyState:=", false,
"FrequencyOfAddedVoltageSource:=", "60Hz",
"AutoDetectSteadyState:=", false,
"StopCriterion:=", "0.005",
"IsGeneralTransient:=", true,
"IsAutoSubDivision:=", true,
"HasSweepSetup:=", true,
"SweepSetupType:=", "LinearStep",
"StartValue:=", "0s",
"StopValue:=", "0.1s",
"StepSize:=", "0.005s",
"UseNonLinearIterNum:=" , True,
"MinIterNum:=" , 5,
"MaxIterNum:=" , 10,
"UseAdaptiveTimeStep:=", false,
"InitialTimeStep:=", "0.002s",
"MinTimeStep:=", "0.001s",
"MaxTimeStep:=", "0.003s",
"TimeStepErrTolerance:=", 0.0001)
"PercentRefinement:=", 30,
"SolveFieldOnly:=", false,
"PercentError:=", 1,
"SolveMatrixAtLast:=", true,
"UseOutputVariable:=", false,
"PreAdaptMesh:=", false)
PasteSetup
Use: Paste a solve setup.
Syntax: PasteSetup
Return Value: None
VB Example: oModule.PasteSetup
PasteSweep
Pastes a copied sweep.
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.
ResetAllToTimeZero
Forces the next solve to start from time 0 for all setups. Applies only to the Transient solution type.
Command: Right-click Analysis in the project tree, and select Revert to Time Zero.
Syntax:ResetAllToTimeZero
Return Value: None
Parameters: None
Example: oModule.ResetAllToTimeZero
ResetSetupToTimeZero
Use: Forces the next solve to start from time 0 for a given setup. Applies only to the Transient solution type.
Command: Right-click a setup in the project tree, and select Revert to Time Zero.
Syntax:ResetSetupToTimeZero <SetupName>
Return Value: None
Parameters: <SetupName>
Type: string
Setup name
Example: oModule.ResetSetupToTimeZero "Setup1"
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.
Maxwell > 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
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.
Maxwell > Set Object Temperature > Enable Feedback. Then in the Project Manager, right-click Analysis
UI Access
> Revert to Initial Temperature.
<MaxV>
Type: <VarValue>
The maximum value of a variable.
<IncludeVar>
Type: <bool>
Specifies whether the variable is included in the analysis.
<StartingPoint>
Array("NAME:StartingPoint", "<VarName>:=",
<VarValue>, .... "<VarName>:=", <VarValue>)
<SaveField>
Type: <bool>
Specifies whether HFSS will remove the non-nominal field solution.
<MaxIter>
Type: <int>
Maximum iteration allowed in an analysis.
<PriorSetup>
Type: <string>
The name of the embedded parametric setup.
<Precede>
Type: <bool>
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
GetSetupNamesByType [Optimetrics]
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 interface
UI Access Right-click the parametric setup name in the project tree and select Distribute Analysis.
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.
oModule.ExportParametricResults
VB Example
"ParametricSetup1", "c:/exportdir/test.csv",false
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
tatistical", or "OptiDesignExplorer".
<SetupInfo> Array Array("NAME:<SetupName>", "FilePath")
<SetupName>
Type: <string>
Name of the setup.
<FilePath>
Type : <string: file path>
Must be a valid file path and name.
"c:/importdir/mySetupInfoFile")
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.
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.
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
GenerateVariationData [Parametric]
InsertSetup [Parametric]
EditSetup [Parametric]
Modifies an existing parametric setup
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
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>
UI Access Right-click the Optimetrics folder in the project tree, and then click Add> Parametric on the shortcut menu.
"NAME:Sweeps",
[
"NAME:SweepDefinition",
"Variable:=", "$width",
"Data:=", "LIN 12mm 17mm 2.5mm",
"OffsetF1:=", false,
"Synchronize:=", 0
],
[
"NAME:SweepDefinition",
"Variable:=", "$length",
"Data:=", "LIN 8mm 12mm 2mm",
"OffsetF1:=", false,
"Synchronize:=", 0
]
],
[
"NAME:Sweep Operations"
],
[
"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: Parametric Setup with Harmonic Distortions
oModule.InsertSetup("OptiParametric",
[
"NAME:ParametricSetup1",
"IsEnabled:=" , True,
[
"NAME:ProdOptiSetupDataV2",
"SaveFields:=" , False,
"CopyMesh:=" , False,
"SolveWithCopiedMeshOnly:=", False
],
"InterpolationPoints:=" , 0,
"HarmonicDistortionNum:=", 10,
[
"NAME:StartingPoint"
],
"Sim. Setups:=" , ["Setup1"],
[
"NAME:Sweeps"
],
[
"NAME:Sweep Operations"
],
[
"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")))))
UI Access Right-click the setup in the Project Manager tree, and then click Properties from the shortcut menu
"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
])
],
"InterpolationPoints:=" , 0,
"HarmonicDistortionNum:=", 12,
[
"NAME:StartingPoint"
],
"Sim. Setups:=" , ["Setup1"],
[
"NAME:Sweeps"
],
[
"NAME:Sweep Operations"
],
[
"NAME:Goals"
]
])
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.
<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>
Either "Independent" or "Dependent"
<GoalValueFormat>
Type:<string>
Either "Real/Imag" or "Mag/Ang".
<GoalValue>
Type: <string>
Value in string. Value can be a real number, complex number, or expression.
"MaxIterations:=", 100,
"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",
"Start:=", "8GHz", "Stop:=", "8GHz"]],
"Condition:=", "<=",
["NAME:GoalValue",
"GoalValueType:=", "Independent",
"Format:=", "Real/Imag",
"bG:=", ["v:=", "[0.0001]"]],
"Weight:=", "[1]"]],
"Acceptable_Cost:=", 0.0002,
"Noise:=", 0.0001,
"UpdateDesign:=", true,
"UpdateIteration:=", 5,
"KeepReportAxis:=", true,
"UpdateDesignWhenDone:=", true
])
Array("NAME:OptimizationSetup1", _
"SaveFields:=", false, _
Array("NAME:StartingPoint", "$length:=", "8mm",_
"$width:=", "14.5mm"), _
"Optimizer:=", "Quasi Newton", _
"MaxIterations:=", 100, _
"PriorPSetup:=", "ParametricSetup1", _
"PreSolvePSetup:=", true, _
Array("NAME:Variables", _
"$length:=", Array("i:=", true, "Min:=", "6mm",_
"Max:=", "18mm", _
"MinStep:=", "0.001mm", "MaxStep:=", _
"1.2mm"), _
"$width:=", Array("i:=", true, "Min:=", _
"6.5mm", "Max:=", "19.5mm", _
"MinStep:=", "0.001mm", "MaxStep:=", _
"1.3mm")), _
Array("NAME:LCS"), _
Array("NAME:Goals", _
Array("NAME:Goal", _
UI Access Right-click the setup in the project tree, and then click Properties on the shortcut menu
"NAME:StartingPoint"
],
"Optimizer:=", "Quasi Newton",
[
"NAME:AnalysisStopOptions",
"StopForNumIteration:=", True,
"StopForElapsTime:=", False,
"StopForSlowImprovement:=", False,
"StopForGrdTolerance:=" , False,
"MaxNumIteration:=", 1001,
"MaxSolTimeInSec:=", 3600,
"RelGradientTolerance:=", 0,
"MinNumIteration:=", 10
],
"CostFuncNormType:=", "L2",
"PriorPSetup:=", "",
"PreSolvePSetup:=", True,
[
"NAME:Variables"
],
[
"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
])
oModule.EditSetup("OptimizationSetup1",
Array(
"NAME:OptimizationSetup1",
"UseFastCalculationUpdateAlgo:=", False,
"FastCalcOptCtrledByUser:=", False,
"IsEnabled:=", True,
"SaveSolutions:=", False,
Array(
"NAME:StartingPoint"
),
),
"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.
"IDisp:=", <InitialDisp>),...
"VarName:=", Array("i:=", <IncludeVar>,
"Min:=", <MinV>, "Max:=", <MaxV>,
"IDisp:=", <InitialDisp>))
<InitialDisp> VarValue Index of the Primary goal. Index starts from zero.
<PrimaryError> Double Error associated with the Primary goal.
oModule.InsertSetup
"OptiSensitivity", _
Array("NAME:SensitivitySetup1",_
"SaveFields:=", true,_
Array("NAME:StartingPoint"), _
"MaxIterations:=", 20,_
"PriorPSetup:=", "",_
"PreSolvePSetup:=", true, _
Array("NAME:Variables"), _
Array("NAME:LCS"),_
VB Example 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"))))
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. See also DeleteVariation.
UI Access Right-click on Results, select Browse Solutions..., click Delete button in the dialog.
GetValidISolutionList
Gets all available solution names that exist in a design.
UI Access N/A
15-4
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
AddMarkerToPlot
AddNamedExpr
CreateFieldPlot
DeleteFieldPlot
EditSurfaceMeshSummaryData
ExportMarkerTable
ExportPlotImageWithViewToFile
ExportSurfaceMeshSummary
GetFieldPlotName
ModifyFieldPlot
ModifyInceptionParameters
RenameFieldPlot
RenamePlotFolder
SetFieldPlotSettings
SetPlotFolderSettings
SetPlotsSolutionsContext
SetPlotsViewSolutionContext
UpdateAllFieldsPlots
UpdateQuantityFieldsPlots
AddMarkerToPlot
Adds a marker to a trace on a named field plot.
UI Access N/A
"1.22481322288513in", "0in"],
"Mag_H1")
CreateFieldPlot
l
GetGeometryIdsForNetLayerCombinations returns ID numbers of all faces and edges of the active design related to
the current target combination of nets and layers.
l
GetGeometryIdsForAllNetLayerCombinations returns ID numbers for all possible combinations of nets and layers it
is possible to choose.
Use: Creates a field/mesh plot "Field" or a visual ray trace ("VRT") plot.
Command: HFSS>Fields>Plot Fields><field_quantity>
Command: Maxwell3D or Maxwell2D>Fields>Fields><field_quantity>
Command: Maxwell3D>Fields>Fields>Field Line Trace (for 3D Electrostatic designs - see Examples below)
Command:Icepak>Fields>Plot Fields><field_quantity>
Syntax: CreateFieldPlot <PlotParameterArray> ["Field" | "VRT"]
Return Value: None
Parameters: <PlotParameterArray> "Field"
Array("NAME:<PlotName>",
"SolutionName:=", <string>,
"QuantityName:=", <string>,
"PlotFolder:=", <string>,
"UserSpecifyName:=", <int>,
"UserSpecifyFolder:=", <int>,
"IntrinsicVar:=", <string>,
"PlotGeomInfo:=", <PlotGeomArray>,
"FilterBoxes:=", <FilterBoxArray>,
<PlotOnPointsSettings>,
<PlotOnLineSettings>,
<PlotOnSurfaceSettings>,
<PlotOnVolumeSettings>)
SolutionName
Name of the solution setup and solution formatted as:
"<SolveSetupName>: <WhichSolution>",
where <WhichSolution> can be "Adaptive_<n>",
"LastAdaptive", or "PortOnly".
For example: "Setup1 : Adaptive_2"
HFSS and Maxwell require a space on either side of the ‘:’ character. If it is missing, the plot will not be created.
QuantityName
Type of plot to create. Possible values include:
PlotFolder
Name of the folder to which the plot should be added. (Values vary with the design type.) Some
possible values include:
"E Field", "H Field", "Jvol", "Jsurf", "SAR Field", "Jc", "Surface-Loss", QSurf, Tem-
perature, Energy, Average-Surface-Loss-Density, "Dielectric_Loss", "MeshPlots", "Heat Flux", and
"Displacement".
UserSpecifyName
0 if default name for plot is used, 1 otherwise.
Not needed. <PlotName> will be respected regardless of whether
thisflag is set.
UserSpecifyFolder
0 if default folder for plot is used, 1 otherwise.
Not needed. The specified PlotFolder will be respected regardless
of whether this flag is set.
IntrinsicVar
Formatted string that specifies the frequency and phase at which to make the plot.
For example: "Freq='1GHz' Phase='30deg'"
IntrinsicVar (Maxwell)
Formatted string that specifies the skew slice number at which to make the plot.
For example: "IntrinsicVar:=" , "Slice=\'2\' Time=\'0.00020000000000000001s\'"
PlotGeomInfo
Creating field plot on selected layer-net pairs:
For example, Maxwell: "PlotGeomInfo :=" , [1,"Volume","ObjList",2,"LC1_1:Top","LC1_1:Top#L1"]
HFSS example with "Plot on surface" option is not checked
"PlotGeomInfo:=" , [1,"Volume","LayerNets",2, "Top",2,"net1","net2",_
"Ground",1,"GND"]
The command creates field plot on 2 layer-nets combinations. It starts with type "Volume", and subtype "LayerNets", fol-
lowed by the number of layer-nets combinations which is 2 in this example.
The two layer-nets combinations are (1) "Top" layer, 2 nets, net names are "net1" and "net2", i.e., [Top, net1] pair, and [Top,
net2] pair. (2) "Ground" layer and 1 net, net name is "GND", i.e., [Ground, GND] pair.
HFSS example with "Plot on surface" option is checked
"PlotGeomInfo:=" , [1,"Surface","LayerNetsExtFace",2,"Top",2,"net1","net2",_
"Ground",1,"GND"],
The command creates field plot on 2 layer-nets combinations. It starts with type "Surface", and subtype "Lay-
erNetsExtFace", followed by the number of layer-nets combinations which is 2 in this example.
The two layer-nets combinations are (1) "Top" layer, 2 nets, net names are "net1" and "net2", i.e., [Top, net1] pair, and [Top,
net2] pair. (2) "Ground" layer and 1 net, net name is "GND", i.e., [Ground, GND] pair.
Limitation:
No Layer/Nets name is supported for field plot command recording
Should be able to add it based on this change.
No Layer/Nets name support for pure Layout design field plot command.
=======
PlotGeomInfo (Maxwell)
For example: "PlotGeomInfo :=" , [1,"Volume","ObjList",2,"LC1_1:Top","LC1_1:Top#L1"]
>>>>>>> a6f178b1c03cf1dde1d916fb666faa1c78256640
<PlotGeomArray>
Array(<NumGeomTypes>, <GeomTypeData>,
<GeomTypeData>, ...)
For example: Array(4, "Volume", "ObjList", 1, "Box1",
"Surface", "FacesList", 1, "12", "Line", 1,
"Polyline1", "Point", 2, "Point1", "Point2")
<NumGeomTypes>
Type: <int>
Number of different geometry types (volume, surface, line, point)
plotted on at the same time.
<GeomTypeData>
<GeomType>, <ListType>, <NumIDs>, <ID>, <ID>, ...)
<GeomType>
Type: <string>
Possible values are "Volume", "Surface", "Line", "Point".
<ListType>
Type: <string>
Possible values are "ObjList", or "FacesList".
These are used for the GeomType of "Line" or "Point".
<NumIDs>
Type: <int>
Number of IDs or object names that will follow.
<ID>
Type: <int> or <string>
ID of a face or name of an object, line, or point on which to plot.
<FilterBoxArray>
Array of names of objects to use to restrict the plot range.
<PlotOnPointSettings>
Array("NAME:PlotOnPointSettings",
"PlotMarker:=", <bool>,
"PlotArrow:=", <bool>)
<PlotOnLineSettings>
Array("NAME:PlotOnLineSettings",
Array("NAME:LineSettingsID",
"Width:=", <int>,
"Style:=", <string>),
"IsoValType:=", <string>,
"ArrowUniform:=", <bool>,
"NumofArrow:=", <int>)
Style
Possible values are "Cylinder", "Solid", "Dashdash",
"Dotdot", "Dotdash"
IsoValType
Possible values are "Tone", "Fringe", "Gourard"
<PlotOnSurfaceSettings>
Array("NAME:PlotOnSurfaceSettings",
"Filled:=", <bool>,
"IsoValType:=", <string>,
"SmoothShade:=", <bool>,
"AddGrid:=", <bool>,
"MapTransparency:=", <bool>,
"Transparency:=", <doubl.e>,
"ArrowUniform:=", <bool>
"ArrowSpacing:=", <double>
"GridColor:=", Array(<int>, <int>, <int>)
IsoValType
Possible values are: "Tone", "Line", "Fringe", "Gourard"
GridColor
<PlotOnVolumeSettings>
Array("NAME:PlotOnVolumeSettings",
"PlotIsoSurface:=", <bool>,
"CloudDensity:=", <double>,
"PointSize:=", <int>,
"ArrowUniform:=", <bool>,
"ArrowSpacing:=", <double>)
"FilterBoxes:=", Array(0),
Array("NAME:PlotOnSurfaceSettings", _
"Filled:=", false, _
"IsoValType:=", "Fringe", _
"SmoothShade:=", true, _
"AddGrid:=", false, _
"MapTransparency:=", true, _
"Transparency:=", 0, _
"ArrowUniform:=", true, _
"ArrowSpacing:=", 0.100000001490116, _
"GridColor:=", Array(255, 255, 255)))
"QuantityName:=", "QuantityName_SBR", _
"PlotFolder:=", "Visual Ray Trace SBR", "UserSpecifyName:=", 0, _
"UserSpecifyFolder:=", 0, "IntrinsicVar:=", "", "MaxFrequency:=", "1GHz", _
"LaunchFrom:=", "Launch from custom", "LaunchFromPointID:=", 18007, _
"RayDensity:=", 2, "NumberBounces:=", 5, "Multi-Bounce Ray Density Control:=", _
false, "MBRD Max sub divisions:=", 2, "ShootFilterType:=", "All Rays"), "VRT"
VB Example:
oModule.CreateFieldPlot Array("NAME:Mag_E1", _
"SolutionName:=", "Setup1 : LastAdaptive", _
"QuantityName:=", "Mag_E", _
"PlotFolder:=", "E Field1", _
"UserSpecifyName:=", 0, _
"UserSpecifyFolder:=", 0, _
"IntrinsicVar:=", "Freq='1GHz' Phase='0deg'",_
"PlotGeomInfo:=", Array( 1, "Surface",_
"FacesList", 1, "7"),_
"FilterBoxes:=", Array(0),
Array("NAME:PlotOnSurfaceSettings", _
"Filled:=", false, _ "IsoValType:=", "Fringe", _
"SmoothShade:=", true, _
"AddGrid:=", false, _
"MapTransparency:=", true, _
"Transparency:=", 0, _
"ArrowUniform:=", true, _
"ArrowSpacing:=", 0.100000001490116, _
"GridColor:=", Array(255, 255, 255))), "Field"
],
"EnableGaussianSmoothing:=", False,
"SurfaceOnly:=" , False
], "Field")
"QuantityName:=" "Mesh",
"PlotFolder:=", "MeshPlots",
"FieldType:=", "Fields",
"StreamlinePlot:=" , False,
"AdjacentSidePlot:=" , False,
"FullModelPlot:=", False,
"IntrinsicVar:=", "Slice=\'2\' Time=\'0.00020000000000000001s\'",
"PlotGeomInfo:=", [1,"Surface","FacesList",1,"2955"],
"FilterBoxes:=", [0],
…]
"StreamlinePlot:=" , False,
"AdjacentSidePlot:=" , False,
"FullModelPlot:=" , False,
"IntrinsicVar:=" , "Time=\'4us\' Time0=\'0s\'",
"PlotGeomInfo:=" , [1,"Surface","FacesList",1,"6"],
…
])
"PlotGeomInfo:=", [1,"Volume","ObjList",1,"Box1"],
"FilterBoxes:=", [1,""],
[
"NAME:PlotOnVolumeSettings",
"PlotIsoSurface:=", True,
"PointSize:=", 1,
"Refinement:=", 0,
"CloudSpacing:=", 0.5,
"CloudMinSpacing:=", -1,
"CloudMaxSpacing:=", -1,
"ShadingType:=", 0,
[
"NAME:Arrow3DSpacingSettings",
"ArrowUniform:=", True,
"ArrowSpacing:=", 0,
"MinArrowSpacing:=", 0,
"MaxArrowSpacing:=", 0
]
],
"EnableGaussianSmoothing:=", False
], "Field")
oModule.CreateFieldPlot(
[
"NAME:ComplexMag_Jc1",
"SolutionName:=", "Setup1 : LastAdaptive",
"UserSpecifyName:=", 0,
"UserSpecifyFolder:=", 0,
"QuantityName:=", "ComplexMag_Jc",
"PlotFolder:=", "Jc",
…)
oModule.CreateFieldPlot(
[
"NAME:Jc_Vector2",
"SolutionName:=", "Setup1 : LastAdaptive",
"UserSpecifyName:=", 0,
"UserSpecifyFolder:=", 0,
"QuantityName:=", "Jc_Vector",
"PlotFolder:=", "Jc",
]
…)
oModule.CreateFieldPlot(
[
"NAME:Dielectric_Loss1",
"SolutionName:=", "Setup1 : LastAdaptive",
"UserSpecifyName:=", 0,
"UserSpecifyFolder:=", 0,
"QuantityName:=", "Dielectric_Loss",
"PlotFolder:=", "Dielectric-Loss",
]
…)
oModule.ModifyInceptionParameters "FieldLineTrace_Plot3",
Array("NAME:InceptionEvaluationSettings",
"Gas Type:=", 2, "Gas Pressure:=", 1,
"Use Inception:=" , True,
"Potential U0:=" , 0,
"Potential K:=" , 1,
"Potential A:=" , 1
"Critical Value:=", 5.9426,
"Streamer Constant:=", 6.5,
"Ionization Coefficient Dataset:=", Array( 0))
[
"NAME:FieldLineTrace_Plot3",
"SolutionName:=", "Setup1 : LastAdaptive",
"UserSpecifyName:=", 0,
"UserSpecifyFolder:=", 0,
"QuantityName:=", "QuantityName_FieldLineTrace",
"PlotFolder:=", "Field line trace plot",
"IntrinsicVar:=", "",
"Trace Step Length:=", "0.001mm",
"Use Adaptive Step:=", True,
"Seeding Faces:=", [1,15091],
"Seeding Markers:=", [0],
"Surface Tracing Objects:=", [1,15],
"Volume Tracing Objects:=", [1,36],
"Seeding Sampling Option:=", True,
"Seeding Points Number:=", 15,
"Fractional of Maximal:=", 0.8,
"Discrete Seeds Option:=", "Marker Point",
[
"NAME:InceptionEvaluationSettings",
"Gas Type:=", 0,
"Gas Pressure:=", 1
"Use Inception:=" , True,
"Potential U0:=" , 0,
"Potential K:=" , 1,
"Potential A:=" , 1
],
[
"NAME:FieldLineTracePlotSettings",
[
"NAME:LineSettingsID",
"Width:=", 1,
"Style:=", "Solid"
],
"IsoValType:=", "Tone"
]
], "FieldLineTrace")
For Q3D Extractor and 2D Extractor, the command details are as follows:
PlotFolder
Name of the folder to which the plot should be added. Possible values are: "Q", "ABS_Q", "JDC
Vol", "Phi", "JDC Surf", and "JAC".
UserSpecifyName
0 if default name for plot is used, 1 otherwise.
This parameter is not essential. <PlotName> is respected regardless of whether this flag is
set.
UserSpecifyFolder
0 if the default folder for plot is used, 1 otherwise.
This parameter is not essential. The specified PlotFolder is respected regardless of whether
this flag is set.
IntrinsicVar
Formatted string that specifies the frequency and phase at which to create the plot.
For example: "Freq='1GHz' Phase='30deg'"
<PlotGeomArray>
Array(<NumGeomTypes>, <GeomTypeData>,
<GeomTypeData>, ...)
For example: Array(4, "Volume", "ObjList", 1, "Box1",
"Surface", "FacesList", 1, "12", "Line", 1,
"Polyline1", "Point", 2, "Point1", "Point2")
<NumGeomTypes>
Type: <int>
Number of different geometry types (volume, surface, line, point) plotted at the same time.
<GeomTypeData>
<GeomType>, <ListType>, <NumIDs>, <ID>, <ID>, ...)
<GeomType>
Type: <string>
Possible values are "Volume", "Surface", "Line", "Point".
<ListType>
Type: <string>
Possible values are "ObjList" or "FacesList".
These are used for GeomType values "Line" or "Point"
<NumIDs>
Type: <int>
Number of IDs or object names that will follow.
<ID>
Type: <int> or <string>
ID of a face or name of an object, line, or point on which to plot.
<FilterBoxArray>
Array of object names used to restrict the plot range.
Array(<NumFilters>, <ObjName>, <ObjName>, ...)
Example: Array(1, "Box1")
Example: Array(0) no filtering
<PlotOnPointSettings>
Array("NAME:PlotOnPointSettings",
"PlotMarker:=", <bool>,
"PlotArrow:=", <bool>)
<PlotOnLineSettings>
Array("NAME:PlotOnLineSettings",
Array("NAME:LineSettingsID",
"Width:=", <int>,
"Style:=", <string>),
"IsoValType:=", <string>,
"ArrowUniform:=", <bool>,
"NumofArrow:=", <int>)
Style
Possible values are "Cylinder", "Solid", "Dashdash",
"Dotdot", "Dotdash".
IsoValType
Possible values are "Tone", "Fringe", "Gourard".
<PlotOnSurfaceSettings>
Array("NAME:PlotOnSurfaceSettings",
"Filled:=", <bool>,
"IsoValType:=", <string>,
"SmoothShade:=", <bool>,
"AddGrid:=", <bool>,
"MapTransparency:=", <bool>,
"Transparency:=", <double>,
"ArrowUniform:=", <bool>
"ArrowSpacing:=", <double>
"GridColor:=", Array(<int>, <int>, <int>)
IsoValType
Possible values are: "Tone", "Line", "Fringe", "Gourard".
GridColor
Array containing the R, G, B components of the color. Components should be in the range 0 to
255.
<PlotOnVolumeSettings>
Array("NAME:PlotOnVolumeSettings",
"PlotIsoSurface:=", <bool>,
"CloudDensity:=", <double>,
"PointSize:=", <int>,
"ArrowUniform:=", <bool>,
"ArrowSpacing:=", <double>)
DeleteFieldPlot
Deletes one or more field plots.
EditSurfaceMeshSummaryData
Use: Defines or Edits Surface Mesh Summary Data.
Command: Create Surface Mesh Summary, Setup...
Syntax: EditSurfaceMeshSummaryData Array(Array(<Parameters Array>))
Return Value: None
Parameters:
"NAME:SurfaceMeshSummary"
Type: <string>
"NAME:SurfaceMeshSummary"
"SolutionName:=" <string>
Type: <string>
Solution Name.
"Variation Name:=" <string>
Type: <string>
Variation name.
<RowItemsArray>
Array<MeshRowItems>
Row data.
<ItemPerRow>
Array<EntityPerRow>
Enity ID.
<MeshDataPer Item>
Array<Mesh Data Category and Stats>
VB Example:
Set oModule = oDesign.GetModule("FieldsReporter")
oModule.EditSurfaceMeshSummaryData Array(Array("NAME:SurfaceMeshSummary", "SolutionName:=", _
"Variation:=" , "Nominal",
[
"NAME:MeshRowItems",
[
"NAME:ItemPerRow",
"EntityPerRow:=" , "annular_rng",
[
"NAME:MeshDataPerItem",
"Min Edge Len:=" , 0.000166961133900917,
"Max Edge Len:=" , 0.00145730991671888,
"Mean Edge Len:=" , 0.000524160923260581,
"Std Devn Edge Len:=" , 0.000217758706109324,
"Min Tri Area:=" , 3.4982570283924E-09,
"Max Tri Area:=" , 3.73116346661249E-07,
"Mean Tri Area:=" , 8.91526236529066E-08,
"Std Devn Tri Area:=" , 6.89482807990471E-08,
"DataState:=" , 2
]
],
[
"NAME:ItemPerRow",
"EntityPerRow:=" , "gap",
[
"NAME:MeshDataPerItem",
"Min Edge Len:=" , 0.000105681286042456,
"Max Edge Len:=" , 0.000362084671538928,
"Mean Edge Len:=" , 0.000233090954707978,
"Std Devn Edge Len:=" , 7.55387369793154E-05,
"Min Tri Area:=" , 1.74640378345369E-09,
"Max Tri Area:=" , 3.78166789228631E-08,
"Mean Tri Area:=" , 1.56497981245286E-08,
"Std Devn Tri Area:=" , 1.04691637802914E-08,
"DataState:=" , 2
]
]
]
]
])
ExportPlotImageWithViewToFile [Reporter]
Exports a field plot image to a specified file.
Note:
UI Access N/A
ExportSurfaceMeshSummary
Use: Exports a Surface Mesh Summary.
Command: Create Surface Mesh Summary.
Syntax: ExportSurfaceMeshSummary Array(<SolutionName>, <DesignVariationKey> <ExportFileName>)
Return Value: None
Parameters: <SolutionName>
Type: <string>
Original name of the plot.
<DesignVariationKey>
Type: <string>
New name of the plot.
VB Example:
oModule.ExportSurfaceMeshSummary Array("SolutionName:=", "Setup1 : LastAdaptive", "DesignVari-
ationKey:=", _
"Nominal", "ExportFileName:=", "D:\documents\surfaceMeshSummaryReport.csv")
"DesignVariationKey:=" , "Nominal",
"ExportFileName:=" , "D:\\Program Files\\Docu-
ments\surfaceMeshSummaryReport.csv"
])
GetFieldPlotNames
Gets the names of field overlay plots defined in a design.
UI Access N/A
Parameters None.
Return Value Array of strings containing field plots names.
VB Syntax GetFieldPlotNames
VB Example oModule.GetFieldPlotNames
ModifyFieldPlot
Modifies a plot definition.
oModule.ModifyFieldPlot("Vector_E1" ,
["NAME:Vector_E2",
"SolutionName:=", "Setup1 : LastAdaptive",
"QuantityName:=", "Vector_E",
"PlotFolder:=", "E Field1",
"UserSpecifyName:=", 0,
Python Example
"UserSpecifyFolder:=", 0,
"IntrinsicVar:=","Freq='1GHz' Phase='30deg'",
"PlotGeomInfo:=", [1, "Surface","FacesList", 1, "7"],
"FilterBoxes:=", [0],
["NAME:PlotOnSurfaceSettings",
"Filled:=", False,
"IsoValType:=", "Fringe",
"SmoothShade:=", True,
"AddGrid:=", False,
"MapTransparency:=", True,
"Transparency:=", 0, _
"ArrowUniform:=", True,
"ArrowSpacing:=", 0.100000001490116,
"GridColor:=", [255, 255, 255]]
])
"Filled:=", false, _
"IsoValType:=", "Fringe", _
"SmoothShade:=", true, _
"AddGrid:=", false, _
"MapTransparency:=", true, _
"Transparency:=", 0, _
"ArrowUniform:=", true, _
"ArrowSpacing:=", 0.100000001490116, _
"GridColor:=", Array(255, 255, 255)))
ModifyInceptionParameters
Use: For field line trace plots, allows you to set inception voltage evaluation parameters.
UI Access Right-click on a Field Line Trace Plot in the project tree and select Inception Voltage Evaluation
ModifyInceptionParameters (<NAME>, <Gas Type>, <Gas Pressure>, <Use Inception>, <Potential U0>,
Python Syntax
<Potential K>, <Potential A>)
oModule.ModifyInceptionParameters("FieldLineTrace_Plot1",
[
"NAME:InceptionEvaluationSettings",
"Gas Type:=" , 1,
"Gas Pressure:=" , 1,
Python Example
"Use Inception:=" , True,
"Potential U0:=" , 0,
"Potential K:=" , 1,
"Potential A:=" , 1
])
ModifyInceptionParameters (<NAME>, <Gas Type>, <Gas Pressure>, <Use Inception>, <Potential U0>,
VB Syntax
<Potential K>, <Potential A>)
oModule.ModifyInceptionParameters "FieldLineTrace_Plot1",
Array("NAME:InceptionEvaluationSettings",
VB Example
"Gas Type:=", 1, "Gas Pressure:=", 1, "Use Inception:=", false,
"Potential U0:=", 0, "Potential K:=", 1, "Potential A:=", 1)
RenameFieldPlot
Renames a plot.
UI Access Right-click the plot you want to rename in the project tree, and then click Rename on the shortcut menu.
RenamePlotFolder
Renames a plot folder.
UI Access Right-click a plot folder in the project tree, and then click Rename on the shortcut menu.
SetFieldPlotSettings
Sets plot attributes.
"ArrowSpacing:=", 0.100000001490116, _
"GridColor:=", Array(255, 255, 255)))
SetPlotFolderSettings
Sets the attributes of all plots in the specified folder.
"MarkerMapColor:=", <bool>,
"MarkerSize:=", <double>)
<Arrow3DSettings> Array Structured array.
Array("NAME:Arrow3DSettings",
"ArrowType:=", <integer
0: Line
1: Cylinder
2: Umbrella
default: Line>,
"ArrowMapSize:=", <bool>,
"ArrowMapColor:=", <bool>,
"ShowArrowTail:=", <bool>,
"ArrowSize:=", <double>)
["NAME:ColorMapSettings",
"ColorMapType:=", "Spectrum",
"SpectrumType:=", "Rainbow",
"UniformColor:=", [127, 255, 255],
"RampColor:=", [255, 127, 127]],
["NAME:Scale3DSettings",
"m_nLevels:=", 27,
"m_autoScale:=", True,
"minvalue:=", 9.34379863739014,
"maxvalue:=", 13683.755859375,
"log:=", False,
"IntrinsicMin:=", 9.34379863739014,
"IntrinsicMax:=", 13683.755859375),
["NAME:Marker3DSettings",
"MarkerType:=", 0,
"MarkerMapSize:=", True,
"MarkerMapColor:=", False,
"MarkerSize:=", 0.25],
["NAME:Arrow3DSettings",
"ArrowType:=", 1,
"ArrowMapSize:=", True,
"ArrowMapColor:=", True,
"ShowArrowTail:=", True,
"ArrowSize:=", 0.25]]
)
"log:=", false, _
"IntrinsicMin:=", 9.34379863739014, _
"IntrinsicMax:=", 13683.755859375), _
Array("NAME:Marker3DSettings", _
"MarkerType:=", 0, _
"MarkerMapSize:=", true, _
"MarkerMapColor:=", false, _
"MarkerSize:=", 0.25), _
Array("NAME:Arrow3DSettings", _
"ArrowType:=", 1, _
"ArrowMapSize:=", true, _
"ArrowMapColor:=", true, _
"ShowArrowTail:=", true, _
"ArrowSize:=", 0.25))
SetPlotsViewSolutionContext
Sets the context of named field overlay plots to the specified time using the intrinsic Time value of the active window. Also updates the
associated view solution context for each plot.
UpdateAllFieldsPlots
Updates the All Fields Plots.
UI Access N/A
Parameters None.
Return Value None.
VB Syntax UpdateAllFieldsPlots
VB Example oModule.UpdateAllFieldsPlots
UpdateQuantityFieldsPlots
Updates the Quantity Fields Plots.
UI Access N/A
16-60
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell 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.
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.
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.
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.
EnterLine
Enters a line defined in the 3D Modeler editor.
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.
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”
true, "Cylindrical", _
Array("0mm", "0mm", "0mm")
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",
[
"Freq:=" , "4.5GHz",
"Phase:=" , "0deg"
],
Python
Exampl- [
e "NAME:ExportOption",
"IncludePtInOutput:=" , True,
"RefCSName:=" , "offset",
"PtInSI:=" , False,
"FieldInRefCS:=" , True
])
oModule.ExportToFile("C:\\offset_file_model_unit_ref.fld", "C:\\offset_SI.pts",
VB "4500MHz : LastAdaptive",
Exampl-
[
e
"Freq:=" , "4.5GHz",
"Phase:=" , "0deg"
],
[
"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",
Python Example
["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(
Python Example "C:\Ansoft\PersonalLib\smth.clc",
"Fields", ["smoothedtemp"])
SaveNamedExpressions
Saves a named expression definition to a file.
UI Access In the Fields Calculator, click Save To... in the Library area.
oModule.SaveNamedExpressions(
Python Example "C:\Ansoft\PersonalLib\smth.clc",
["smoothedtemp"], True)
17-30
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
DeleteMotionSetup
Use: Deletes the motion setup.
Command: Maxwell3D or Maxwell2D>Model>Motion Setup>Unassign Band
Syntax:DeleteMotionSetup
Return Value: None
Parameters: List of strings. A list of names of motion setups to delete.
Example: oModule.DeleteMotionSetup(["MotionSetup2"])
The [ ] can contain more than one name as it is a list.
ReassignMoving
Use: Specifies a new geometry assignment for moving objects.
Command: Maxwell3D or Maxwell2D>Model>Motion Setup>Add Selected Objects or
Maxwell3D or Maxwell2D>Model>Motion Setup>Remove Selected Objects
Syntax:ReassignMoving Array("Name:Moving", "Objects:=", <AssignmentObjects>)
Return Value: None
Example: oModule.ReassignMoving Array("NAME:Moving", _
"Objects:=", Array("Box4", "Box1"))
Note:
In the following commands, all named data can be included/excluded as desired and may appear in any order.
l AssignBand
l EditMotionSetup
l GetMotionSetupNames
AssignBand
Use: Assigns the selected object as a band.
Command: Maxwell3D or Maxwell2D>Model>Motion Setup>Assign Band
Syntax:AssignBand <BandDataArray>
Return Value: None
Parameters:
<BandDataArray>
Array("NAME:Band",
"Move Type:=", <Translate/Rotate>,
"Coordinate System::=", <CoordinateSystemName>,
"Axis:=", <X/Y/Z>,
"Is Positive:=", <bool>,
"InitPos:=", <value>,
"NegativePos:=", <value>,
"PositivePos:=", <value>,
"TranslatePeriodic:=", <bool>,
"Consider Mechanical Transient:=", <bool>,
"velocity:=", <value>,
"objects:=", <AssignmentObjects>)
Example: Assign band as translate, do not consider mechanical transient.
oModule.AssignBand _
Array("NAME:Band", "Move Type:=", "Translate",
"Coordinate System:=", "Global", "Axis:=", "Z",
"Is Positive:=", true, "InitPos:=", "0mm", _
"NegativePos:=", "0mm", "PositivePos:=", "1mm",
"TranslatePeriodic:=", true,
"Consider Mechanical Transient:=", false,
"Velocity:=", "0m_per_sec",
"Objects:=", Array("band"))
Example: Assign band as translate, consider mechanical transient.
oModule.AssignBand _
Array("NAME:Band", _
"Move Type:=", "Translate",
"Coordinate System:=", "Global", "Axis:=", "Z",
"Is Positive:=", true, "InitPos:=", "0mm",
"NegativePos:=", "0mm", "PositivePos:=", "1mm",
"TranslatePeriodic:=", true,
"Consider Mechanical Transient:=", true,
"Velocity:=", "0m_per_sec", "Mass:=", "1kg",
"Damping:=", "1", "Load Force:=", "1nNewton"
"Objects:=", Array("band"))
Example: Assign band as rotate, do not consider mechanical transient.
oModule.AssignBand _
Array("NAME:Band", "Move Type:=", "Rotate",
"Coordinate System:=", "Global", "Axis:=", "Z",
Parameters: <SetupName>
The name of the motion setup to be edited.
<BandDataArray>
Array("NAME:Data",
"Move Type:=", <Translate/Rotate>,
"Coordinate System::=", <CoordinateSystemName>,
"PostProcessing Coordinate System:=", <CoordinateSystemName>
"Axis:=", <X/Y/Z>,
"Is Positive:=", <bool>,
"InitPos:=", <value>,
"NegativePos:=", <value>,
"PositivePos:=", <value>,
"TranslatePeriodic:=", <bool>,
"Consider Mechanical Transient:=", <bool>,
"velocity:=", <value>,
"Mass:=", <value>,
"Damping:=", <value>,
"Load Force:=", <value>)
Example: Translational Periodic motion, no mechanical transient.
oModule.EditMotionSetup "MotionSetup1", Array("NAME:Data", "Move Type:=", "Translate",
GetMotionSetupNames
Use: Gets the motion setup parameters being used for the object. Applicable to 2D and 3D Transient solution types.
Command: None
Syntax:GetMotionSetupNames ()
Return Value: List of motion setup names
Parameters: None
Example: oModule.GetMotionSetupNames ()
GetSymmetryMultiplier
Use: Returns the symmetry multiplier of the model. Applicable to 2D and 3D Transient solution types.
Command: None
Syntax: oModule.GetSymmetryMultiplier ()
Return Value: The symmetry multiplier integer value.
Parameters: None
Example: oModule.GetSymmetryMultiplier ()
SetSymmetryMultiplier
Use: Sets the symmetry multiplier.This symmetry multiplier will be automatically applied to all input quantities including: input voltage,
inductance, resistance, load torque, mass, damping, external circuit; and all output quantities including: induced voltages, flux link-
ages in every winding, stranded loss, solid loss, core loss, torque and force.
Command: Maxwell3D or Maxwell2D>Model>Set Symmetry Multiplier
Syntax:SetSymmetryMultiplier <int>
Return Value: None
Parameters: <int>
Example: oModule.SetSymmetryMultiplier 2
l RenameParameter
l ReassignParameter
AddReduceOp
Adds a reduce matrix group.
UI Access Right-click on the matrix and select either Join in Series... or Join in Parallel...
AssignForce
Creates a force.
"Objects:=" , ["Core"]
])
[Beta] AssignLayoutForce
Creates a layout force.
Parameters Array("NAME:<ForceName>",
"ReferenceCS:=", <string>,
<array of nets and layers choices>)
]
])
AssignMatrix
Use: Creates a matrix.
Command: Maxwell3D or Maxwell2D>Parameters>Assign>Matrix
Syntax:AssignMatrix <MatrixArray>
Return Value: None
Parameters:
<MatrixArray>
Array("NAME:<MatrixName>",
Array("NAME:MatrixEntry",
Array("NAME:MatrixEntry",
"Source:=", <string>,
"NumberOfTurns:=", <int>),
…
)
Array("NAME:MatrixGroup",
Array("NAME:MatrixGroup",
"GroupName:=", <string>,
"NumberOfBranches:=", <int>,
"Sources:=", <nameArray>),
…
))
Example:
oModule.AssignMatrix _
Array("NAME:Matrix1", _
Array("NAME:MatrixEntry", _
Array("NAME:MatrixEntry", _
"Source:=","Current1", _
"NumberOfTurns:=", "1"),
Array("NAME:MatrixEntry", _
"Source:=", "Current3", _
"NumberOfTurns:=", "1")), _
Array("NAME:MatrixGroup", _
Array("NAME:MatrixGroup", _
"GroupName:=", "Group1", _
"NumberOfBranches:=", "1", _
"Sources:=", "Current1,Current3")))
AssignTorque
Use: Creates a torque.
Command: Maxwell3D or Maxwell2D>Parameters>Assign>Torque
Syntax:AssignTorque <TorqueArray>
Return Value: None
Parameters:
<ForceArray>
Array("NAME:<TorqueName>",
"Is Virtual:=", <bool>,
"Coordinate System:=", <string>
"Axis:=", <string>,
"Is Positive:=", <bool>
"Objects:=", <AssignmentObjects>)
Example:
oModule.AssignTorque _
Array("NAME:Torque1", "Is Virtual:=", true, _
"Coordinate System:=", "Global", "Axis:=", "Z", _
DeleteAllParameters
Use: Deletes all parameters.
Command: Maxwell3D or Maxwell2D>Parameters>Delete All
Syntax:DeleteAllParameters
Return Value: None
Example: oModule.DeleteAllParameters
DeleteParameters
Deletes one or more specified parameters.
DeleteReduceMatrix
Deletes a specified Reduce Matrix in the project.
UI Access Right-click on the desired reduce matrix item in Program Manager, then select Delete
DeleteReduceOp
Deletes a specified Reduce Matrix group in the project.
UI Access Right-click on the desired reduce matrix group item in Program Manager, then select Delete
EditForce
Use: Edits a force parameter.
Command: Double-click the parameter in the project tree to edit it.
Syntax:EditForce <ParameterName>, <ForceArray>
Return Value: None
[Beta] EditLayoutForce
Creates a layout force.
UI Access
Right-click the desired Layout Force Parameter in the project manager and select Properties... to open the Lay-
out Force Setup dialog for editing.
Parameters Array("NAME:<ForceName>",
"ReferenceCS:=", <string>,
<array of nets and layers choices>)
"LayerSet:=" , ["Ground"]
],
[
"NAME:net2",
"LayerSet:=" , ["Top"]
]
]
]
]
])
EditMatrix
Use: Edits a matrix parameter.
Command: Double-click the parameter in the project tree to edit it.
Syntax:EditMatrix <ParameterName>, <MatrixArray>
Return Value: None
EditReduceOp
Edits a reduce matrix group.
"Sources:=", "Current1,Current3"
])
EditTorque
Use: Edits a torque parameter.
Command: Double-click the parameter in the project tree to edit it.
Syntax:EditTorque <ParameterName>, <TorqueArray>
Return Value: None
ReassignParameter
Use: Specifies a new geometry assignment for a parameter.
Command: Maxwell3D or Maxwell2D>Parameters>Reassign
Syntax:ReassignParameter Array("Name:<ParameterName>","Objects:=", <AssignmentObjects>)
Return Value: None
RenameParameter
Use: Renames a parameter.
Command: Right-click the parameter item in the project tree, and click Rename.
Syntax:RenameParameter <OldName>, <NewName>
Return Value: None
Parameters:
<OldName>
Type: <string>
<NewName>
Type: <string>
Example: oModule.RenameParameter "Force1", "test"
RenameReduceMatrix
Renames a specified Reduce Matrix in the project.
UI Access Right-click on the desired reduce matrix item in Program Manager, then select Rename
RenameReduceOp
Renames a specified Reduce Matrix group in the project.
UI Access Right-click on the desired reduce matrix group item in Program Manager, then select Rename
19-20
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell 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:=", [""]
],
[]
]
]
])
20-20
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell 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.
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()
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.
<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()
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 l 0 – S-Parameters
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.
<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.
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 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
UI Access
drop-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.
Return Value Array of doubles.
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
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
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.
UI Access From the Network Data Explorer tab, ensure the Full Port Names check box is activated. Port numbers will be
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.
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
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
id = oNDE.LoadSolution "D:\folder\Tee.aedt", "HFSS_Test", "Setup1:Sweep1"
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.
UI Access From the Network Data Explorer tab, select Transforms in the NDE ribbon. Then select Rename from the
drop-down menu.
VB Syntax Rename
Set oNDE = oDesktop.GetTool "ndExplorer"
VB Example
Set oData2 = oNDE.Rename oData1, Array("input", "control", "output")
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.
Network IDispatch.
Return Value Note: Reorder returns None if the array argument does not contain all the terminal port numbers, in
any order.
oNDE = oDesktop.GetTool("ndExplorer")
Python Example
oData2 = oNDE.Reorder([3, 2, 1])
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.
oPostProc.Reset()
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 win-
UI Access
dow. 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 window.
UI Access
Make changes, then click OK.
VB Syntax SetPortImpedance
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
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
Set oNDE = oDesktop.GetTool("ndExplorer")
VB Example
oData.SetPostProcSettings oPostProc
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.
Network IDispatch.
Return Value 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.
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.
GetPropHost
Use: Returns an interface to the PropHost of the CompInstance, which gives access to its properties.
Command: None
Syntax: GetPropHost()
VB Example: Set oPropHost2 = CompInstance.GetPropHost();
Returns the interface to the properties of the compInstance.
This interface can be used to call PropHost functions; for more information see Callback Scripting Using PropHost Object.
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".
24 - 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)", _
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")
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()
oEditor.CreateIPort Array("NAME:IPortProps", "Name:=",_
"Port1", "Id:=", 4), Array("NAME:Attributes","Page:=", _
VB Example
1, "X:=", -0.0381, "Y:=", 0.0127, "Angle:=",_
0, "Flip:=", false)
VB Example:
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
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")
Set oEditor = oDesign.SetActiveEditor("SchematicEditor")
polygonID = oEditor.CreatePolygon(Array("NAME:PolygonData", "Points:=", Array( _
"(0.101600, 0.058420)", "(0.101600, 0.060960)", "(0.101600, 0.058420)", _
"(0.099060, 0.060960)", "(0.101600, 0.060960)", "(0.101600, 0.058420)", _
"(0.101600, 0.060960)", "(0.101600, 0.060960)"), "LineWidth:=", 0, "BorderColor:=", _
0, "Fill:=", 0, "Color:=", 0, "Id:=", 218), Array("NAME:Attributes", "Page:=", 1))
MsgBox "Polygon ID = " & polygonID
CreateRectangle (Schematic Editor)
Create a rectangle
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")
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:=", _
VB Example
0.040174212034384, "Size:=", 12, "Angle:=",_
0, "Text:=", "Con-
trol Circuit", "Color:=", _
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
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()
oEditor.CreateWire
Array("NAME:WireData", "Name:=", "", "Id:=", 41, "Points:=", Array( _
VB Example
"(-0.033020, 0.015240)", "(-0.017780, 0.015240)",
"(-0.017780, 0.012700)")), 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")
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.
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
Copy(
Array("NAME:Selections", _
"Page:=", page number, _ // [Opt=1] Page number
"Selections:=", IDs to modify))
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.
ExportNetlist
Exports a netlist solution.
UI Access None
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
Python Example ],
[
"NAME:Parameters",
"Filter:=" , 30,
"MatchAll:=" , False,
"MatchCase:=" , False,
"SearchSubCkt:=" , True,
"SearchSelectionOnly:=" , False
])
VB Syntax FitToBorder
VB Example oEditor.FitToBorder
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
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)
FlipHorizontal (Schematic Editor)
Flip items about the horizontal (x) axis
UI Access NA
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
["NAME:Selections", "Selections:=", [ _
"CompInst@R;2;4", "CompInst@C;1;1"]],
["NAME:FlipParame-
ters",
"Disconnect:=", true, "Rubberband:=", false])
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)
UI Access NA
Note:
For more information about the component name, schematic IDs, and formats, see the section Editor Scripting IDs.
[0.0165613577023499, -0.001])
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
oEditor.NameNets true, Array("NAME:NetNames",
VB Example
"Wire@net_2;41:1:=", "A[0]")
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
VB Example oDefinitionEditor.Pan
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.
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
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",
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
oDefinitionEditor.SendToBack Array("NAME:Selections",
VB Example
"Selections:=", Array( "SchObj@10"))
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:
AddMaterial (Maxwell)
Adds a local material.
<MaterialParams> Array [
"NAME: <name of the material to be added>",
Parameters <MatProperty>, <MatProperty>, ...
]
<MatProperty> Array Options will depend on what is specified. Some options include "AnisoProp-
erty", "CustomProperty", and "nonlinear."
<Unit> String Possible values for magnetic properties: delta_H: "Oe" saturation_mag:
"Gauss", "uGauss", "Tesla", "uTesla"
"Dir2Coeff:=" , "0",
"Dir2HMax:=" , "0A_per_meter",
"Dir2HMin:=" , "0A_per_meter",
"CoeffMatrixSize:=" , 3, # <int> [0, 3]. If “PropertyModelType” is “4”, size cannot be
0 (should not be empty)).
#CoeffMatrixSize = 3” means 3x3 matrix size, and matrix elements (C11, C12, .. C33) are
specified in CoeffMatrix block.
"IsCoeffMatrixSymmetric:=", True,
[
"NAME:CoeffMatrix", # if size is 3, has matrix elements C11, C12, … C33 , no ele-
ment if size is 0
"C11:=" , "5",
"C12:=" , "0",
"C13:=" , "0",
"C21:=" , "0",
"C22:=" , "4",
"C23:=" , "0",
"C31:=" , "0",
"C32:=" , "0",
"C33:=" , "3"
],
"CoeffMatrixHMax:=" , "10A_per_meter", #Value of Hmax
[
"NAME:Magnetostriction",
[
"NAME:Isotropic",
[
"NAME:OneVariation",
"DatasetMapsName:=" , "Lambda-H curves versus Stress"
]
],
[
"NAME:Direction1",
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")
"property_type:=", "nonlinear",
"BTypeForSingleCurve:=", <string>,
"Hunit:=", <string>", "Bunit:=", <string>,
"IsTemperatureDependent:=", <bool>,
Array("NAME:BHCoordinates",
Array("NAME:Coordinate", "X:=", <value>, "Y:=", <value>, ...
BTypeForSingleCurve
Type: <string>
Should be one of the following: "Intrinsic", or "Normal" ( defaults to Normal if nothing is specified). An error message
displays in the Message Window if the string does not match either "Normal" or "Intrinsic"; advising the user of this
and informing the user that this property has been set to "Normal".
Hunit
Type: <string>
Possible values: "Oe", "A_per_meter", "kA_per_meter"
Bunit
Type: <string>
Possible values: "tesla", "kTesla", "uGauss"
IsTemperatureDependent
Type: <bool>
possible values: True or False
Array("NAME:<PropertyName>",
"property_type:=", "VectorProperty", "Magnitude:=", <value>", "DirComp1:=", <value>, "DirCom-
p2:=", <value>, "DirComp3:=", <value>))
<MatProperty> (choice material)
Array("NAME:<PropertyName>",
"property_type:=", "ChoiceProperty", "Choice:=", <string>")
Additional Examples
Example: oProject.AddMaterial Array("NAME:Material2",_
"dielectric_loss_tangent:=", "44",_
Array("NAME:saturation_mag",_
"property_type:=", "AnisoProperty",_
"unit:=", "Gauss",_ "component1:=", "11", _
"component2:=", "22", _ "component3:=", "33"), _
"delta_H:=", "44Oe")
Example: oDefinitionManager.AddMaterial Array("NAME:Material5",_
"CoordinateSystemType:=", _"Cartesian",_
Array("NAME:AttachedData"),_
Array("NAME:magnetic_coercivity", "property_type:=", _
"VectorProperty", "Magnitude:=", "-1A_per_meter",_
"DirComp1:=", "1", "DirComp2:=", _"2", "DirComp3:=",_
"3"))
Example: oDefinitionManager.AddMaterial Array("NAME:Material4",_
"CoordinateSystemType:=", _"Cartesian",_
Array("NAME:AttachedData"),_
Array("NAME:stacking_type", "property_type:=", _
"ChoiceProperty", "Choice:=", "Lamination"),_
"stacking_factor:=", "0",_
Array("NAME:stacking_direction", "property_type:=",_
"ChoiceProperty", "Choice:=", ""))
Note: Litz Wire properties are valid only for 2D/3D Transient and 2D/3D Eddy Current designs.
Array("NAME:wire_type", "property_type:=",
"ChoiceProperty", "Choice:=", "Round"), "strand_number:=", "16", "twisting_length_factor:="
,"1.1", "wire_diameter:=" "2mm")
Example (Rectangular Litz Wire): oDefinitionManager.AddMaterial Array("NAME:LitzMa-
terialRectangular",_
...
Array("NAME:stacking_type", "property_type:=", "ChoiceProperty", "Choice:=", "Litz Wire"),
...
Array("NAME:wire_type", "property_type:=", _
"ChoiceProperty", "Choice:=", "Rectangular"), "strand_number:=", "5", "twisting_length_
factor:=" ,"1.1",
"wire_width:=", "5.5mm", "wire_thickness:=", "5.6",
Array("NAME:wire_thickness_direction", "property_type:=",
"ChoiceProperty", "Choice:=", "V(1)")
Array("NAME:wire_width_direction", "property_type:=",
"ChoiceProperty", "Choice:=", "V(2)")
)
Note: Young's Modulus and Poisson's Ratio properties are valid only for 2D and 3D Magnetostatic and Transient.
…
[
"NAME:youngs_modulus",
"property_type:=" , "AnisoProperty",
"unit:=" , "",
"component1:=" , "1",
"component2:=" , "1.5",
"component3:=" , "3"
],
[
"NAME:poissons_ratio",
"property_type:=" , "AnisoProperty",
"unit:=" , "",
"component1:=" , "4",
"component2:=" , "5",
"component3:=" , "6"
],
…
])
oDefinitionManager.AddMaterial "copper” ,
Array("NAME:copper",
…
Array("NAME:youngs_modulus",
"property_type:=", "AnisoProperty",
"unit:=", "",
"component1:=", "1",
"component2:=", "2",
"component3:=", "3"),
Array("NAME:poissons_ratio",
"property_type:=", "AnisoProperty",
"unit:=", "",
"component1:=", "4",
"component2:=", "5",
"component3:=", "6"),
…)
CloneMaterial
Clones a local material.
UI Access N/A
l 1 - Material is cloned.
l 0 - Existing material not found or a conflict with the new material name.
ComputeCoreLossCoefficients
Creates a current source.
UI Access N/A
Return Value l For Electrical Steel, returns the values for [Kh, Kc, Ke]
Single Curve:
oDefinitionManager.ComputeCoreLossCoefficients "Electrical Steel", 7670.5, Array("NAME:Coef-
VB Example ficientSetupData", "property_data:=", _
"coreloss_data", "coefficient_setup:=", "w_per_cubic_meter", "Frequency:=", _
"60Hz", "Thickness:=", "0mm", "Conductivity:=", "0", Array("NAME:Coordinates", Array("NAME:DimUnits", _
Multi Curves:
oDefinitionManager.ComputeCoreLossCoefficients "Electrical Steel", 7670.5, Array
("NAME:CoreLossMultiCurveData", "property_data:=", _
"coreloss_multi_curve_data", "coreloss_unit:=", "w_per_cubic_meter", Array("NAME:AllCurves", Array
VB Example ("NAME:OneCurve", "Frequency:=", _
"50Hz", Array("NAME:Coordinates", Array("NAME:DimUnits", "", ""), Array("NAME:Points", 0, 0, _
3, 6, 4, 12))), Array("NAME:OneCurve", "Frequency:=", "75Hz", Array("NAME:Coordinates", Array
("NAME:DimUnits", _
"", ""), Array("NAME:Points", 0, 0, 3, 9, 4, 16)))))
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.
EditMaterial (Maxwell)
Use: Modifies an existing material.
oDefinitionManager.EditMaterial("nonlinear_copper",
[
…
[
"NAME:conductivity",
"property_type:=" , "nonlinear",
[
"NAME:JECoordinates",
[
"NAME:DimUnits",
"V_per_meter",
"A_per_m2"
],
[
"NAME:Point",
0,
ple
0
],
[
"NAME:Point",
1,
2
],
[
"NAME:Point",
3,
4
]
]
]
])
Example using a Thermal Modifier for Electrical Steel Core Loss properties
#applicable to Electrical Steel and Power Ferrite core loss models in 3D Eddy Current and
3D Transient designs)
oDefinitionManager.EditMaterial("copper",
[
"NAME:copper",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic","Thermal","Structural"]
],
[
"NAME:AttachedData",
[
"NAME:MatAppearanceData",
"property_data:=" , "appearance_data"
]
],
[
"NAME:ModifierData",
[
"NAME:ThermalModifierData",
"modifier_data:=" , "thermal_modifier_data",
[
"NAME:all_thermal_modifiers",
[
"NAME:one_thermal_modifier",
"Property::=" , "core_loss_kh",
"Index::=" , 0,
"prop_modifier:=" , "thermal_modifier",
"use_free_form:=" , True,
"free_form_value:=" , "if(Temp > 1000cel, 1, if(Temp -
273.15cel, 1, 1))"
],
[
"NAME:one_thermal_modifier",
"Property::=" , "core_loss_kc",
"Index::=" , 0,
"prop_modifier:=" , "thermal_modifier",
"use_free_form:=" , True,
"free_form_value:=" , "if(Temp > 1000cel, 1, if(Temp -
273.15cel, 1, 1))"
],
[
"NAME:one_thermal_modifier",
"Property::=" , "core_loss_ke",
"Index::=" , 0,
"prop_modifier:=" , "thermal_modifier",
"use_free_form:=" , True,
"free_form_value:=" , "if(Temp > 1000cel, 1, if(Temp -
273.15cel, 1, 1))"
],
[
"NAME:one_thermal_modifier",
"Property::=" , "core_loss_kdc",
"Index::=" , 0,
"prop_modifier:=" , "thermal_modifier",
"use_free_form:=" , True,
"free_form_value:=" , "if(Temp > 1000cel, 1, if(Temp -
273.15cel, 1, 1))"
],
[
"NAME:one_thermal_modifier",
"Property::=" , "core_loss_equiv_cut_depth",
]
]
])
("NAME:Coordinate", "X:=",
96080, "Y:=", 2.073), Array("NAME:Coordinate", "X:=", 112100, "Y:=", 2.101),
Array("NAME:Coordinate", "X:=",
128110, "Y:=", 2.127), Array("NAME:Coordinate", "X:=", 144120, "Y:=", 2.151),
Array("NAME:Coordinate", "X:=",
176150, "Y:=", 2.197), Array("NAME:Coordinate", "X:=", 208180, "Y:=", 2.24),
Array("NAME:Coordinate", "X:=",
272230, "Y:=", 2.325), Array("NAME:Coordinate", "X:=", 304260, "Y:=", 2.37),
Array("NAME:Coordinate", "X:=",
336290, "Y:=", 2.42), Array("NAME:Coordinate", "X:=", 396000, "Y:=", 2.5))), "con-
ductivity:=",
"2000000", Array("NAME:magnetic_coercivity", "property_type:=", "VectorProperty",
"Magnitude:=",
"0A_per_meter", "DirComp1:=", "1", "DirComp2:=", "0", "DirComp3:=", "0"), Array
("NAME:core_loss_type", "property_type:=",
"ChoiceProperty", "Choice:=", "Hysteresis Model"), "core_loss_hci:=", "100000",
"core_loss_br:=",
"88", "core_loss_hkc:=", "333", "core_loss_equiv_cut_depth:=", "0.002meter")
"component1:=", "1",
"component2:=", "2",
"component3:=", "3"),
Array("NAME:poissons_ratio",
"property_type:=", "AnisoProperty",
"unit:=", "",
"component1:=", "4",
"component2:=", "5",
"component3:=", "6"),
…)
Note: Young's Modulus and Poisson's Ratio properties are valid only for 2D & 3D Magnetostatic and Transient.
"component2:=" , "1.5",
"component3:=" , "3"
],
[
"NAME:poissons_ratio",
"property_type:=" , "AnisoProperty",
"unit:=" , "",
"component1:=" , "4",
"component2:=" , "5",
"component3:=" , "6"
],
…
])
Example: Magnetostrictive stress and deformation with full magnetostriction matrix [3x3]
oDefinitionManager = oProject.GetDefinitionManager()
oDefinitionManager.EditMaterial("vacuum",
[
"NAME:vacuum",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic"]
],
[
"NAME:AttachedData",
[
"NAME:MatAppearanceData",
"property_data:=" , "appearance_data",
"Red:=" , 230,
"Green:=" , 230,
"Blue:=" , 230,
"Transparency:=" , 0.949999988079071
]
],
"permittivity:=" , "1",
[
"NAME:magnetostriction",
"property_type:=" , "CustomProperty",
"PropertyModelType:=" , 4, # Value of 1 (Linear), 2 (Nonlinear), 3 (Anisotropic), or 4
(Matrix option)
"Dir1ModelType:=" , 0,
"Dir2ModelType:=" , 0,
"IsoCoeff:=" , "0",
"IsoHMax:=" , "0A_per_meter",
"IsoHMin:=" , "0A_per_meter",
"Dir1Coeff:=" , "0",
"Dir1HMax:=" , "0A_per_meter",
"Dir1HMin:=" , "0A_per_meter",
"Dir1VecX:=" , "1",
"Dir1VecY:=" , "0",
"Dir1VecZ:=" , "0",
"Dir2Coeff:=" , "0",
"Dir2HMax:=" , "0A_per_meter",
"Dir2HMin:=" , "0A_per_meter",
"CoeffMatrixSize:=" , 3, # <int> - [0, 3]. If PropertyModelType is 4, (Matrix type),
size cannot be 0
# CoeffMatrixSize = 3 defines a 3x3 matrix size, and matrix elements (C11, C12, ..
C33) are specified in CoeffMatrix block
"IsCoeffMatrixSymmetric:=", False, # takes a Boolean value
[
"NAME:CoeffMatrix",
"C11:=" , "1.05",
"C12:=" , "2",
"C13:=" , "3",
"C21:=" , "4",
"C22:=" , "5",
"C23:=" , "6",
"C31:=" , "7",
"C32:=" , "8",
"C33:=" , "9"
],
"CoeffMatrixHMax:=" , "12A_per_meter", #Value of Hmax
[
"NAME:Magnetostriction",
[
"NAME:Isotropic",
[
"NAME:OneVariation",
"DatasetMapsName:=" , "Lambda-H curves versus Stress"
]
],
[
"NAME:Direction1",
[
"NAME:OneVariation",
"DatasetMapsName:=" , "Lambda-H curves versus Stress"
]
],
[
"NAME:Direction2",
[
"NAME:OneVariation",
"DatasetMapsName:=" , "Lambda-H curves versus Stress"
]
],
"SelectedDatasetMapsName:=", "Lambda-H curves versus Stress"
]
]
])
Note: Core Loss Y Parameter for Electrical Steel is valid only for 2D & 3D Eddy Current and Transient Designs.
Python Example: Core Loss Y Parameter for Electrical Steel (Simple Property)
oDefinitionManager = oProject.GetDefinitionManager()
oDefinitionManager.EditMaterial("steel_1008",
[
"NAME:steel_1008",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic","Thermal","Structural"]
],
...
...
[
"NAME:core_loss_type",
"property_type:=" , "ChoiceProperty",
"Choice:=" , "Electrical Steel"
],
"core_loss_kh:=" , "105.359604403558",
"core_loss_kc:=" , "0",
"core_loss_ke:=" , "2.08295141230884",
"core_loss_kdc:=" , "0",
"mass_density:=" , "7872",
[
"NAME:stacking_type",
"property_type:=" , "ChoiceProperty",
"Choice:=" , "Litz Wire"
],
"specific_heat:=" , "481",
"youngs_modulus:=" , "200000000000",
"poissons_ratio:=" , "0.25",
"thermal_expansion_coefficient:=", "1.26e-05",
"core_loss_equiv_cut_depth:=", "0.001meter",
[
"NAME:wire_type",
"property_type:=" , "ChoiceProperty",
"Choice:=" , "Round"
],
"strand_number:=" , "12",
"wire_diameter:=" , "3mm",
"core_loss_es_y:=" , "2.3"
])
Note: Core Loss Y Parameter for Electrical Steel is valid only for 2D & 3D Eddy Current and Transient Designs.
Python Example: Core Loss Y Parameter for Electrical Steel (Anisotropic Property)
oDefinitionManager = oProject.GetDefinitionManager()
oDefinitionManager.EditMaterial("steel_1008",
[
"NAME:steel_1008",
"CoordinateSystemType:=", "Cartesian",
"BulkOrSurfaceType:=" , 1,
[
"NAME:PhysicsTypes",
"set:=" , ["Electromagnetic","Thermal","Structural"]
],
...
...
[
"NAME:core_loss_type",
"property_type:=" , "ChoiceProperty",
"Choice:=" , "Electrical Steel"
],
"core_loss_kh:=" , "105.359604403558",
"core_loss_kc:=" , "0",
"core_loss_ke:=" , "2.08295141230884",
"core_loss_kdc:=" , "0",
"mass_density:=" , "7872",
[
"NAME:stacking_type",
"property_type:=" , "ChoiceProperty",
"Choice:=" , "Litz Wire"
],
"specific_heat:=" , "481",
"youngs_modulus:=" , "200000000000",
"poissons_ratio:=" , "0.25",
"thermal_expansion_coefficient:=", "1.26e-05",
"core_loss_equiv_cut_depth:=", "0.001meter",
[
"NAME:wire_type",
"property_type:=" , "ChoiceProperty",
"Choice:=" , "Round"
],
"strand_number:=" , "12",
"wire_diameter:=" , "3mm",
[
"NAME:core_loss_es_y",
"property_type:=" , "AnisoProperty",
"unit:=" , "",
"component1:=" , "1",
"component2:=" , "2",
"component3:=" , "3" ]
])
Additional VB Examples
Example:Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("pmsg-1_test")
Set oDefinitionManager = oProject.GetDefinitionManager()
oDefinitionManager.EditMaterial "M19-24G_3DSF0.950", Array("NAME:M19-24G_3DSF0.950", "Coordin-
ateSystemType:=",
"Cartesian", "BulkOrSurfaceType:=", 1, Array("NAME:PhysicsTypes", "set:=", Array(
Example:Litz Wire
Note: Litz Wire properties are valid only for 2D/3D Transient and 2D/3D Eddy Current designs.
oDefinitionManager.EditMaterial Array("NAME:LitzMaterialRound",
...
Array("NAME:wire_type", "property_type:=",
"ChoiceProperty", "Choice:=", "Round"), "strand_number:=", "16", "twisting_length_factor:="
,"1.1", "wire_diameter:=", "2mm")
Note: Example using a Thermal Modifier for Electrical Steel Core Loss properties (applicable to both Electrical Steel and
Power Ferrite core loss models in 3D Eddy Current and 3D Transient designs)
Note: B-P Curve properties for Core Loss model are valid only for 2D/3D Transient and 2D/3D Eddy Current designs.
Array("NAME:core_loss_type",
"property_type:=", "ChoiceProperty",
"Choice:=", "B-P Curve"),
"core_loss_kdc:=", "0",
"mass_density:=", "7872",
"specific_heat:=", "481",
"youngs_modulus:=", "200000000000",
"poissons_ratio:=", "0.25",
"thermal_expansion_coefficient:=", "1.26e-05",
"core_loss_equiv_cut_depth:=", "0.001meter",
Array("NAME:core_loss_curves",
"property_type:=", "nonlinear",
"PUnit:=", "kw/m^3",
"BUnit:=", "tesla",
"Frequency:=", "60Hz",
"Thickness:=", "0.5mm",
"IsTemperatureDependent:=", true,
Array("NAME:BPCoordinates",
Array("NAME:DimUnits", "", "")),
Array("NAME:Temperatures",
Array("NAME:Temperature", "TempRef:=", "10cel",
Array("NAME:BPCoordinates",
GetProjextMaterialNames
Returns the material names belonging to an active Project.
UI Access N/A
ExportMaterial
Exports a local material to a library.
RemoveMaterial
Removes a material from a library.
oDefinitionManager.RemoveMaterial
VB Example
"Material1", false, "mo0907","UserLib"
RemoveUnusedDefinitions
Removes any unused project definitions.
])
VB RemoveUnusedDefinitions <Definitions>
Syntax
VB
oProject.RemoveUnusedDefinitions Array(Array("NAME:Materials", "Al-Extruded"), Array
Exampl- ("NAME:SurfaceMaterials", _
e "Steel-oxidised-surface"))
Export
GetNPortData
GetSolverOnDemandData
GetSolverOnDemandModelList
Remove
RemoveSolverOnDemandMode
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>),
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.
// 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
<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>:
<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>:
<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" :
<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>,
"Terminal:=", <TerminalInfo>, ...
The remaining parameters are optional.
["NAME:Parameters", // any combo of the following
Python Syntax
"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(
[
"NAME:Component",
Python Example "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
])
"RefNode:=", <bool>,
"InterpY:=", <bool>, // true to choose interpolating
"InterpAlg:=", <InterpolationAlgorithm>,
"NewToOldMap:=", <NewToOldMapPairs>,
"OldToNewMap:=", <OldToNewMapPairs>,
"PinNames:=", Array(<string>, <string>...))
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
<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", _
"DCBehaviorTab:=", <bool>,
"SolutionName:=", <string>,
"displayformat:=", <DisplayInfo>,
"datatype:=", <string>, // "SMatrix", "YMatrix", or "ZMatrix"
"ShowRefPin:=", <bool>,
"RefNodeCheckbox:=", <bool>, ...
<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
// 3 : Constant magnitude, linear phase extrapolation
// 4 : Leave all signal lines open circuited
// 5 : Short all signal lines together
// 6 : Short all signal lines to ground
<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.
Return Value: Returns the name of the model added.
ClearSolutionCache [component manager]
Use: Clear the solution cache for dynamic link component.
Command:Each of the following commands will clear the solution cache:
— Dynamic Link Item RCM > Clear Solution Cache
— Dynamic Link Component in schematic RCM > Clear Solution Cache
Syntax: ClearSolutionCache <Component Name >
Return Value: None
Parameters: <component name> is the name of the dynamic link component
VB Example:
oComponentManager.ClearSolutionCache "TeeModel1"
Edit [component manager]
Modifies an existing component
Command: Tools > Edit Configured Libraries > Components > Edit Component
Syntax: Edit <ComponentName>,
Array("NAME:<NewComponentName>",
"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>),
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.
// 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
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>:
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>
Array()
<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)
"NetlistString:=", <string>
VB Example:
Dim name
name = oComponentManager.Edit ("Nexxim Circuit Elements\BJTs:Level01_NPN", _
Array("NAME:Level01_NPN", _
"Info:=", Array("Type:=", 4294901764,_
"NumTerminals:=", 3, _
"DataSource:=", "Ansys built-in component", _
"ModifiedOn:=", 1152722112, _
"Manufacturer:=", "", _
"Symbol:=", "nexx_bjt_npn", _
"Footprint:=", "", _
"Description:=", "BJT, GP, NPN", _
"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", _
"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:=", "", _
"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>
"Terminal:=", <TerminalInfo>,
"Terminal:=", <TerminalInfo>, ...
#The remaining parameters are optional
["NAME:Parameters", // any combo of the following
Python Syntax
"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:=", "", _
Python
"Symbol:=", "nexx_bjt_npn", "Footprint:=", "", _
Example
"Description:=", "BJT, GP, NPN", "InfoTopic:=", "NXBJT1.htm", _
"InfoHelpFile:=", "nexximcomponents.chm", "IconFile:=", "bjtsn.bmp", _
"Library:=", "Nexxim Circuit Elements\BJTs",_
"OriginalLocation:=", "SysLibrary ", "Author:=", "", _
["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
<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>,
<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
<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 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, _
<ComponentName>:
<string> // composite name of the component to export
<LibraryLocation>:
<string> // location of the library in <LibraryName>
// One of "Project", "PersonalLib", or "UserLib"
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.
Parameters: None
VB Example:
Dim componentNames
componentNames = oComponentManager.GetNames()
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.
Parameters: <ComponentName>:
<string> // composite name of the component to remove
<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"
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.
VB Example:
oComponentManager.UpdateDynamicLink("TeeModel_L1")
materialData = oMaterialMgr.GetData("MyMaterial2")
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
Boolean True or False. If you use False or only a single argument, then GetProperties
returns only the properties that are different from the defaults.
Add
ConvertToDynamic
ConvertToParametric
Edit
EditWithComps
Export
GetData
GetNames
IsUsed
Remove
RemoveUnused
Add [model manager]
Use: Add a model
Command: Tools > Edit Configured Libraries > Models > Add Model
Syntax: Add Array("NAME:<modelName>",
"ModTime:=", <ModifiedTimeInfo>,
"Library:=", "", // Library name
"LibLocation:=", "Project", // Project Location
<PinDefInfo>,
<PinDefInfo>,... // optional, to define pins
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
<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
<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>:
<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>:
<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:
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]
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
<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
<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")
Export [model manager]
Use: Exports model(s) to a library
Command: Tools > Edit Configured Libraries > Models > Export to Library
Syntax: Export Array("NAME:<LibraryName>",
<ModelName>,
<ModelName>...),
<LibraryLocation>
<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"
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 ModelData
ModelData = oModelManager.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.
Syntax: GetNames()
Return Value: An array of strings
Parameters: None
VB Example:
Dim modelNames
modelNames = oModelManager.GetNames()
<IsProjectModel>:
<bool>
<LibraryName>:
<string> // name of the library
<LibraryLocation>:
VB Example:
oModelManager.Remove "Nexxim Circuit Elements\Distributed\Distributed:bendo", true, "Project"
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.
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. [1 , 2GHz, ...) to use, or ["all"]. To export all frequencies,
use ["all"]. If no frequencies are specified, all frequencies 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.
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
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>,
<bool>, // is plotter font
<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
<GraphicsDataInfo>, // optional, to define graphics
<PropDisplayMapInfo>), // optional, to define property displays
Array(<ListOfComponentNames>) // Component names
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
<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
<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), _
<SymbolName>...),
<LibraryLocation>
Return Value: None
Parameters: <LibraryName>:
<string> // name of the library
<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>)
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:
oSymbolManager.Remove "Nexxim Circuit Elements\Distributed\Distributed:bendo", true, "Project"
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.
"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>,
"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>,...))
<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:=", "")), _
"SLayer:=", Array("Layer:=", Array("N:=", "Dielec3", _
"ID:=", 11, _
"T:=", "dielectric", _
"Col:=", 8323199, _
"Pat:=", 6), _
"Elev:=", "none", _
"SubL:=", Array("Th:=", "1mm", _
"LElev:=", "78.740157480315mil", _
"R:=", "0mm", _
"Mat:=", "")), _
"SLayer:=", Array("Layer:=", Array("N:=", "Trace2", _
"ID:=", 10, _
"T:=", "signal", _
"Col:=", 8355584, _
"Pat:=", 5), _
"Elev:=", "mid", _
"SubL:=", Array("Th:=", "0mm", _
"LElev:=", "78.740157480315mil", _
"R:=", "0mm", _
"Mat:=", "")), _
"SLayer:=", Array("Layer:=", Array("N:=", "Dielec2", _
"ID:=", 6, _
"T:=", "dielectric", _
"Col:=", 8323072, _
"Pat:=", 4), _
"Elev:=", "none", _
"SubL:=", Array("Th:=", "1mm", _
"LElev:=", "39.3700787401575mil", _
"R:=", "0mm", _
"Mat:=", "")), _
"SLayer:=", Array("Layer:=", Array("N:=", "Trace1", _
"ID:=", 0, _
"T:=", "signal", _
"Col:=", 32512, _
"Pat:=", 3), _
"Elev:=", "mid", _
"SubL:=", Array("Th:=", "0mm", _
"LElev:=", "39.3700787401575mil", _
"R:=", "0mm", _
"Mat:=", "")), _
"SLayer:=", Array("Layer:=", Array("N:=", "Dielec1", _
"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", _
"h:=", "W", _
"Vds:=", Array())), _
Array("NAME:Pins",
"P:=", Array("Port:=", Array("Id:=", 3, "N:=", "n1"), _
"Pos:=", Array("x:=", "-P/2", "y:=", "0mm"), _
"VRt:=", "180deg", _
"Ref:=", "NoPad SMT East", _
"Frm:=", 12, _
"To:=", 9, _
"Lyr:=", Array("Map:=", Array("U:=", "forward",_
"F:=", Array(-1, -1, -1, -1,_
-1, -1, -1, -1,_
-1, -1, 0, -1, -1), _
"B:=", Array(10))), _
"Use:=", Array()), _
"P:=", Array("Port:=", Array("Id:=", 4, "N:=", "n4"),_
"Pos:=", Array("x:=","P/2", "y:=", "0mm"),_
"HD:=", "1mm", _
"Ref:=", 3), _
"P:=", Array("Port:=", Array("Id:=",5, "N:=", "n2"),_
"Pos:=", Array("x:=", "-P/2", "y:=", "0mm"),_
"VRt:=", "180deg",_
"Ref:=", "NoPad SMT East",_
"Frm:=", 12, _
"To:=", 9, _
"Lyr:=", Array("Map:=", Array("U:=", "forward",_
"F:=", Array(0, -1, -1, -1, -1,_
-1, -1, -1, -1, _
-1, -1, -1, -1), _
"B:=", Array(0))), _
"Use:=", Array()), _
"P:=", Array("Port:=", Array("Id:=", 6, "N:=", "n3"), _
"Pos:=", Array("x:=", "P/2", "y:=", "0mm"),_
"HD:=", "1mm", _
"Ref:=", 5)), _
Array("NAME:Nets"), _
Array("NAME:CProps",
"VariableProp:=", Array("W", _
"UD", _
"", _
"1.5mm"),_
"VariableProp:=", Array("P", _
"UD", _
"", _
10mm"))))
"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
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>:
<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>,
"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>:
<string> // name of the layer material
<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
<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
<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>,...))
<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), _
"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")
Export [footprint manager]
Use: Export a footprint to a library
Command: Tools > Edit Configured Libraries > Footprints > Export to Library
Syntax: Export Array("NAME:<LibraryName>",
<FootprintName>,
<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"
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.
Syntax: GetNames()
Return Value: An array of strings
Parameters: None
VB Example:
Dim footprintNames
footprintNames = oFootprintManager.GetNames()
IsUsed [footprint manager]
Use: Used to determine if a footprint is used in the design.
Command: None
Syntax: IsUsed(<FootprintName>)
Return Value: <Boolean> // true if the specified footprint is used in the design
Parameters: <FootprintName>:
<string>
VB Example:
Dim isUsed
isUsed = oFootprintManager.IsUsed("MyFootprint")
Remove [footprint manager]
Use: Removes a footprint from a library
Command: Tools > Edit Configured Libraries > Footprints > Remove Footprint
Syntax: Remove <FootprintName>,
<IsProjectFootprint>,
<LibraryName>,
<LibraryLocation>
Return Value: None
Parameters: <FootprintName>:
<string> // composite name of the footprint to remove
<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"
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.
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
<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:
"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))
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>)
Return Value: <string> // composite name of the 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> // 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
"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
<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>:
<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:=", _
"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))
EditWithComps [padstack manager]
Use: Edit an existing padstack.
Command: None
Syntax: EditWithComps <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>,
Array(<ListOfComponentNames>) // Component names
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
"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>,
<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
<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
"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:=", _
<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:
oPadstackManager.Export Array("NAME:mylib", "myPadstack"), "PersonalLib"
GetData [padstack 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 padstackData
padstackData = oPadstackManager.GetData("NoPad SMT East")
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.
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:
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.
UI Access N/A
EditScript
Edits a script in the definition manager.
UI Access N/A
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"
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"
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"))
<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
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>
For changing PropDisplays, these attributes are used to identify which attributes to change and what the new value is. If the
attribute should not be changed, the corresponding entry should be omitted.
"NewName:=", <string>,
"NewFormat:=", <PropDisplayType>,
"NewLocation:=", <PropDisplayLocation>,
"NewLayer:=", <string>,
"NewStyle:=", <string>
<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>
<TuningFlagsArray>, <SensitivityFlagsArray>,
<StatisticsFlagsArray>
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"))))
oDesign.ChangeProperty Array("NAME:AllTabs",_
Array("NAME:LocalVariableTab",_
Array("NAME:PropServers", "DefinitionParameters"),_
Array("NAME:DeletedProps", "height"))
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), _
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.
Syntax: CreateCircle
Return Value: None
VB Example:
oDefinitionEditor.CreateCircle Array("NAME:CircleData", _
"X:=", -0.004572, "Y:=", -0.000508, _
"Radius:=", 0.001778, "Id:=", 12), _
Array("NAME:Attributes", "Page:=", 1)
Parameters: Array("NAME:ImageData",
"X1:=", double, // the image rectangle left X value, in meters
"Y1:=", double, // the image rectangle upper Y value, in meters
"X2:=", double, // the image rectangle right X value, in meters
"Y2:=", double, // the image rectangle lower Y value, in meters
"File:=", string, // the name of the BMP or GIF file
"DisplayBorder:=", bool, // true or false, whether to display the image border
"LineWidth:=", double, // the width of the image border, in meters
"Color:=", int, // the RBG value of the image border color
"Id:=", int), // Id for this item
Array("NAME:Attributes",
"Page:=", int) // [Opt=1] The page number (one-based)
Example: oDefinitionEditor.CreateImage Array("NAME:ImageData", "X1:=", 0.00229684174875881,
"Y1:=", _ 0.00100608189091032, "X2:=", 0.00890589813779289, "Y2:=", -0.00432967005619977,
"File:=", "C:/Documents and Settings/user/Desktop/logo.gif", "DisplayBorder:=", false,
"LineWidth:=", 0, "Color:=", 0, "Id:=", 22), Array("NAME:Attributes", "Page:=", 1)
CreateLine (Symbol Editor)
Draws a line in the symbol editor
Command: None
Syntax: CreateLine
VB Example:
oDefinitionEditor.CreateLine Array("NAME:LineData", _Return Value: None
oDefinitionEditor.CreateText Array("NAME:Selections", _
"Page:=", page number, _ // [Opt=1] Page number
"Selections:=", IDs to modify)) 1)
Type: String
Path, name and extension for the file to be saved.
Example: Dim oSymbolEditor
Set oSymbolEditor = oProject.SetActiveDefinitionEditor("SymbolEditor", _
"Simplorer Elements\basic Elements\Circuit\Passive Elements:R")
oSymbolEditor.ExportFile "EMF", "c:\sym.emf"
FlipHorizontal (Symbol Editor)
To flip the specified objects about the horizontal (x) axis.
Command:Draw>Flip Horizontal
Syntax: FlipHorizontal Array("NAME:Selections", "Selections:=", Array(<selections>)), 0
Return Value: None.
Parameters: <selections>
Type: Comma-separated list of strings
Identifiers for each selected item to be flipped, in the form SchObj@<id>, where id is the value of the SchematicID property for
each element.
Example: Dim oSymbolEditor
Set oSymbolEditor = oProject.SetActiveDefinitionEditor("SymbolEditor", _
"Simplorer Elements\basic Elements\Circuit\Passive Elements:R")
oSymbolEditor.FlipHorizontal Array("NAME:Selections", "Selections:=", Array("SchObj@11")), 0
"SnapToGrid:=", true,
"BackgroundColor:=", 0x00ffffff, // White
"SaveAsDefault:=", false)
Move (Symbol Editor)
To move the specified objects in X and Y.
Command:None.
Syntax: Move Array("NAME:Selections", "Selections:=", Array(<selections>)), Array("NAME:FlipParameters", "xdelta:=", <xval>,
"ydelta:=",<yval>)
Return Value: None.
Parameters: <selections>
Type: Comma-separated list of strings
Identifiers for each selected item to be moved, in the form SchObj@<id>, where id is the value of the SchematicID property for
each element.
<xval>
Type: Real number
The X delta to move.
<yval>
Type: Real number
The Y delta to move.
Example: Dim oSymbolEditor
Set oSymbolEditor = oProject.SetActiveDefinitionEditor("SymbolEditor",
UI Access Tools > Edit Libraries > Symbols. From Symbol editor, click View > Levels > Remove Level.
Parameters: <level>
Type: Integer
The new active level.
Example: Dim oSymbolEditor
Set oSymbolEditor = oProject.SetActiveDefinitionEditor("SymbolEditor", _
"Simplorer Elements\basic Elements\Circuit\Passive Elements:R")
oldLevel = oSymbolEditor. SetActiveLevel (4)
SetInitialLevels (Symbol Editor)
Sets one or more graphics levels as the default visible levels for a symbol. The levels submitted do not need to contain 1 or 0, which
are always visible.
Tools > Edit Libraries > Symbols. From Symbol editor, click View > Levels. Select the Default check box for
UI Access
desired levels.
Dim
oSymbolEditor
Set oSymbolEditor = oProject.SetActiveDefinitionEditor("SymbolEditor",
VB Example _
"Simplorer Elements\basic Elements\Circuit\Passive
Elements:R")
oldLevel = oSymbolEditor.SetInitialLevels(Array(3,4))
Tools > Edit Libraries > Symbols. From Symbol editor, click View > Levels. Select the Visible check box for
UI Access
the desired levels.
oSymbolEditor.Undo()
oSymbolEditor.ZoomOut
ZoomPrevious (Symbol Editor)
To zoom the current graphics view area to the previous extents.
Command:View>Zoom Previous
Syntax: ZoomPrevious
Return Value: None.
Parameters: None.
Example: Dim oSymbolEditor
Set oSymbolEditor = oProject.SetActiveDefinitionEditor("SymbolEditor",
"Simplorer Elements\basic Elements\Circuit\Passive Elements:R")
oSymbolEditor.ZoomPrevious
ZoomToFit (Symbol Editor)
Set the current symbol zoom to fit the contents of the currently visible page
Command: None
Syntax: ZoomToFit()
Return Value: None
26-48
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell 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.
28 - Example Scripts
This section contains VBScript and IronPython example scripts.
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("Ansoft.ElectronicsDesktop")
Set oDesktop = oAnsoftApp.GetAppDesktop()
Set oProject = oDesktop.GetActiveProject()
Set oDesign = oProject.GetActiveDesign()
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
’ Declare the arrays and variables needed for building the polyline.
’
Dim points(), segments()
Dim NumPoints, R(2), P(2), PointsPerTurn, Turns, Units
’
"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
Radius = R(0) + ((n-1)/NumPoints)*(R(1)-R(0))
Pitch = P(0) + ((n-1)/NumPoints)*(P(1)-P(0))
Rise = (n-1)*Pitch/PointsPerTurn
’
oEditor.SweepAlongPath _
Array("NAME:Selections", "Selections:=", _
"Circle_Helix,Line_Helix"),
Array("NAME:PathSweepParameters", "DraftAngle:=", "0deg", _
"DraftType:=", "Round", "TwistAngle:=", "0deg")
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" & _
stn & " : Sweep" & swn,cfreq, "")
z = val
'
' Create the line of text to send to the file and write it to the
file.
'
line = x & chr(9) & y & chr(9) &z
ofile.WriteLine line
Next
'
' Delete the 2 output variables before finishing.
'
oDesign.DeleteOutputVariable "re_S"
oDesign.DeleteOutputVariable "im_S"
'
' Close the file.
'
ofile.close
End if
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", "", ""]]
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
])
Index
CreatePolyline 8-47
3
CreateRectangle 8-53
3D Modeler editor commands 8-1
CreateRegion 8-55
AssignMaterial 8-142
CreateRegularPolygon 8-62
Chamfer 8-145
CreateRegularPolyhedron 8-59
ChangeProperty 8-263
CreateRelativeCS 8-168
Connect 8-147
CreateSphere 8-65
Copy 8-120
CreateSpiral 8-67
CoverLines 8-148
CreateTorus 8-69
CoverSurfaces 8-149
CreateUserDefinedModel 8-72
CreateBondwire 8-10
CreateUserDefinedPart 8-40, 8-79
CreateBox 8-14
Delete 8-270
CreateCircle 8-16
DeleteEmptyGroups 8-170
CreateCone 8-19
DeleteLastOperation 8-171
CreateCutplane 8-22
DeletePolylinePoint 8-121
CreateCylinder 8-24
DetachFaces 8-172
CreateEllipse 8-26
DuplicateAlongLine 8-122
CreateEntityList 8-150
DuplicateAroundAxi 8-125
CreateEquationCurve 8-29
DuplicateMirror 8-128
CreateEquationSurface 8-33
Edit3dComponent 8-89
CreateFaceCS 8-152, 8-158
EditEntityList 8-173
CreateGroup 8-157
EditFaceCS 8-175
CreateHelix 8-36
EditObjectCS 8-181
CreateObjectFromdges 8-165
EditPolyline 8-92
CreateObjectFromFaces 8-166
EditRelativeCS 8-188
CreatePoint 8-38
Index-1
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-2
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-3
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-4
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
B AssignVoltageDropGroup 11-61
Index-5
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-6
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-7
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-8
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-9
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-10
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
GetSchematicEnvironment 4-35
Index-11
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-12
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-13
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-14
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
ClearAllNamedExpr 17-11
G
CopyNamedExprToStack 17-11
general method script commands 24-
DeleteNamedExpr 17-12 45
EnterComplex 17-13 GenerateHistory 8-199
EnterComplexVector 17-13 GenerateVariationData Parametric,
EnterLine 17-14 parametric command 14-20
Index-15
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-16
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-17
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-18
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
L EditThinLayer 11-43
Index-19
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-20
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-21
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-22
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-23
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-24
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-25
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-26
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
Index-27
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.
Maxwell Scripting Guide
U V
UncoverFaces 8-238 ValidateDesign 7-70
Undo 26-44 Variable Naming Conventions 1-4
project-level command 2-59 variables
Ungroup 8-241 array 1-4
UnGroupPlotCurvesInGroup 10-88 assigning information 1-3
Unite 8-240 declaring 1-3
UpdateAllFieldsPlots 16-58 hierarchy in HFSS 1-74
UpdateAllReports 10-82 used in HFSS scripts 1-74
UpdateComponentDefinition 8-119 VBScript 1-2
UpdateDefinitions, project-level Microsoft user’s guide 1-12
command 2-60
operators 1-5
UpdateDynamicLink 25-118
references 1-12
UpdateQuantityFieldsPlots 16-59
VBScript Procedures 1-10
UpdateReports 10-82
UpdateTraces 10-83 W
UpdateTracesContextAndSweeps Wire (Schematic Editor) 24-99
10-86
WrapSheet 8-242
User defined documents module
commands
Z
GetDocumentNames 20-8
ZoomArea 24-100, 26-45
User defined solution module com-
ZoomIn 24-101, 26-46
mands
ZoomOut 24-102, 26-46
CreateUserDefinedSolution 21-
1 ZoomPrevious 24-103, 26-47
DeleteUserDefinedSolutions 21- ZoomToFit 24-104, 26-47
3
EditUserDefinedSolution 21-4
Index-28
Ansys Electromagnetics Suite 2024 R1 - © ANSYS, Inc. All rights reserved. - Contains proprietary and confidential
information of ANSYS, Inc. and its subsidiaries and affiliates.