微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > HFSS VBscript about ExportToFile, i'm lost

HFSS VBscript about ExportToFile, i'm lost

时间:03-31 整理:3721RD 点击:
I want to use HFSS API VBscript program to export the results to a file. But it doesn't work in HFSS10. It is said that the HFSS10 doesn't support the method "oDesign.ExportToFile". So how can i export the results to a file using the VBscript. I hope someone can give me a hint. Thank you so much.

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

Tip: When you aren't sure how to do something, click 'Record Script', do what you want, click 'Stop Recording' and view the file HFSS generates. Very instructive.

To answer your question, the HFSS documentation is incorrect in stating that 'ExportToFile' is a method of the Design Object. Rather, it is contained in the Report Setup Module.

Replace

Code:
oDesign.ExportToFile "SParam", "E:\ssp.txt"
with
Code:
Set oModule = oDesign.GetModule("ReportSetup")

oModule.ExportToFile "SParam", "E:\ssp.txt"
Hope this works for you...
上一篇:URGENT!!! HFSS help
下一篇:最后一页

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top