微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > 电磁仿真讨论 > Controlling HFSS from Matlab

Controlling HFSS from Matlab

时间:03-31 整理:3721RD 点击:
hello

I am in Matlab in a loop where I have to call HFSS. I need to:

1. load a project file,
2. change some variables values
3. run the optimization in it
4. export results
5. save project

I have this Matlab routine I wrote (mostly guessing) and the HFSS test project file attached.

Questions:

1. It looks like when the directory string includes spaces, it won't work. Is this true?
2. I can't get line 12 & 13 to work. Is the syntax correct?

oDesign = oProject.SetActiveDesign('HFSSDesign1')
oModule = oDesign.GetModule('Optimetrics')


Please let me know if this can be done at all. I spent too much time guessing.

Thanks

Katto01

I found the solution, so if any body needs this, here it is

%=============================== start
%Setup up project information

fln='i:\file.hfss';
%gln=strcat(dir,fln)
oAnsoftApp = actxserver('AnsoftHfss.HfssScriptInterface');
oDesktop = oAnsoftApp.GetAppDesktop();
oDesktop.RestoreWindow();
%oDesign = oProject.SetActiveDesign('HFSSDesign1')
oDesktop.OpenProject (fln)

oProject = oDesktop.SetActiveProject('file');
oDesign = oProject.SetActiveDesign('HFSSDesign1');

%oModule = oDesign.GetModule('ReportSetup');
oModule = oDesign.GetModule('Optimetrics');



%oProject = oDesktop.SetActiveProject('file');



%Set Variables

oProject.ChangeProperty({'NAME:AllTabs', {'NAME:ProjectVariableTab', {'NAME:PropServers', ...
'ProjectVariables'}, {'NAME:ChangedProps', ...
{'NAME:Sepsr', 'Value:=', '0.5'}, ...
{'NAME:Smiur', 'Value:=', '3'}, ...
{'NAME:Setan_delta', 'Value:=', '.01'}, ...
{'NAME:Smtan_delta', 'Value:=', '.05'}}}});

%Save and Solve
oProject.Save();
oModule.SolveSetup('OptimizationSetup1')
%=============================== end

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

网站地图

Top