寻求HFSS VBscript的朋友,有个问题请教
时间:10-02
整理:3721RD
点击:
我想把创建好的plot导出成一个数据文件(.txt),当然方法是通过VBscript实现。因为普通通过操作界面很简单就能实现。
现在不知道怎么搞的,我用的是HFSS10进行VBscript编写,在导出数据那块竟然通不过,大概意思是说不支持ExportToFile对象的方法。这可咋办,难道HFSS10这个功能没有,但是界面可以实现的话,我相信VBscript肯定有命令能实现这个功能。有没有朋友研究过这块,希望指教。
Dim oHfssApp
Dim oDesktop
Dim oProject
Dim oDesign
Dim oEditor
Dim oModule
Set oHfssApp = CreateObject("AnsoftHfss.HfssScriptInterface")
Set oDesktop = oHfssApp.GetAppDesktop()
oDesktop.RestoreWindow
oDesktop.OpenProject "E:/GPS.hfss"
Set oProject = oDesktop.GetActiveProject
Set oDesign = oProject.SetActiveDesign("GPS")
oDesign.CreateReport Array("NAME:SParam",_
"ReportType:=","Modal S Parameters",_
"DisplayType:=","Rectangular Plot", _
Array("NAME:Traces",_
Array("NAME:Trace1",_
"SolutionName:=","Setup1 : Sweep1",_
"Context:=","", _
"Freq:=", Array("All"), _
"XComponent:=", "freq",_
"YComponent:=", "db(S(p1,p1))",_
"YAxis:=",0)))
oDesign.ExportToFile "SParam", "E:\ssp.txt"
oProject.Save