10
Maxwell v15
Create Design
To Create Design
Select the menu item Project > Insert Maxwell 2D Design, or click on the
icon
Save Project
To Save Project
Select the menu item File > Save
Save the file with the name Ex_9_10_BasicScripting2D.mxwl
9.10-#
9.10
Maxwell v15
Draw Circle
To Draw a Circle
Select the menu item Draw > Circle
1. Using the coordinate entry fields, enter the center of circle
X: 0, Y: 0, Z: 0, Press the Enter key
2. Using the coordinate entry fields, enter the radius
dX: 1, dY: 0, dZ: 0, Press the Enter key
Delete Circle
To Delete the Circle
Select the sheet Circle1 from history tree
Select the menu item Edit > Delete
9.10-#
Maxwell v15
9.10
Basic Exercises Scripting
Script Content
To open the Script in Editor
Locate the file on the Hard Disk and open it with Text Editor (say Textpad)
' ---------------------------------------------' Script Recorded by Ansoft Maxwell Version 15.0.0
' 10:23:17 PM Dec 18, 2011
' ---------------------------------------------Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Ex_9_10_BasicScripting2D")
Set oDesign = oProject.SetActiveDesign("Maxwell2DDesign1")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.CreateCircle
Array("NAME:CircleParameters",
"IsCovered:=",
true,
"XCenter:=", _ "0mm", "YCenter:=", "0mm", "ZCenter:=", "0mm", "Radius:=",
"1mm", "WhichAxis:=", _ "Z", "NumSegments:=", "0"), Array("NAME:Attributes",
"Name:=", "Circle1", "Flags:=",
_
"", "Color:=", "(132 132 193)",
"Transparency:=", 0.25, "PartCoordinateSystem:=", _ "Global", "UDMId:=", "",
"MaterialValue:=", "" & Chr(34) & "vacuum" & Chr(34) & "", "SolveInside:=", _
true)
9.10-#
Maxwell v15
9.10
Basic Exercises Scripting
9.10-#
9.10
Maxwell v15
Modify Script
Locate the line containing the Radius and change the numerical values to
5mm:
"Radius:=", "1mm", "WhichAxis:=", _ "Z",
"Radius:=", 5mm", "WhichAxis:=", _ "Z",
Save the file and return to Maxwell.
Delete Circle
To Delete the Circle
Select the sheet Circle1 from history tree
Select the menu item Edit > Delete
9.10-#
9.10
Maxwell v15
9.10-#