官方淘宝店 易迪拓培训 旧站入口
首页 > 微波射频 > 射频工程师交流 > 求助!HFSS生成的vb脚本为什么双击不能直接运行啊,总是加载失败。

求助!HFSS生成的vb脚本为什么双击不能直接运行啊,总是加载失败。

05-08
Dim oHfssApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oHfssApp  = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oHfssApp.GetAppDesktop()
oDesktop.RestoreWindow
Set oProject = oDesktop.SetActiveProject("Tee")
oProject.InsertDesign "HFSS", "HFSSModel1", "DrivenModal", ""
Set oDesign = oProject.SetActiveDesign("HFSSModel1")
oDesign.RenameDesignInstance "HFSSModel1", "Teemodel"
oDesign.SetSolutionType "DrivenModal"
Set oEditor = oDesign.SetActiveEditor("3D Modeler")
oEditor.SetModelUnits Array("NAME:Units Parameter", "Units:=", "in", "Rescale:=",  _
  false)
oEditor.CreateBox Array("NAME:BoxParameters", "XPosition:=", "0in", "YPosition:=",  _
  "-0.45in", "ZPosition:=", "0in", "XSize:=", "2in", "YSize:=", "0.9in", "ZSize:=",  _
  "0.4in"), Array("NAME:Attributes", "Name:=", "Box1", "Flags:=", "", "Color:=",  _
  "(132 132 193)", "Transparency:=", 0, "PartCoordinateSystem:=", "Global", "MaterialName:=",  _
  "vacuum", "SolveInside:=", true)
oEditor.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geometry3DAttributeTab", Array("NAME:PropServers",  _
  "Box1"), Array("NAME:ChangedProps", Array("NAME:Name", "Value:=", "Tee"))))
oEditor.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geometry3DAttributeTab", Array("NAME:PropServers",  _
  "Tee"), Array("NAME:ChangedProps", Array("NAME:Transparent", "Value:=", 0.4))))
Set oModule = oDesign.GetModule("BoundarySetup")
oModule.AssignWavePort Array("NAME:Port1", "NumModes:=", 1, "PolarizeEField:=",  _
  false, "DoDeembed:=", false, "DoRenorm:=", false, Array("NAME:Modes", Array("NAME:Mode1", "ModeNum:=",  _
  1, "UseIntLine:=", true, Array("NAME:IntLine", "Start:=", Array("2in", "0in", "0in"), "End:=", Array( _
  "2in", "0in", "0.4in")), "CharImp:=", "Zpi")), "Faces:=", Array(12))
oEditor.DuplicateAroundAxis Array("NAME:Selections", "Selections:=", "Tee"), Array("NAME:DuplicateAroundAxisParameters", "WhichAxis:=",  _
  "Z", "AngleStr:=", "90deg", "NumClones:=", 2), Array("NAME:Options", "DuplicateBoundaries:=",  _
  true)
oEditor.DuplicateAroundAxis Array("NAME:Selections", "Selections:=", "Tee"), Array("NAME:DuplicateAroundAxisParameters", "WhichAxis:=",  _
  "Z", "AngleStr:=", "-90deg", "NumClones:=", 2), Array("NAME:Options", "DuplicateBoundaries:=",  _
  true)
oEditor.Unite Array("NAME:Selections", "Selections:=", "Tee,Tee_1,Tee_2"), Array("NAME:UniteParameters", "KeepOriginals:=",  _
  false)
oEditor.CreateBox Array("NAME:BoxParameters", "XPosition:=", "1.2in", "YPosition:=",  _
  "-2.6in", "ZPosition:=", "0in", "XSize:=", "0.2in", "YSize:=", "0.4in", "ZSize:=",  _
  "0.2in"), Array("NAME:Attributes", "Name:=", "Box1", "Flags:=", "", "Color:=",  _
  "(132 132 193)", "Transparency:=", 0, "PartCoordinateSystem:=", "Global", "MaterialName:=",  _
  "vacuum", "SolveInside:=", true)
oDesign.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geometry3DCmdTab", Array("NAME:PropServers",  _
  "LocalVariables"), Array("NAME:NewProps", Array("NAME:offset", "PropType:=",  _
  "VariableProp", "UserDef:=", true, "Value:=", "0in"))))
oEditor.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geometry3DCmdTab", Array("NAME:PropServers",  _
  "Box1:CreateBox:1"), Array("NAME:ChangedProps", Array("NAME:Position", "X:=", "-0.45in", "Y:=",  _
  "offset-0.05in", "Z:=", "0in"), Array("NAME:XSize", "Value:=", "0.45in"), Array("NAME:YSize", "Value:=",  _
  "0.1in"), Array("NAME:ZSize", "Value:=", "0.4in"))))
oEditor.ChangeProperty Array("NAME:AllTabs", Array("NAME:Geometry3DAttributeTab", Array("NAME:PropServers",  _
  "Box1"), Array("NAME:ChangedProps", Array("NAME:Name", "Value:=", "Septum"))))
oEditor.Subtract Array("NAME:Selections", "Blank Parts:=", "Tee", "Tool Parts:=",  _
  "Septum"), Array("NAME:SubtractParameters", "KeepOriginals:=", false)
Set oModule = oDesign.GetModule("AnalysisSetup")
oModule.InsertSetup "HfssDriven", Array("NAME:Setup1", "Frequency:=", "10GHz", "PortsOnly:=",  _
  false, "MaxDeltaS:=", 0.02, "UseMatrixConv:=", false, "MaximumPasses:=", 3, "MinimumPasses:=",  _
  1, "MinimumConvergedPasses:=", 1, "PercentRefinement:=", 20, "ReducedSolutionBasis:=",  _
  false, "DoLambdaRefine:=", true, "DoMaterialLambda:=", true, "Target:=",  _
  0.3333, "PortAccuracy:=", 2, "SetPortMinMaxTri:=", false)
oModule.InsertDrivenSweep "Setup1", Array("NAME:Sweep1", "Type:=", "Interpolating", "InterpTolerance:=",  _
  0.5, "InterpMaxSolns:=", 20, "SetupType:=", "LinearStep", "StartFreq:=", "8GHz", "StopFreq:=",  _
  "10GHz", "StepSize:=", "0.05GHz", "SaveFields:=", false, "ExtrapToDC:=", false)
oProject.Save
oDesign.Solve Array("Setup1")
oProject.Save
oProject.Save

小编你试试先打开hfss再运行vbs。我之前也遇到这个问题,也不知道什么原因。

小编留言:

哦,好的,我试试,先谢谢你!

不知道,帮顶一下! !

不懂,但是帮忙顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶不懂,但是帮忙顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶不懂,但是帮忙顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶顶

tool  里面点击run script  选中你这个VB文件就可以了

小编留言:

谢谢

Top