HFSS VBscript about ExportToFile, i'm lost

Status
Not open for further replies.

fushq

Newbie level 4
Joined
Nov 15, 2006
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,327
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...
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…