+ Post New Thread
Results 21 to 37 of 37

21st May 2008, 07:10 #21
 Join Date
 Jul 2004
 Posts
 250
 Helped
 30 / 30
 Points
 2,939
 Level
 12
mathlab hfss
has anybody got working examples on antenna in HFSS11 not earlier versions

Advertisement

13th June 2008, 05:27 #22
 Join Date
 Jun 2007
 Posts
 14
 Helped
 13 / 13
 Points
 1,519
 Level
 8
hfss11.2 download
Hi,
This is the famous HFSSAPI. It works well with HFSS9x. You could just follow these examples, and adapt them to HFSS11.
Have fun!
1 members found this post helpful.

16th June 2008, 11:43 #23
 Join Date
 Jan 2008
 Posts
 10
 Helped
 1 / 1
 Points
 1,172
 Level
 7
matlab api hfss
very useful!!!

26th September 2008, 06:12 #24
 Join Date
 Mar 2006
 Posts
 25
 Helped
 5 / 5
 Points
 2,613
 Level
 11
matlab hfssv11
hi couless
thanks for your kindness,
but i found that the script.pdf file you uploaded is the same as my own.
ansoft didn't update their this file correctly.
the outputvariable script has been deprecated as indicated in HFSS, although it still works.
i try to implement an API to export the network parameters, such as S,Y,Z,Gamma,Zo, just like the builtin script "oModule.ExportNetworkData"
but I can only export the results of the first frequency point, the later ones are all outflow, i don't know why

10th February 2009, 20:02 #25
 Join Date
 Jul 2008
 Posts
 53
 Helped
 1 / 1
 Points
 1,635
 Level
 9
hfssapi
abc
1 members found this post helpful.

Advertisement

8th March 2009, 10:57 #26
 Join Date
 Jun 2004
 Posts
 6
 Helped
 0 / 0
 Points
 1,557
 Level
 9
hfss matlab scripting
i try to optim antenna using PSO with HFSS

Advertisement

26th March 2009, 12:44 #27
 Join Date
 Apr 2008
 Posts
 9
 Helped
 3 / 3
 Points
 882
 Level
 6
hfssmatlab
Originally Posted by tyenergy

7th December 2009, 09:06 #28
 Join Date
 Sep 2009
 Location
 VietNam
 Posts
 5
 Helped
 0 / 0
 Points
 1,282
 Level
 8
Re: hfssmatlab
Originally Posted by danieldani

8th June 2010, 16:34 #29
 Join Date
 May 2010
 Location
 USA
 Posts
 2
 Helped
 3 / 3
 Points
 481
 Level
 4
Re: MATLABHFSSv11
This post has not been active for some time, but I haven't seen this information mentioned elsewhere; I will post it in the hopes that it is useful for someone.
Instead of generating VBscript code as text, writing it to a file, then executing in HFSS as the oftmentioned MATLABHFSS api operates, the current version of MATLAB supports COM objects directly. This means that Matlab scripts and functions can be created to directly execute and control HFSS live, without the delay caused by generating and executing a script. This is very handy for debugging purposes and the original design of the scripts.
(Note  I don't know which versions of Matlab support COM objects. I feel as though it is a relatively new feature ( I use R2009a ), but I don't remember.)
(Another note  since the real interface is the collection of COM objects and the methods that they implement, any programming language/framework that supports COM interop would work to control HFSS, not only Matlab and VBscript)
All of the same objects and function calls as the VBscript version will apply. The only difference between the vbscript and the Matlab version of the interface is different calling semantics.
For example: Where the vbscript uses an Array(...) in a method signature, use a cell array {..} in matlab. Use single quotes instead of double quotes. Wrap all of the arguments to the functions in parentheses, unlike the VB convention. Boolean values in matlab to be passed to HFSS functions can be either in Matlab booleans (true, false), or in string format ('true','false').
Here are some examples of how to translate between VB to matlab:
The setup code is nearly the same:
Code:hfss = actxserver('AnsoftHfss.HfssScriptInterface'); desktop = hfss.GetAppDesktop(); project = desktop.GetActiveProject(); design = project.GetActiveDesign(); editor = design.SetActiveEditor('3D Modeler'); boundary = design.GetModule('BoundarySetup');
Code:%name = HFSSBox(editor,name,position,size,varargin) %name/value parameters: Material, Color, SolveInside,Transparency function var = HFSSBox(editor,name,position,size,varargin) p = inputParser; p.addParamValue('Material','pec'); p.addParamValue('Color','(132 132 193)'); p.addParamValue('SolveInside',false); p.addParamValue('Transparency',0); p.parse(varargin{:}); mm = @(x)sprintf('%0.4fmm',x); var = editor.CreateBox({'NAME:BoxParameters','CoordinateSystemID:=',1,... 'XPosition:=',mm(position(1)),'YPosition:=',mm(position(2)),'ZPosition:=',mm(position(3)),... 'XSize:=',mm(size(1)),'YSize:=',mm(size(2)),'ZSize:=',mm(size(3))},... {'NAME:Attributes','Name:=',name,'Flags:=','','MaterialName:=',p.Results.Material,... 'SolveInside:=',false,'Color:=',p.Results.Color,'Transparency:=',p.Results.Transparency,... 'PartCoordinateSystem:=','global'}); end
Code:%HFSSMove(editor,name,vector) %Arguments: % editor: HFSS Editor COM object % name: Name of object to be moved % vector: [x,y,z] movement vector. function HFSSMove(editor,name,vector) error(nargchk(3,3,nargin,'struct')); mm = @(x)sprintf('%0.4fmm',x); editor.Move({'NAME:Selections','Selections:=',name},{'NAME:TranslateParameters',... 'TranslateVectorX:=',mm(vector(1)),'TranslateVectorY:=',mm(vector(2)),... 'TranslateVectorZ:=',mm(vector(3))}); end
3 members found this post helpful.

28th June 2010, 21:26 #30
 Join Date
 Apr 2010
 Posts
 132
 Helped
 89 / 89
 Points
 2,452
 Level
 11
Re: MATLABHFSSv11
There is no easy way of optimizing antenna structure using your own generic algorithm in Matlab.I have successfully modelled and simulated my antenna structure in HFSS.Now i just want to Export this structure to Matlab so i can optimize it using some generic algorithm e.g PSO algorithm. There is no way or File format in which we can export the structure to matlab from HFSS.Is it a must to use VBS scripting language for this purpose and there is no other way???

21st July 2010, 09:21 #31
 Join Date
 Jul 2010
 Posts
 1
 Helped
 0 / 0
 Points
 427
 Level
 4
Re: MATLABHFSSv11
Do you know any method that can save HFSS result by Matlab?
I executed Eigenmode calculation in HFSS controlled by Matlab code as follows.
Code:oAnsoftApp=actxserver('AnsoftHfss.HfssScriptInterface.12'); oDesktop=oAnsoftApp.GetAppDesktop; oProject=oDesktop.NewProject; oDesign=oProject.InsertDesign('HFSS', 'HFSSDesign1','DrivenModal', ''); oEditor=oDesign.SetActiveEditor('3D Modeler'); ........... oDesign.Analyze('Setup1');
I made codes as follows but error message appears.
Code:oSolutions=oDesign.GetModule('Solutions'); invoke(oSolutions,'ExportEigenmodes','Setup1', '', 'C:\Documents and Settings\sh\My Documents\Ansoft\eig1.eig')

23rd July 2010, 16:20 #32
 Join Date
 May 2010
 Location
 USA
 Posts
 2
 Helped
 3 / 3
 Points
 481
 Level
 4
Re: MATLABHFSSv11
Originally Posted by H.K.
Most of the data export to file commands can be found in the script recorder and translated to Matlab. I haven't used this function, however, so I would need to have a better idea of the error message to be of any more assistance.
Another resource is to look in the HFSS scripting help documentation for the function you are working with. Their example code for this function:
Code:Set oModule = oDesign.GetModule("Solutions") oModule.ExportEigenmodes "Setup1 : LastAdaptive", "", _ "C:\mydir\myeigenmode" & _ ".eig"

26th August 2010, 19:13 #33
 Join Date
 Dec 2009
 Posts
 41
 Helped
 1 / 1
 Points
 774
 Level
 6

2nd September 2010, 10:20 #34
 Join Date
 Feb 2007
 Location
 WhiteHouse
 Posts
 183
 Helped
 15 / 15
 Points
 3,033
 Level
 12
Re: MATLABHFSSv11
Hello; has someone a book about this prob? thanks.

Advertisement

12th October 2010, 13:20 #35
 Join Date
 Oct 2010
 Posts
 2
 Helped
 0 / 0
 Points
 397
 Level
 4

21st April 2011, 07:15 #36
 Join Date
 Jan 2011
 Posts
 6
 Helped
 0 / 0
 Points
 364
 Level
 4
Re: hfss å’Œ matlab
hii..
im new to hfss.rght now im learing how to write the files i mean only some files are there relted to matlab hfss api.so i need the steps how to run it.
i know the commands but im not understanding to generate it.
can u please help me

1st February 2012, 07:50 #37
 Join Date
 Apr 2010
 Location
 Pakistan
 Posts
 26
 Helped
 0 / 0
 Points
 1,626
 Level
 9
Re: hfss å’Œ matlab
samyuk!
I am also having the same problem. Have you found the solution? Or can anyone tell us how to do it?
 Post added at 07:50  Previous post was at 07:29 
I am having this error, when I run code in MATLAB
First it says
The Initial Dipole Length is 1.00 meter ...
Running iteration #1 ...
Creating the Script File ...
then it says
??? Error using ==> fprintf
Invalid file identifier. Use fopen to generate a valid file identifier.
Error in ==> hfssNewProject at 36
fprintf(fid, 'Dim oHfssApp\n');
Error in ==> example_antenna at 61
hfssNewProject(fid);
+ Post New Thread
Please login