- 积分
- 1483
- 回帖
- 0
- 西莫币
-
- 贡献
-
- 威望
-
- 存款
-
- 阅读权限
- 30
- 最后登录
- 1970-1-1
该用户从未签到
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
我原本想变换不同不同转角运算不同力然后结果存入不同文件, 希望大家帮忙
Dim oAnsoftApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oAnsoftApp = CreateObject("AnsoftMaxwell.MaxwellScriptInterface")
Set oDesktop = oAnsoftApp.GetAppDesktop()
oDesktop.RestoreWindow
oDesktop.OpenProject _
"C:/study-Ansoft/DUMP-0.4-0-acuratedegP.mxwl"
Set oProject = oDesktop.SetActiveProject("DUMP-0.4-0-acuratedegP")
Set oDesign = oProject.SetActiveDesign("0.4eccentricity")
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.Delete Array("NAME:Selections", "Selections:=", "air_gap")
for i=199 to 200
rangledeg=i*1.8
oEditor.Rotate Array("NAME:Selections", "Selections:=", _
"N1,N2,N3,N4,N5,S1,S2,S3,S4,S5,rotor_core,axis", "NewPartsModelFlag:=", "Model"), Array("NAME:RotateParameters", "RotateAxis:=", _
"Z", "RotateAngle:=", "rangledeg")
oEditor.CreateCircle Array("NAME:CircleParameters", "IsCovered:=", true, "XCenter:=", _
"0mm", "YCenter:=", "0mm", "ZCenter:=", "0mm", "Radius:=", "20.0000000000000mm", "WhichAxis:=", _
"Z", "NumSegments:=", "0"), Array("NAME:Attributes", "Name:=", "Circle7", "Flags:=", _
"", "Color:=", "(132 132 193)", "Transparency:=", 0, "PartCoordinateSystem:=", _
"Global", "UDMId:=", "", "MaterialValue:=", "" & Chr(34) & "vacuum" & Chr(34) & "", "SolveInside:=", _
true)
oEditor.Subtract Array("NAME:Selections", "Blank Parts:=", "Circle7", "Tool Parts:=", _
"axis,N1,N2,N3,N4,N5,rotor_core,S1,S2,S3,S4,S5"), Array("NAME:SubtractParameters", "KeepOriginals:=", _
true)
oEditor.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geometry3DAttributeTab", Array("NAME:PropServers", _
"Circle7"), Array("NAME:ChangedProps", Array("NAME:Name", "Value:=", "air_gap"), Array("NAME:Material", "Value:=", _
"" & Chr(34) & "air" & Chr(34) & ""))))
Set oModule = oDesign.GetModule("MeshSetup")
oModule.AssignLengthOp Array("NAME:air_gap", "RefineInside:=", false, "Enabled:=", _
true, "Objects:=", Array("air_gap"), "RestrictElem:=", true, "NumMaxElem:=", _
"1512", "RestrictLength:=", false, "MaxLength:=", "8.00000005342773mm")
oDesign.ApplyMeshOps Array("Setup1")
oDesign.Analyze "Setup1"
Set oModule = oDesign.GetModule("FieldsReporter")
oModule.CreateFieldPlot Array("NAME:Mesh1", "SolutionName:=", "Setup1 : LastAdaptive", "QuantityName:=", _
"Mesh", "PlotFolder:=", "MeshPlots", "FieldType:=", "Fields", "UserSpecifyName:=", _
0, "UserSpecifyFolder:=", 0, "StreamlinePlot:=", false, "IntrinsicVar:=", "", "PlotGeomInfo:=", Array( _
1, "Surface", "FacesList", 26, "7", "7316", "7317", "7318", "7319", "7320", _
"7321", "7322", "7323", "7324", "7325", "7326", "7327", "11890", "11894", _
"11905", "11916", "11927", "11938", "11949", "11960", "11971", "11982", "11996", _
"12002", "12327"), "FilterBoxes:=", Array(0), "Real time mode:=", true, Array("NAME:MeshSettings", "Scale factor:=", _
100, "Transparency:=", 0, "Mesh type:=", "Shaded", "Surface only:=", true, "Add grid:=", _
true, "Refinement:=", 0, "Use geometry color:=", true, "Mesh line color:=", Array( _
0, 0, 255), "Filled color:=", Array(255, 255, 255)))
oModule.CreateFieldPlot Array("NAME:Flux_Lines1", "SolutionName:=", _
"Setup1 : LastAdaptive", "QuantityName:=", "Flux_Lines", "PlotFolder:=", "A", "UserSpecifyName:=", _
0, "UserSpecifyFolder:=", 0, "StreamlinePlot:=", false, "IntrinsicVar:=", "", "PlotGeomInfo:=", Array( _
1, "Surface", "FacesList", 26, "7", "7316", "7317", "7318", "7319", "7320", _
"7321", "7322", "7323", "7324", "7325", "7326", "7327", "11890", "11894", _
"11905", "11916", "11927", "11938", "11949", "11960", "11971", "11982", "11996", _
"12002", "12327"), "FilterBoxes:=", Array(1, ""), Array("NAME:PlotOnSurfaceSettings", "Filled:=", _
false, "IsoValType:=", "Line", "SmoothShade:=", true, "AddGrid:=", false, "MapTransparency:=", _
true, "Refinement:=", 0, "Transparency:=", 0, Array("NAME:Arrow3DSpacingSettings", "ArrowUniform:=", _
true, "ArrowSpacing:=", 0, "MinArrowSpacing:=", 0, "MaxArrowSpacing:=", 0), "GridColor:=", Array( _
255, 255, 255)))
oModule.CreateFieldPlot Array("NAME:Mag_B1", "SolutionName:=", _
"Setup1 : LastAdaptive", "QuantityName:=", "Mag_B", "PlotFolder:=", "B", "UserSpecifyName:=", _
0, "UserSpecifyFolder:=", 0, "StreamlinePlot:=", false, "IntrinsicVar:=", "", "PlotGeomInfo:=", Array( _
1, "Surface", "FacesList", 26, "7", "7316", "7317", "7318", "7319", "7320", _
"7321", "7322", "7323", "7324", "7325", "7326", "7327", "11890", "11894", _
"11905", "11916", "11927", "11938", "11949", "11960", "11971", "11982", "11996", _
"12002", "12327"), "FilterBoxes:=", Array(1, ""), Array("NAME:PlotOnSurfaceSettings", "Filled:=", _
false, "IsoValType:=", "Fringe", "SmoothShade:=", true, "AddGrid:=", false, "MapTransparency:=", _
true, "Refinement:=", 0, "Transparency:=", 0, Array("NAME:Arrow3DSpacingSettings", "ArrowUniform:=", _
true, "ArrowSpacing:=", 0, "MinArrowSpacing:=", 0, "MaxArrowSpacing:=", 0), "GridColor:=", Array( _
255, 255, 255)))
oProject.SaveAs _
"C:\study-Ansoft\DUMP-0.4-rangledeg-acuratedegP.mxwl", _
true
next |
|