clear all; close all; clc;
%--------------------------------------------------------------------------
%Sestaveni spojeni se serverem AnsoftHFSSScriptIntrface
%Otevreni okna a nacteni noveho dokumentu
%--------------------------------------------------------------------------
App = actxserver('AnsoftHfss.HfssScriptInterface');
Desktop = App.GetAppDesktop();
Desktop.RestoreWindow;
Desktop.NewProject;

Project = Desktop.GetActiveProject;
invoke(Project,'InsertDesign','HFSS','HfssModel','_','');
Design = Project.invoke('SetActiveDesign','HfssModel');
Editor = Design.invoke('SetActiveEditor','3D Modeler');
Module = Design.invoke('GetModule','BoundarySetup');
%--------------------------------------------------------------------------
%Kresleni Objektu
%--------------------------------------------------------------------------
center=[0 0 0];
Height = 0.425000;
Radius = 0.020000;
invoke(Editor,'CreateCylinder',...
    {'NAME:CylinderParameters',...
    'XCenter:=',[num2str(center(1)),'meter'],...
    'YCenter:=',[num2str(center(2)),'meter'],...
    'ZCenter:=',[num2str(center(3)),'meter'],...
    'Radius:=',[num2str(Radius),'meter'],...
    'Height:=',[num2str(Height),'meter'],...
    'WhichAxis:=','X'},...
    {'NAME:Attributes',...
    'Name:=','Dipole1',...
    'Flags:=', '',...
    'Color:=','(132 132 193)',...
    'Transparency:=', 0,...
    'PartCoordinateSystem:=','Global',...
    'MaterialName:=','vacuum',...
    'SolveInside:=', true})


%zavrit aplikaci Ansoft HFSS
%--------------------------------------------------------------------------
%Desktop.QuitApplication;
