%--------------------------------------------------------------------------
% function CstAutoMesh(fid)
%
% Pouziti funkce:
% --------------
% Funkce slouzi k automaticke diskretizaci(mesh).
%
% Parametry funkce:
% ----------------
% fid - file identifier of the HFSS script file.
%
% Priklad pouziti:
% ----------------
% fid = fopen('antenna.m', 'wt');
% ... 
% CstAutoMesh(fid);
%--------------------------------------------------------------------------

function CstAutoMesh(fid)
global mws;

%Nastaveni automatickeho mesh
    fprintf(fid, '%% Nastaveni automatickeho mesh\n');
    fprintf(fid, 'mesh = mws.invoke(''Mesh'');\n');
    fprintf(fid, 'mesh.invoke(''Automesh'',''True'');\n');
    
%Prime vykonani v programu CST
    mesh = mws.invoke('Mesh');
    mesh.invoke('Automesh','True');
end