⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hfssrectangle.m

📁 用matlab调用HFSS代码hfssapi.rar
💻 M
字号:
% ----------------------------------------------------------------------------% function hfssRectangle(fid, Name, Axis, Start, Width, Height, Units)% % Description :% -------------% Create the VB Script necessary to construct a rectangle using the HFSS% 3D Modeler.%% Parameters :% ------------% fid     - file identifier of the HFSS script file.% Name    - name of the rectangle object (appears in the HFSS objects tree).% Axis    - axis that is normal to the rectangle object.% Start   - starting location of the rectangle (one of its corners). Specify%           as [sx, sy, sz].% Width   - (scalar) the width of the rectangle. If the axis is 'X' then this %           represents the Y-axis size of the rectangle, and so on.% Height  - (scalar) the height of the rectangle. If the axis is 'X', then %           this represents the Z-axis size of the rectangle, and so on. % Units   - specify as 'in', 'meter', 'mm', ... or anything else defined in %           HFSS.%% Note :% ------% Todo: a feature to add automatic holes in the rectangle object.%% Example :% ---------% fid = fopen('myantenna.vbs', 'wt');% ... % % in this example, Y-axis size is 10in and Z-axis size is 20in.% hfssRectangle(fid, 'Rect1', 'X', [0,0,0], 10, 20, 'in');%% ----------------------------------------------------------------------------% ----------------------------------------------------------------------------% This file is part of HFSS-MATLAB-API.%% HFSS-MATLAB-API is free software; you can redistribute it and/or modify it % under the terms of the GNU General Public License as published by the Free % Software Foundation; either version 2 of the License, or (at your option) % any later version.%% HFSS-MATLAB-API is distributed in the hope that it will be useful, but % WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY % or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License % for more details.%% You should have received a copy of the GNU General Public License along with% Foobar; if not, write to the Free Software Foundation, Inc., 59 Temple % Place, Suite 330, Boston, MA  02111-1307  USA%% Copyright 2004, Vijay Ramasami (rvc@ku.edu)% ----------------------------------------------------------------------------% Width and Height follow the right-hand rule. If the Axis is Z, then Width% represents X-direction size and Height represents the Y-direction size % and so on ...function hfssRectangle(fid, Name, Axis, Start, Width, Height, Units)Transparency = 0.5;% Preamble.fprintf(fid, '\n');fprintf(fid, 'oEditor.CreateRectangle _\n');% Rectangle Parameters.fprintf(fid, 'Array("NAME:RectangleParameters", _\n');fprintf(fid, '"IsCovered:=", true, _\n');fprintf(fid, '"XStart:=", "%f%s", _\n', Start(1), Units);fprintf(fid, '"YStart:=", "%f%s", _\n', Start(2), Units);fprintf(fid, '"ZStart:=", "%f%s", _\n', Start(3), Units);fprintf(fid, '"Width:=", "%f%s", _\n', Width, Units);fprintf(fid, '"Height:=", "%f%s", _\n', Height, Units);fprintf(fid, '"WhichAxis:=", "%s"), _\n', upper(Axis));% Rectangle Attributes.fprintf(fid, 'Array("NAME:Attributes", _\n');fprintf(fid, '"Name:=", "%s", _\n', Name);fprintf(fid, '"Flags:=", "", _\n');fprintf(fid, '"Color:=", "(132 132 193)", _\n');fprintf(fid, '"Transparency:=", %d, _\n', Transparency);fprintf(fid, '"PartCoordinateSystem:=", "Global", _\n');fprintf(fid, '"MaterialName:=", "vacuum", _\n');fprintf(fid, '"SolveInside:=", true)\n');

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -