nsoft - u.dianyuan.com
Post on 11-Dec-2021
9 Views
Preview:
TRANSCRIPT
2dmacro.bk : title.fm i Fri Mar 29 13:58:14 2002
NSOFTNSOFT
Maxwell® 2D Field Simulator
Introduction to the AnsoftMacro Language
February 2002
2dmacro.bk : notice.fm ii Fri Mar 29 13:58:14 2002
ii
NoticeThe information contained in this document is subject to change withoutnotice.Ansoft makes no warranty of any kind with regard to this material, including,but not limited to, the implied warranties of merchantability and fitness for aparticular purpose. Ansoft shall not be liable for errors contained herein or forincidental or consequential damages in connection with the furnishing,performance, or use of this material.This document contains proprietary information which is protected bycopyright. All rights are reserved.Ansoft CorporationFour Station SquareSuite 200Pittsburgh, PA 15219(412) 261 - 3200
Motif is a trademark of the Open Software Foundation, Inc.UNIX is a registered trademark of UNIX Systems Laboratories, Inc.Windows is a trademark of Microsoft® Corporation.OpenWindows is a trademark of Sun Microsystems, Inc.
© Copyright 2002 Ansoft Corporation
2dmacro.bk : front.fm iii Fri Mar 29 13:58:14 2002
Printing HistoryNew editions of this manual will incorporate all material updated since theprevious edition. The manual printing date, which indicates the manual’scurrent edition, changes when a new edition is printed. Minor corrections andupdates that are incorporated at reprint do not cause the date to change.Update packages may be issued between editions and contain additionaland/or replacement pages to be merged into the manual by the user. Notethat pages which are rearranged due to changes on a previous page are notconsidered to be revised.
Welcome!This manual is a user’s reference for using the Ansoft Macro Language inMaxwell 2D.
Installation GuideBefore you use Maxwell 2D, you must:1. Set up your system’s graphical windowing system.2. Install the Maxwell software, using the directions in the installation
guide.
If you have not yet done these steps, refer to the installation guides and thedocumentation that came with your computer system, or ask your systemadministrator for help.
Other ReferencesFor detailed information on the Maxwell 2D commands, refer to the onlinehelp provided with Maxwell 2D.For detailed information on the Control Panel commands, refer to the onlinehelp for the Maxwell Control Panel.
Edition Date Software Revision
1 February 2002 9.0
iii
2dmacro.bk : front.fm iv Fri Mar 29 13:58:14 2002
iv
2dmacro.bk : 2dmacroTOC.doc 1 Fri Mar 29 13:58:14 2002
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Recording a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2Executing a Post Processing Macro . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4Command Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4Entering a Script Command from the Command Prompt . . . . . . . 1-5Script Command Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6
Syntax Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-6Script Control Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7
Command Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7IF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7REPEAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7WHILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8
Mathematical Conditions and Expressions . . . . . . . . . . . . . . . . . . . . 1-9Conditionals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9
AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9OR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10XOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10Macro Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11
Defining Macros in the Macro Editor . . . . . . . . . . . . . . . . . . . . . . . . . 1-11Tool Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12Macro Editor Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12
Contents-1
2dmacro.bk : 2dmacroTOC.doc 2 Fri Mar 29 13:58:14 2002
2. Default Command Set . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1Default Module Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2AND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2Assign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2ClearFunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3ClearVars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3ComplexFormat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3DatabaseAddRow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4DatabaseGetColumns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4DatabaseGetRows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5DatabaseSetField . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5Div . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6DoubleListSetComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6DumpDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6Echo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7EvaluateExpression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7ExportDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8FileClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8FileExec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-8FileExecPause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9FileExists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9FileOpen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-9FileRecord . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12FileRecordAppend . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12FileRecStop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-12FuncDef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13FuncHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13FuncUndef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14GE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14GetDateAndTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14GetFileList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-14GetMacroPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15GetMacroPathList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15GetProductId . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15GetUserOption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15GetVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-15GlobalAssign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16GT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16ImportDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16
Contents-2
2dmacro.bk : 2dmacroTOC.doc 3 Fri Mar 29 13:58:14 2002
IsCommandEnabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17IsDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17LE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17Log10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-17Minus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18Mul . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18NE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18NewDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18ParametricFileExec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19Pos3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20Pos3Dist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20PrependMacroPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20PrintHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20PrivateAssign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-20RandomFraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21RemoveMacroPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21SetEchoEnabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21SetMacroPathList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21SetRecordingEnabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-21Sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22StrConcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22StringListSetComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23Strlen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23Strstr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23Sub . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-23Unassign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24Vec2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24Vec3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24XOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
3. Generic Script Commands . . . . . . . . . . . . . . . . . . . . . . 3-1Generic Module Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
CascadeAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2CascadeProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2CascadeViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2CloseWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2ModuleIsPromptVisible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2ModuleSidewinLeft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2ModuleSidewinRight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2ModuleTogglePrompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3ModuleToolbar(direction) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3ModuleToolbarHide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3NewWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3PrintEntire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
Contents-3
2dmacro.bk : 2dmacroTOC.doc 4 Fri Mar 29 13:58:14 2002
PrintProj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3PrintRect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3PrintView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4TileAllGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4TileProjectsGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4TileViewsGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4TileViewsHrz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4TileViewsVrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4
mod3proj Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5AbortTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5ActivateView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5CheckOverlap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5DeleteCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5DeSelect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-5DispWire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6EditOrientations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6GetCurPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6GetDouble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6GetNumObjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7GetNumViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7GetObjectName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7GetOrigin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7GetString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8GetUnitConv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8GetUnitName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-8GlobalCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9Hide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9HideOrient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9HideRegion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9HideSel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9LocalCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10Lorigin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10ObjectCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10ObjectExists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10Origin? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11PrintProj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11PrintView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11Recolor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11RestoreCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11RotatedCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12SaveCmdWin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12SaveCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12Select . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13SelInBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13
Contents-4
2dmacro.bk : 2dmacroTOC.doc 5 Fri Mar 29 13:58:14 2002
SetObjectCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14Show . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14ShowAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14ShowOrient . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14ShowRegion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14UnrotatedCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15VerifyRegion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15VisByItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15XAxisAboutTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15XAxisTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15YAxisAboutTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16YAxisTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16YUnitVec? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16ZAxisAboutTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16ZAxisTo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16ZUnitVec? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16
mod3view Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17AutoGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17FitAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17FitAllViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17FitSel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17Lookat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17Ortho . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17PolarGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18RectGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18ResetViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18RotView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18Viewpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19WireFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-19
4. Post Processor Script Commands . . . . . . . . . . . . . . . 4-1Post Processor Command Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2
PostProcessor Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2ArrowPlotOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2CalcVisToggle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2CascadeAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2CascadeProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2CascadeViews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2CHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2CloseWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3DeleteGeometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3DeletePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3DisablePlineStitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3EditFunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3
Contents-5
2dmacro.bk : 2dmacroTOC.doc 6 Fri Mar 29 13:58:14 2002
EditPline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3EditPline - AddVert3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4EditPline - Arc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4EditPline - CancelPline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4EditPline - Closepline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4EditPline - DelEdge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4EditPline - EdgeGeom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5EditPline - EdgeMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5EditPline - EndPline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5EditPline - EndTangent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5EditPline - GetPlineVert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6EditPline - Insvert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6EditPline - JoinSplines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6EditPline - MoveArcMidPt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6EditPline - OpenPline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7EditPline - RenameCurPline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7EditPline - SetArcAngle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7EditPline - SetArcRadius . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7EditPline - SetArcToFillet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7EditPline - StartTangent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8EnablePlineStitch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8Exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8FormatPlotAxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8FormatPlotGraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8LinePlotOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9ListPlotsProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9ListPlotsView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9MarkerPlotOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10ModifyPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10NewWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11OpenProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11PanelPlotDelete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11PanelPlotVisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11PostProcessorOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11SaveDefinitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-11ShowPlotCoordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12ShowSolutionInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12TileAllGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12TileProjectsGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12TileViewsGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12TogglePlotVisibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12
Plot Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13Graph3dSetColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13Graph3dSetFilled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13
Contents-6
2dmacro.bk : 2dmacroTOC.doc 7 Fri Mar 29 13:58:14 2002
Graph3dSetLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13Graph3dSetOutline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13Graph3dSetRefinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13Graph3DSetToneShaded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14Graph3dUpdateGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14Plot3dDrawAxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14Plot3dDrawGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14Plot3dSetAxesLabelSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14Plot3dSetHeadExtrusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15Plot3dSetHeading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15Plot3dSetHeadingColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15Plot3dSetHeadingFont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15Plot3dSetHeadingSize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-15Plot3dSetScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16Plot3dShowColorKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16Plot3dUpdatePlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
FieldCalculator Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17* (Multiply) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17+ (Add) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17– (Subtract) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17/ (Divide) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-171/ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17Abs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17AddFaceAtPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17AddObjectToList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18AnimationAddFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18AnimationDeleteFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18AnimationPlay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19AnimationPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19AnimationSaveFrames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19AnimationSetDeltaVal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20AnimationSetPlayTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20AnimationSetRefinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20AnimationSetStopVal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21AnimationSetStoreFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21AnimationSetVarName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21AnimationShowFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21AppendSolutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21AtPhase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22BHPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22BuildPlotInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22Clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22CmplxMag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23CmplxR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23
Contents-7
2dmacro.bk : 2dmacroTOC.doc 8 Fri Mar 29 13:58:14 2002
Conj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23CreateAnimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23CreateBHPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23CreatePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23Curl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24D/Dx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24D/Dy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24D/Dz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24DefineCutPlane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24DefineFacesList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24DefineObjectList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25DefinePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25DeleteLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25DeletePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25DeletePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25DeleteSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25DeltaModifyPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26Divg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26Domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26Dot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26Draw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26DrawSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27DrawVolume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27Enter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27EnterComplex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27EnterComplexVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27EnterLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28EnterPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28EnterScalar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28EnterScalarFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28EnterSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28EnterVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28EnterVolume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29Evaluate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29ExportAnimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29ExportToVolumeGrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30FunctionValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30GetTopEntryValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30Grad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30Imag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30IsoSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31LineCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31LineModify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31
Contents-8
2dmacro.bk : 2dmacroTOC.doc 9 Fri Mar 29 13:58:14 2002
LinePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31Ln . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33Load2DPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33LoadPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33LockCutPlaneNormal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33LockCutPlaneOrigin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33LockVolume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33Mag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34Material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34MathFunc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34MaxPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35Minimum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35MinPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35ModelMax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35ModelMin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35ModifyPoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36Neg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36Normal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36NormalComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36ObjectListCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36ObjectListModify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37PlotMesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37PlotModifyFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37PointCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37PointModify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37Pop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38PostprocessorOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38Pow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38ProjDir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38ProjName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38Push . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-38Real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39RectBoxCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39RemoveFaceAtPos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39RemoveObjectFromList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-39RenameLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40RenamePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40RenamePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40RenameSurface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40RenameVolume . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40RollDn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40RollUp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-40
Contents-9
2dmacro.bk : 2dmacroTOC.doc 10 Fri Mar 29 13:58:14 2002
Save2DPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-41SavePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-41ScalarX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-41ScalarY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-41ScalarZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-41Scalar_PHI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-41Scalar_Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42SetArrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42SetColormap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-42SetGridSpacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-43SetHiddenLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-43SetMarker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-44SetMeshScale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45SetNumPoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45SetPlotAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45SetRefinement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-45SetTextMarker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46SetTransparency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46ShowColorKey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46Smooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46SolutionName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-46StoreComputations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-47SurfacePlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-47Tangent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-47TangentComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-47Top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-47Undo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-47Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48VecX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48VecY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48VecZ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48Vec_PHI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48Vec_R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48Vec_Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-48WriteSolutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-49
5. Wizard Script Commands . . . . . . . . . . . . . . . . . . . . . . . 5-1Wizard Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2
Information Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3User Menu Additions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5
AddHelpSelboxItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5AddMenuItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5DebugFileExec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6
Contents-10
2dmacro.bk : 2dmacroTOC.doc 11 Fri Mar 29 13:58:14 2002
DeleteHelpSelboxItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6DeleteMenuItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6MacroDebugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7SetMenuItemHotkey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7
Wizard Script Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8AddWizardButtons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8AddWizardHelp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9AddWizardSelboxItems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10AddWizardText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10CreateWizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11DeleteWizardValidatorExpr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11ExecWizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12GetWizardRunResult . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12GetWizardSelboxIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12GetWizardSelboxText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-12RunWizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-13SetWizardControlText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-14SetWizardFieldDefault . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15SetWizardFieldPrompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15SetWizardSelboxIndex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16SetWizardTitle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16StopWizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16
Contents-11
2dmacro.bk : 2dmacroTOC.doc 12 Fri Mar 29 13:58:14 2002
Contents-12
2dmacro.bk : intro.fm 1 Fri Mar 29 13:58:14 2002
1
Introduction
Macros are fast, effective ways to accomplish tasks you wish to repeat. Amacro is built from Ansoft-specific script commands, much like the scriptingcapabilities of UNIX workstations. When you execute a macro from Maxwell2D’s Post Processor, the software executes the script commands. With macrosyou can:● Quickly perform repetitive actions.● Create and solve projects whose properties vary; such as the
dimensions of the model or the values of boundaries and sources.Macros can be designed to prompt you for the necessary informationwhen they need it.
● Export values and results to a database file.
☞Note: Macros are only available in the Maxwell 2D Field Simulator Post Proces-
sor. No other modules in Maxwell 2D have macro capability.
Introduction 1-1
2dmacro.bk : intro.fm 2 Fri Mar 29 13:58:14 2002
Macros
MacrosMacros are built from both script commands and script control commands. Inmost cases, the starting point for building a macro is using the interface torecord the initial commands. Once you have recorded the script commands tothe macro, you can edit the macro with any text editor.The macro language in Maxwell 2D can be, like most programminglanguages, complex and requires strict adherence to syntax. If you haveprogramming experience, editing a macro and the idiosyncrasies of the macrolanguage will be similar to other programming languages. If the Maxwell 2Dmacro language represents your first experience with programming, ahandbook for beginning programmers may be useful in understanding theintricacies of programming in the macro language.
Recording a MacroAfter you have started to record the macro, your subsequent actions arewritten to the macro. Each interface command has one or more associatedscript commands that are recorded to the macro.
➤ To create a macro:1. Choose View/Command Prompt. The command prompt window
appears below the project window.
2. At the command prompt, enter FileRecord “Filename.mac”, whereFilename.mac is the name of the macro you wish to create. From thispoint forward, every step will be recorded into the macro.
3. Step through the part of the project you wish to record. You can dothis with the mouse or by entering the commands into the commandprompt.
4. When you have finished creating the macro, enter FileRecStop. Themacro is now finished, and the steps have been saved to the text fileFilename.mac.
☞Note: You may also use the hotkey Ctrl+F4 to access the command prompt in the
2D Post Processor.
1-2 Introduction
2dmacro.bk : intro.fm 3 Fri Mar 29 13:58:14 2002
Macros
Executing a Post Processing MacroYou can execute the post processing macro in any project.
➤ To execute a macro from the Maxwell 2D Post Processor, do one of thefollowing:● Choose File/Macro/Execute from the post processor menu bar, and
select the file to execute.● To execute a macro from the command line, do one of the following:
■ If you want to execute the macro and remain in the Maxwell 2DPost Processor, enter the following from the project directorycontaining the macro:post2d -macexec macro_name project.pjt
The post processor starts and immediately executes the macro.Once the macro has finished, the post processor remains open,allowing you to perform other tasks.
■ If you want to execute the macro and exit the software after it isfinished, enter the following from the project directorycontaining the macro:post2d -macandexit macro_name project.pjt
The Maxwell 2D Post Processor starts and immediately executesthe macro. Once the macro has finished, the software exits.
● To execute a macro using a hotkey:a. Press Ctrl+F3. The following window appears:
b. Enter the name of the macro to execute in the File Name field.c. Choose OK.
● To execute a macro using the command prompt:a. Choose View/Command Prompt from the menu bar. The
command prompt window appears below the project window.b. At the command prompt, enter FileExec Filename.mac where
Filename.mac is the name of the macro you wish to execute.
Introduction 1-3
2dmacro.bk : intro.fm 4 Fri Mar 29 13:58:14 2002
Script Commands
Script CommandsScript commands are the basic components of macros. You can enter thesecommands at the command prompt window or record them in a macro.
Command SetsScript commands are organized into command sets. A command set is simplya grouping of related script commands. Different command sets are useddepending on the Maxwell 2D module currently in use. The followingcommand sets are available in Maxwell 2D:
Default The Default command set is unlike the others in that itsscript commands are the basis for the macro language. Noscript commands from the Default command set can berecorded using the interface. This command set is availablein every module.
Generic Module The Generic Module command set contains generic scriptcommands. This set is available in every module.
Mod3proj The Mod3proj command set contains script commandsthat manipulate Maxwell 2D projects. Some of the scriptcommands from this command set, like the Default com-mand set, can not be recorded to a macro. This commandset is available in every module with a model display win-dow.
Mod3view The Mod3view command set contains script commandsthat manipulate the view of the projects. This command setis available in every module with a model display win-dow.
PostProcessor The PostProcessor command set contains script commandsspecific to the 2D Post Processor.
Plot The Plot command set contains script commands specificthe 2D Post Processor plotting functions.
FieldCalculator The FieldCalculator command set contains script com-mands specific 2D Post Processor Field Calculator.
1-4 Introduction
2dmacro.bk : intro.fm 5 Fri Mar 29 13:58:14 2002
Script Commands
Entering a Script Command from the Command PromptTo enter individual script commands, rather than from a macro, use thecommand prompt available in the current module.
➤ To enter a script command:1. Choose View/Command Prompt. The command prompt window
appears at the bottom of the window.2. Enter the script command at the command prompt. For example, you
could enter:unassign “temp”
You may enter more than one script command with any associatedarguments at the prompt.
3. Choose Enter. The macro command unassigns the function valuenamed temp in the Maxwell 2D Post Processor.
➤ To see a list of script commands:● Enter help commands at the command prompt for a list of all available
commands.● Enter help command_name for an explanation of a specific command.
Introduction 1-5
2dmacro.bk : intro.fm 6 Fri Mar 29 13:58:14 2002
Script Commands
Script Command LayoutThe majority of this guide deals with individual script commands. Thefollowing layout is used in describing them:
Syntax Conventions
Script commands are case-insensitive and are often followed with case-sensitive arguments that further define their functions. These arguments fallinto one of the following eight categories:
LONG An integer. Integer numbers require no brackets when thesevalues are entered in a script command.
DOUBLE A double precision floating point number. No quotes arerequired for these values.
“string” A string is a character sequence that must be enclosed in quo-tation marks. File names, object names, and expressions arealways entered with quotation marks.You may use either sin-gle- or double-paired quotes when defining strings.
<vectors> Vectors must be entered in carat brackets. The components inthe brackets must be separated with commas.
[positions] Positions must be entered in square brackets. The compo-nents in the brackets must be separated with commas.
{“string list”} Braces are used to enclose a series of strings or doubles in thescript commands. A string list will resemble {“String1”“String2” “String3”}. No commas separate the strings.
☞Note: If a script command will not easily fit on a line, you may continue to the
next line by means of a backslash character at the end of a line to be contin-ued.
The name of the script command
Use: Describes the function of the script command.Command: Lists the associated interface commands. If there are no
interface commands associated with it, “none” will be listed.Syntax: Demonstrates the proper syntax for the command.
The type of syntax used for the switches oroptions indicates what type of informationneeds to be entered for that option.
Note: Explains any switches or options used in the syntax.Example: Provides a working example of the script command.
The results of the example are explained here.
1-6 Introduction
2dmacro.bk : intro.fm 7 Fri Mar 29 13:58:14 2002
Script Control Commands
Script Control CommandsThe Maxwell 2D Post Processor also provides enhanced script controlcommands that are not generated when using the interface in FileRecordmode. These commands control the macro execution by letting you setvariable values, test variable and expression values, conditionally executeportions of the macro, and use loop control within your macro.
Command ConstructsThree constructs are available in the Maxwell 2D Post Processor: IF, REPEAT,and WHILE.
IF
IF is used to create a conditional argument. If a condition is true, the contentsof the IF statement are executed. Otherwise, the IF statement is skipped. Youcan create two types of IF statements. The first type uses conditionals andexecutes only if the condition is true. For example:
Assign test 5
IF EQ test2 test
Assign test2 6
END
This IF statement executes as long as the value of the variable test is equal tothe value of the variable test2.The second type does not use conditionals; instead, it depends on theexistence of something. For example:
IF test
Assign test2 6
END
This IF statement executes as long as a variable named test exists and has anon-zero value. Unlike the REPEAT and WHILE statements, an IF statementis only executed once before continuing with the macro.
REPEAT
REPEAT is used to execute the contents of the REPEAT loop the number oftimes specified. For example:
REPEAT 4
echo “This is a test”
End
This repeats This is a test four times. You may also use variables or commandsthat return integers, such as GetNumObjects, to specify the number of times torepeat the loop.
Introduction 1-7
2dmacro.bk : intro.fm 8 Fri Mar 29 13:58:14 2002
Script Control Commands
WHILE
WHILE is used to create a concurrent action. While a condition is true, thecontents of the WHILE loop keep executing. If the condition changes in themiddle of the block, the full block will execute.
Like an IF statement, you can create two types of WHILE statements. The firsttype uses conditionals and executes only while the condition is true. Forexample:
ASSIGN count 5
WHILE EQ count 5
ASSIGN count SUB count 1
ECHO “count is “ count
END
This only executes while the value of the variable count is equal to 5. Whenexecuted, the command displays count is 5.The second type does not use conditionals; instead, it executes while thevariable values remains non-zero. For example:
ASSIGN count 5
WHILE count
ASSIGN count SUB count 1
ECHO “count is “ count
END
Executing these commands will display Count is 4, Count is 3, and so forthuntil the decreasing value reaches zero. It stops at zero because the WHILEcondition becomes false. You could also have used a negative number andincreased the value until it reached zero.
➥Warning: Because a WHILE statement can create an infinite loop, make certain the
means of ending the WHILE statement are present in the statement itself.Otherwise the WHILE statement will continue to execute without stop-ping. If you accidentally create an infinite loop condition, use the Esc keyto break out of the loop.
1-8 Introduction
2dmacro.bk : intro.fm 9 Fri Mar 29 13:58:14 2002
Script Control Commands
Mathematical Conditions and ExpressionsThe following conditions and expressions can be used in macro language.
Conditionals
IF and WHILE statements frequently use conditional arguments as part oftheir syntax. The following conditionals are also available:
The proper syntax for conditionals is:EQ Y 5
which means Y = 5.In addition to the mathematical conditions, there are three booleanconditionals you may use: AND, OR, and XOR.
AND
AND is used to evaluate the values of two variables or conditions. If neithervalue is equal to zero, a value of one is returned to the macro. If one or both ofthe values is equal to zero, zero is returned to the macro. For example:
Assign temp1 (AND variable1 variable2)
If EQ temp1 1
Assign width 4
End
In this example, a width of 4 is assigned to temp1 when variable1 is equal to 1and either variable1 or variable2 are non-zero. The temp1 variable may thenbe used in other constructions, such as the IF statement, used in this example.
Conditional Function
EQ Equal to
NE Not equal to
GT Greater than
LT Less than
GE Greater than or equal to
LE Less than or equal to
☞Note: If the arguments are numeric, numeric comparisons are executed. If the
arguments are strings, case-sensitive string comparisons are used.
Introduction 1-9
2dmacro.bk : intro.fm 10 Fri Mar 29 13:58:14 2002
Script Control Commands
OR
Like AND, OR also examines the values of two variables or conditions. Ifeither value is non-zero, a value of one is returned to the macro, regardless ofthe value of the other variable or condition. If both values are equal to zero, avalue of zero is returned to the macro.XOR
For the XOR command, if one of the values is equal to zero while the other isnon-zero, a value of one is returned to the macro. If both values are equal tozero or both are non-zero, a value of zero is returned to the macro.
Expressions
Often you will need to mathematically manipulate variables in your macro.Maxwell 2D provides the following mathematical expressions:
The proper syntax for these expressions is:add varname 1
which means varname + 1.You may also group arguments together using parentheses, for example:
add varname (mul 0.5 X)
which means varname + 0.5X. The parentheses are only returned if theexpression would be ambiguous without them.
Expression Function
add Adds two arguments together.
sub Subtracts two arguments (subtracts the secondargument from the first.)
mul Multiplies two arguments.
div Divides the first argument by the second.
minus Reverses the sign of an argument.
☞Note: The arithmetic operations are done with floating point logic.
1-10 Introduction
2dmacro.bk : intro.fm 11 Fri Mar 29 13:58:14 2002
Macro Editor
Macro EditorThe Ansoft Macro Editor allows you to create and edit macros. This modulealso places command parameters in the correct syntax.When you choose File/Macro/Edit Macro from the File menu, the followingwindow appears:
Defining Macros in the Macro Editor➤ To create or edit a macro:
1. Choose File/Macro/Edit Macro to access the Macro Editor.2. Choose File/New or File/Open to create or edit a macro file. Macro files
have a .mac file extension.When you create a new file, the Macro Editor automatically entersparameter assignment mode and displays the Create New Macro File win-dow. This is the window in which the macro is written. You can alsoenter this mode using View/Assign Parameter Mode, which allows you toreview macros and define any parameters.
3. Do any of the following:■ Choose Edit/All Parameters to specify the parameters of the macro.■ Choose View/Edit Mode to enter edit mode and enter new text for the
macro file.■ Place the cursor on the macro statement for which to specify the
parameters and choose Edit/Command Parameters to specify theparameters for the selected item. If you select a line with a statement
Introduction 1-11
2dmacro.bk : intro.fm 12 Fri Mar 29 13:58:14 2002
Macro Editor
that has no parameterized values, this command does nothing.■ Choose Edit/Add Database Export Macro/Add to generate macro code
that creates a database and writes it to a disk file.4. Choose File/Save to save the macroThe macro is now defined.
Tool BarUse the tool bar in the Macro Editor as a shortcut to executing commands:
● To execute a command, click on the appropriate button.● To display a brief description of the command in the message bar,
move the cursor to the toolbar icon and hold down the mouse button.
Macro Editor CommandsYou can access the following menus from the Macro Editor:
Refer to the online documentation for more information on these commands.
☞Note: If a tool bar icon appears to do nothing when you click on it, the command
may not be available at the time.
File Creates, opens, saves, and closes macros.
Edit Edits and defines command parameters, and adds database exportmacros.
Search Finds and replaces expressions used in the macros.
View Defines the viewing modes, allowing you to assign parameters oredit the macro file. Also displays the parameters of the macro.
Help Accesses the online documentation for the product.
1-12 Introduction
2dmacro.bk : defaulcs.fm 1 Fri Mar 29 13:58:14 2002
2
Default Command Set
This chapter describes the programming script commands, the Defaultcommand set. These commands are available in every module.
Default Command Set 2-1
2dmacro.bk : defaulcs.fm 2 Fri Mar 29 13:58:14 2002
Default Module Script Commands
Default Module Script CommandsThe following commands are listed under the Default command set.
Add
Use: Adds two values together and echoes them on the screen. If applied tostrings, this command performs a string concatenation. If applied to Pos2,Pos3, Vec2, or Vec3, it combines the components by component addition.
Command: none
Syntax: add VALUE1 VALUE2
Note: The values can be entered as strings and are used in a macro to combinetwo values.
Example: add sheet1 sheet2
This example adds the existing values of sheet1 and sheet2 in themacro.
AND
Use: Returns a value of 1 if both arguments are non-zero. This can apply toeither strings or numerical values.
Command: none
Syntax: and VALUE1 VALUE2
The software returns a value of 1 if both VALUE1 and VALUE2 arenon-zero.
Assign
Use: Assigns a value to a variable. Use the Help script command to view anydefined variables.
Command: none
Syntax: assign variable value
Note: The value can be any data type, but it is saved in string form.Example: assign NAME Getstring “Enter a name for the object”
This example echoes the character string “Enter a name for theobject” and then awaits input from the keyboard. The entered text isassigned to the variable NAME.
☞Note: When using variable names with other script commands, do not put the
variable name in quotes as you would most string values.
2-2 Default Command Set
2dmacro.bk : defaulcs.fm 3 Fri Mar 29 13:58:14 2002
Default Module Script Commands
ClearAll
Use: Deletes all variables and functions defined in the command language.Command: none
syntax: clearall
ClearFunctions
Use: Deletes all functions defined in the command language.Command: none
syntax: clearfunctions
ClearVars
Use: Deletes all the variables defined in the command language.Command: none
syntax: clearvars
ComplexFormat
Use: Formats a complex number to magnitude-phase (radians or degrees) orreal-imaginary.
Command: none
Syntax: complexformat “input format” “output format”<xval,yval>
Note: “input format” and “output format” are described as:MPR is the magnitude-phase (radians).MPD is the magnitude-phase (degrees).RI is real-imaginary.
Example: complexformat “ri” “mpd” <1,1>
This example formats the complex number with real and imaginarycomponents of 1 to magnitude-phase (degrees).
Component
Use: Extracts a vector or position component or a member of a list from thegiven position.
Command: none
Syntax: component WHICH_COMPONENT “position/vector”
Note: which_component has values 1=x, 2=y, 3=z.Example: component 3 [5,10,15]
This example extracts the z-component, 15, from the specified point.component 2 {“oak” “maple” “beech” “sycamore”}
This example extracts the second component, maple, from a string list.
Default Command Set 2-3
2dmacro.bk : defaulcs.fm 4 Fri Mar 29 13:58:14 2002
Default Module Script Commands
ComponentCount
Use: Returns the number of components in a position, vector, or list.Command: none
Syntax: componentcount [position_vector_or_list]
Example: componentcount [5,10,15]
This example returns the value of 3.
DatabaseAddRow
Use: Adds a row to the specified database. This does not affect the databasefile stored on the hard disk. Use this after creating a new database filewith NewDatabase, or after importing a database file withImportDatabase.
Command: none
Syntax: databaseaddrow “dbase name”
DatabaseGetColumns
Use: Returns the number of columns in the specified database.Command: none
Syntax: databasegetcolumns “database name”
Example: newdatabase 6 “tmp”databasegetcolumns “tmp”
This example creates a new database with six columns. The examplethen returns the number of columns in the database (which should be6).
The two expressions in the example would normally be separated byintervening expressions, since it wouldn’t make sense to create thenumber of columns, then ask what that number is in the nextstatement.
☞Note: The first two items of the database file must be the number of rows fol-
lowed by the number of columns. For example, if a database file contains 16rows and 3 columns, the first line of the database file must be:
16 3
2-4 Default Command Set
2dmacro.bk : defaulcs.fm 5 Fri Mar 29 13:58:14 2002
Default Module Script Commands
DatabaseGetField
Use: Returns the value of the specified field from named database file. Rowand column numbering begins at zero.
Command: none
Syntax: databasegetfield “dbase name” ROW COLUMN
Example: newdatabase 6 “tmp”databasegetfield “tmp” 5 2
This creates a new database with 6 columns. It then returns the valuefrom the sixth row and third column of the database.
The two expressions in the example would normally be separated byintervening expressions, since it wouldn’t make sense to create anew, empty database, then ask what that the value of a field is in thenext statement.
DatabaseGetRows
Use: Returns the number of rows in the specified database.Command: none
Syntax: databasegetrows “dbase name”
Example: newdatabase 6 “tmp”databasegetrows “tmp”
This example creates a new database with 6 columns. The examplethen returns the number of rows in the database (which should be 0).
The two expressions in the example would normally be separated byintervening expressions, since it wouldn’t make sense to create anew, empty database, then ask how many rows it has in the nextstatement.
DatabaseSetField
Use: Replaces a value in a database with the value you specify. This exampleonly affects databases currently in memory. To save the database, use theExportDatabase command.
Command: none
Syntax: databasesetfield dbaseid ROW COLUMN “New value”
Note: Rows and columns start at 0, not at 1.Example: assign idnum newdatabase 6
...databasesetfield dbaseid 0 0 “force”
This example creates a new database with 6 columns, and assigns its IDnumber (provided by the software) to dbaseid. It then replaces the valuein the first row, first column of the database with the new value of force.
Default Command Set 2-5
2dmacro.bk : defaulcs.fm 6 Fri Mar 29 13:58:14 2002
Default Module Script Commands
DeleteDatabase
Use: Deletes the database currently stored in memory. This does not affect thedatabase file stored on your hard disk.
Command: none
Syntax: deletedatabase “dbase name”
Div
Use: Divides two defined values in a macro.Command: none
Syntax: div VALUE1 VALUE2
DoubleListSetComponent
Use: Returns a new list of double-precision floating-point numbers, using apreviously existing list, a specified value, and a position in the list. If thevalue of component is – 1, the value is appended to the new list. Addedcomponents may be literal values or variables which evaluate to literalvalues.
Command: none
Syntax: doublelistsetcomponent LIST VALUE COMPONENT
Note: LIST is a double list: {DOUBLE1 DOUBLE2...}
DumpDatabase
Use: Dumps the contents of a user database.Command: none
Syntax: dumpdatabase “dbase name” END_ROW START_COL END_COL
Example: dumpdatabase “tmp” 2 1 2
This example dumps the first two rows and columns of the databasenamed tmp.
Echo
Use: Echoes text or the results of script commands to the command promptwindow. Use the echo command to view the results calculated by otherscript commands. Otherwise they do not appear.
Command: none
Syntax: echo [“Text” or script_command_result]
Example: echo component 3 [5,10,15]
This example displays the results of the component command, 15, inthe command prompt window.
2-6 Default Command Set
2dmacro.bk : defaulcs.fm 7 Fri Mar 29 13:58:14 2002
Default Module Script Commands
EQ
Use: Allows you to determine if two entered values are equal. This can applyto strings or numerical values.
Command: none
Syntax: EQ VALUE1 VALUE2
The software will return a 1 if the arguments are equal.
Error
Use: Stops the execution with the error message you specify.Command: none
Syntax: error “Message”
Example: error “The length of the box has exceeded 20”
This example prints out the string, “The length of the box hasexceeded 20” to the command prompt window and stops the macroexecution.
EvaluateExpression
Use: Evaluates the defined expression. The default persistent setting is 0 (thus,the value is not persistent). If the value is persistent, and the expressiontakes the form “x=value”, x will be entered as a variable in the persistenttable and will be usable when evaluating subsequent persistentexpressions. A subsequent expression may then have the form “value+x”.
Command: none
Syntax: evaluateexpression “expression” persistent?(Y/N)
Note: Persistent values are either 0 (not persistent) or 1 (persistent).Example: evaluateexpression “x=5” 1
This takes the persistent value of x=5 and allows x to be treated as avariable in subsequent expressions.
Default Command Set 2-7
2dmacro.bk : defaulcs.fm 8 Fri Mar 29 13:58:14 2002
Default Module Script Commands
ExecPgmAndWait
Use: Launches a program with the given command line options and waitsuntil it exits. Note that this is a hidden command and does not appear inthe help commands list.
Command: none
Syntax: execpgmandwait “pgm_name” {pgm_args}
Note: pgm_args is a string list of arguments.Example: execpgmandwait ”h:\\ansoft2001\\m2dfs9\\post2d”
-mf_exec graphical “thermal1.pjt” -output initial-sttname mfs2 -product 9 -macandexit post.mac
This example launches mesh2d with the arguments to enable it togenerate a mesh graphically for the thermal1 project. Product 9 is theproduct ID for Maxwell 2D, and post.mac is the name of the macrofile to execute and exit after the process is complete.
ExportDatabase
Use: Saves the specified database to a disk file.Command: none
Syntax: exportdatabase “dbase name” “File name and location”“Overwrite?”
Note: overwrite is either “yes” or “no”Example: exportdatabase “tmp” “/mfs2/macros/wgdata.dat” “yes”
This example saves the database tmp currently stored in memory tothe wgdata.dat file in the /mfs2/macros/ directory. The system isinstructed to overwrite the old file.
FileClose
Use: Closes a file that was open for formatted reading.Command: none
Syntax: fileclose “filename”
FileExec
Use: Executes a macro or commands from a file.Command: none
Syntax: fileexec “filename”
2-8 Default Command Set
2dmacro.bk : defaulcs.fm 9 Fri Mar 29 13:58:14 2002
Default Module Script Commands
FileExecErrExitIf
Use: Verifies the preconditions in an executing macro file.Command: none
Syntax: fileexecerrexitif “condition command” “error message”
Note: condition command: any conditional statement such as if.Example: fileexecerrexitif “IF EQ test2 test” “The test values
are equal and will produce a linear curve.”
In this example, if the two test values are equal in this hypotheticalpost processing macro, the error message “The test values are equaland will produce a linear curve.” appears and ends the macro.
FileExecPause
Use: Displays an informational message during macro execution. You mustchoose OK from the message window to continue with the macro. Themessage can have multiple lines if you use “\n” as a newline character.
Command: none
Syntax: fileexecpause “text message”
Example: fileexecpause “First part of macro finished.\n Continuing.”
This example pauses, displays the “First part of macro finished”message, then waits for you to choose OK before continuing themacro execution.
FileExists
Use: Returns whether a given file exists in the current directory.Command: none
Syntax: fileexists “filename”
Example: fileexists “Iverify.mac”
This example determines and returns whether Iverify.mac exists.
FileOpen
Use: Opens a file for formatted reading. This command produces an error if itis executed directly from the command line, and works only from withinan executing macro file. If the file cannot be opened, an error condition isset. The file remains open until you explicitly close it or until theexecuting macro file terminates. This command may only be used forformatted reading from files.
Command: none
Syntax: fileopen “filename”
Default Command Set 2-9
2dmacro.bk : defaulcs.fm 10 Fri Mar 29 13:58:14 2002
Default Module Script Commands
FileRead
Use: Performs a formatted read from a file. The format_string is an fscanf stylestring, but with different variable format indicators, intended forcommand language usage. Regular characters require an exact match.Variables are indicated by the “$$”. When reading in a variable, the fileposition moves forward to the first non-blank character before attemptingthe variable read. After the variable is read, the file position steps forwardto the first character following the variable. For delimited strings, this isthe first character after the terminating double quote or whitespacecharacter (the next line if no terminating delimiter is found). For doublevalues, formats like 12.345e-02 are recognized.
Command: none
Syntax: fileread “filename” “format string”
Note: The return value is a string list.Specific formats supported are as follows:
$$l Long value.
$$d Double value.
$$mmm String value, using exactly mmm literal characters, countingwhite space as characters. For example, $$12.
$$s Character delimited string value with a maximum length of1024: if starts with double quote ends at either end of line or first double quote else ends at first white space character (or end of line)
$$[xxx] Skip x number of characters. If x is blank, this denotes any whitespace (tab, blank, newline, carriage return), such as , $$[ab].
$$[^xxx] Skip any number of characters until first of xxx encountered.
$$”xxx” Skip until directly after the first occurrence of a literal substring,or to the end of the file if not found. To use this format specifier,you must enclose the entire format string in single quotes, sothat the double quotes are not interpreted as the end of the for-mat string.
2-10 Default Command Set
2dmacro.bk : defaulcs.fm 11 Fri Mar 29 13:58:14 2002
Default Module Script Commands
☞Note: In all literal character specifiers, comparisons are sensitive to upper/lower
case exact match. In the [xxx] and [^xxx] formats, you may use ranges ofcharacters, such as [a-hm-z]. For example:
The $$s$$L$$[a-z ]$$d$$s$$s.
when applied to the following input string:
The brown 4 foot high dog ate 2.5 pounds “of meat”.
will produce the following output:
variable 1 (string): “brown”
variable 2 (long): 4
skipped string: “foot high dog ate “
variable 3 (double): 2.5
variable 4 (string): “pounds”
variable 5 (string): “of meat”
All values to be read are converted to string format, and the commandstores them into a return string list. The number of values successfully readis indicated by the number of components in the returned string list.
Default Command Set 2-11
2dmacro.bk : defaulcs.fm 12 Fri Mar 29 13:58:14 2002
Default Module Script Commands
FileReadLine
Use: Reads the next line from a macro file.Command: none
Syntax: filereadline “File name”
Example: filereadline “postcs.mac”
This example reads the next line in the postcs.mac file.
FileRecord
Use: Starts recording the subsequent commands to a macro file. If the filealready exists, you will be asked whether to overwrite it.
Command: none
Syntax: filerecord “File name”
Example: filerecord “Iverify.mac”
This example records your subsequent actions to the file Iverify.mac.
FileRecordAppend
Use: Starts recording the subsequent commands and appends them to a macrofile. If the macro file does not exist, it is created.
Command: none
Syntax: filerecordappend “filename”
Example: filerecordappend “Iverify.mac”
This example appends your subsequent actions to the existing macrofile Iverify.mac.
FileRecStop
Use: Stops recording to a macro file.Command: none
syntax: filerecstop
2-12 Default Command Set
2dmacro.bk : defaulcs.fm 13 Fri Mar 29 13:58:14 2002
Default Module Script Commands
FileWrite
Use: Performs a formatted write to a file. For a formatted write, the file isopened, the data is written, and the file is then closed on each writeoperation.
Command: none
Syntax: filewrite “filename” “write_mode” “format” [arg_list]
Note: filename is a STRING containing the name of the formatted file.write_mode is a STRING; either w (overwrite) or a (append).format is a STRING with literal contents plus $$ variable insertionindicators. When defining the format, use \n for new lines.arg_list is a STRING_LIST containing the arguments to be matchedagainst the variable insertion indicators in order.
FuncDef
Use: Defines a function. The function definition can reference arguments thatwill be input from the command prompt if they are not supported on theend line, when the macro is run.
Command: none
Syntax: funcdef function_name [Text or script_command_results]
Example: funcdef IncrVar assign $1 (add $1 1)
This example defines the function IncrVar, which takes a variablename from the command prompt and adds 1 to its value. Thus, toadd 1 to a variable named year:assign year 2000incrvar year
The value of year is 2001.
FuncHelp
Use: Adds help strings to an existing function.Command: none
Syntax: funchelp “function name” “Help strings”
Example: funchelp “t” “This is the sum of the variables u and v”
This example defines the help for function t. When you use helpfunctions, this description will appear for the function t.
Default Command Set 2-13
2dmacro.bk : defaulcs.fm 14 Fri Mar 29 13:58:14 2002
Default Module Script Commands
FuncSave
Use: Saves all functions to a file readable by FileExec.Command: none
Syntax: funcsave “File name”
Example: funcsave “t.mac”
This example saves the defined functions to a file named t.mac. If youexecute this file using the FileExec command, the functions saved inthe file are defined for the current project.
FuncUndef
Use: Removes a function definition.Command: none
Syntax: funcundef “function name”
Example: funcundef “t”
This example undefines the function t.
GE
Use: Returns a value of 1 if the first argument is greater than or equal to thesecond argument.
Command: none
Syntax: ge argument1 argument2
Note: GE arguments can be strings or numerical values.If argument1 is greater than argument2, the software returns a valueof 1 in the command prompt window.
GetDateAndTime
Use: Returns the current date and time.Command: none
Syntax: getdateandtime
GetFileList
Use: Returns a list of files that match a specified search pattern.Command: none
Syntax: getfilelist “search_pattern”
2-14 Default Command Set
2dmacro.bk : defaulcs.fm 15 Fri Mar 29 13:58:14 2002
Default Module Script Commands
GetFileName
Use: Opens a file dialog to get a filename from the user.Command: none
Syntax: getfilename “rw” “prompt” “filter” “title”
Note: rw is either “r” for read or “w” for write.prompt is the file prompt.filter is the file filter.title is the dialog title set to “Select file” by default.
GetMacroPath
Use: Returns the full path of a macro file.Command: none
Syntax: getmacropath “file name”
GetMacroPathList
Use: Returns the macro path list.Command: none
Syntax: getmacropathlist
GetProductId
Use: Returns the product ID number for the project. For Maxwell 2D, theproduct ID number is 9.
Command: none
Syntax: getproductid
GetUserOption
Use: Returns the value of a defined user option.Command: none
Syntax: getuseroption “category” “option name”
Note: category is the category of the user option.option name is the name of the user option.
GetVersion
Use: Returns the version number of the software for the project.Command: none
Syntax: getversion
Default Command Set 2-15
2dmacro.bk : defaulcs.fm 16 Fri Mar 29 13:58:14 2002
Default Module Script Commands
Global
Use: Returns the value of a global variable.Command: none
Syntax: global “variable name”
GlobalAssign
Use: Assigns a value to a global variable.Command: none
Syntax: globalassign “variable name” “value”
Note: The assigned value is a string.Example: globalassign “path1” “x”
This example assigns the value of x to path1.
GT
Use: Returns a value of 1 if the first argument is greater than the secondargument.
Command: none
Syntax: gt argument1 argument2
Note: GT arguments can be either strings or numerical values.
Help
Use: Provides help about an available item or list.Command: none
Syntax: help “Item name, commands, functions, or variables”
Example: help functions
This example lists all the functions defined for the current project.
ImportDatabase
Use: Imports a user database file. The first line of the database file mustcontain the number of rows and the number of columns.
Command: none
Syntax: importdatabase “filename” “dbase name”
Example: importdatabase “c:/mfs2/wgdatabase.dat” “tmp”
This example imports the wgdatabase.dat database. The database cannow be referred to by the name tmp.
2-16 Default Command Set
2dmacro.bk : defaulcs.fm 17 Fri Mar 29 13:58:14 2002
Default Module Script Commands
ImportRawDatabase
Use: Imports a user database file. The information must be organized intorows and columns, and each row must occupy a single line. TheImportRawDatabase command computes the number of rows andcolumns and stores it in memory. (Unlike the ImportDatabase command,the first row should not contain the number of rows and columns.)
Command: none
Syntax: importrawdatabase “filename” “dbase name”
Example: importrawdatabase “c:/mfs2/rawdatabase.dat” “tmp”
This example imports the rawdatabase.dat database. The databasecan now be referred to by the name tmp.
IsCommandEnabled
Use: Returns whether a command is enabled in the current context. The returnvalue is either a 1 (true) or a 0 (false).
Command: none
Syntax: iscommandenabled “command name”
Example: iscommandenabled “help”
If the help command is enabled, this value is 1; otherwise, it is 0.
IsDirectory
Use: Checks to see if a file is a directoryCommand: none
Syntax: isdirectory “filename”
LE
Use: Returns a value of 1 if the first argument is less than or equal to thesecond argument.
Command: none
Syntax: le argument1 argument2
Note: LE arguments can be either strings or numerical values.
Log10
Use: Returns the log base 10 value of the entered number.Command: none
Syntax: log10 VALUE
Example: log10 300
This returns a value of 2.4771212.
Default Command Set 2-17
2dmacro.bk : defaulcs.fm 18 Fri Mar 29 13:58:14 2002
Default Module Script Commands
LT
Use: Returns a value of 1 if the first argument is less than the second argument.Command: none
Syntax: lt argument1 argument2
Note: LT arguments can be strings or numerical values.
Minus
Use: Negates the given value.Command: none
Syntax: minus VALUE
Mul
Use: Multiplies two values together.Command: none
Syntax: mul argument1 argument2
Note: Mul arguments can be strings or numerical values.Example: mul line1 base1
In this example, the values of line1 and base1 are multiplied together.
NE
Use: Returns a value of 1 in the command prompt window if the two namedvalues are not equal.
Command: none
Syntax: ne argument1 argument2
Note: NE arguments can be strings or numerical values.
Example: ne line1 line2
In this example, if line1 is 15 and line2 is 25, the command promptwindow displays a 1.
NewDatabase
Use: Creates a new database with the number of columns you specify. Use theDatabaseAddRow and DatabaseSetField commands to add rows andvalues to the new database. Save the database to a disk file using theExportDatabase command.
Command: none
Syntax: newdatabase “dbase name” NUMBER_OF_COLUMNS “filename”
Example: newdatabase “database.dat” 6 “tmp”
This example creates the new database.dat database with sixcolumns. The database can now be referred to by the name tmp.
2-18 Default Command Set
2dmacro.bk : defaulcs.fm 19 Fri Mar 29 13:58:14 2002
Default Module Script Commands
OR
Use: Returns a value of 1 in the command prompt window if either of the twonamed values is non-zero.
Command: none
Syntax: or argument1 argument2
Note: OR arguments can be strings or numerical values.
ParametricFileExec
Use: Executes parameterized commands from a file. Support is also providedfor parameterized macro files.
Command: none
Syntax: parametricfileexec “filename” {variable/value pairs}
Note: variable/value pairs: a string list containing pairs of strings forthe variable name and variable value.
Example: parametricfileexec “3dmodel.mac” {“pair1” “pair2”}
This example executes the 3dmodel.mac file using the pair1 and pair2value pairs.
You can also control whether you record the contents of a file as itexecutes, and whether commands echo to the command window as afile executes, using the following: SetRecordingEnabled state SetEchoEnabled state where state is a LONG value of 1 for enabled or 0 for disabled.
When using this command, default values can be indicated in themacro file to be executed. Variables that are in variable/valuepairs are set as indicated. Other variables indicated in the defaultlist receive those values. Both type of assignments are private and areremoved automatically when the file finishes execution. The macrofile default values should be in a commented header, as follows: # BeginParameters # Assign varname1 value1 # Assign varname2 value2 . . # EndParameters
Default Command Set 2-19
2dmacro.bk : defaulcs.fm 20 Fri Mar 29 13:58:14 2002
Default Module Script Commands
Pos2
Use: Specifies the x- and y-coordinates of a 2D position. This is typically usedas part of a drawing command.
Command: none
Syntax: pos2 X_ARGUMENT Y_ARGUMENT
Example: pos2 2 4
This example defines a position x = 2 and y = 4.
Pos3
Use: Specifies the coordinates of a 3D position; you must specify values for x,y, and z.
Command: none
Syntax: pos3 X_ARGUMENT Y_ARGUMENT Z_ARGUMENT
Example: pos3 2 4 8
This example defines a 3D position with an x-coordinate of 2, a y-coordinate of 4, and a z coordinate of 8.
Pos3Dist
Use: Returns the Euclidean distance between two 3D positions.Command: none
Syntax: pos3dist [position1] [position2]
Example: pos3dist [2,2,2] [2,2,4]
This example calculates the distance between the point (2,2,2) and thepoint (2,2,4), which is 2.
PrependMacroPath
Use: Adds a directory to the front of the macro path list.Command: none
Syntax: prependmacropath “directory name”
PrintHelp
Use: Prints all the commands to a text file.Command: none
Syntax: printhelp “filename”
PrivateAssign
Use: Assigns a value to a private variable.Command: none
Syntax: privateassign variable_name “value”
2-20 Default Command Set
2dmacro.bk : defaulcs.fm 21 Fri Mar 29 13:58:14 2002
Default Module Script Commands
ProtectedAssign
Use: Assigns a value to a protected variable.Command: none
Syntax: protectedassign variable_name “value”
RandomFraction
Use: Generates and displays a pseudo-random number between 0 and 1,displaying it to the fifteenth decimal place.
Command: none
Syntax: randomfraction
RemoveMacroPath
Use: Removes a directory from the macro path list.Command: none
Syntax: removemacropath “directory name”
SetEchoEnabled
Use: Regulates the command window printer within the current macro file.Command: none
Syntax: setechoenabled enabled
Note: enabled settings are 0 for disabled, or 1 for enabled.Example: setechoenabled 1
This example enables the echoing within the current macro file.
SetMacroPathList
Use: Sets the macro path list.Command: none
Syntax: setmacropathlist “directory list”
SetRecordingEnabled
Use: Regulates recording within the current macro file.Command: none
Syntax: setrecordingenabled enabled
Note: enabled is 0 for disabled, 1 for enabledExample: setrecordingenabled 1
This example enables macro recording within the current file.
Default Command Set 2-21
2dmacro.bk : defaulcs.fm 22 Fri Mar 29 13:58:14 2002
Default Module Script Commands
SetUserOption
Use: Defines the user option value.Command: none
Syntax: setuseroption “category” “option name” “option value”
Note: category is the category of the user option.option name is the name of the user option.option value is the value of the user option.
Example: setuseroption “mfs2” “min_adaptive_passes” “0”
This example sets the minimum number of adaptive passes to 0 forthe Maxwell 2D project.
Sleep
Use: Sleeps (pauses) the module for a given number of seconds. No activityoccurs during a sleep.
Command: none
Syntax: sleep SECONDS
Example: sleep 10 filerecord “Iverify.mac”
This example pauses the system for 10 seconds and then beginsrecording a macro to the file Iverify.mac.
StrConcat
Use: Concatenates two strings.Command: none
Syntax: strconcat “string1” “string2”
Example: assign framenum 5
assign framelist {}
WHILE framenum
assign newstring (StrConcat “Frame“ framenum)assign framenum SUB framenum 1assign framelist stringlistsetcomponent framelist\
newstring -1
END
This example joins together the text string “Frame” with theframenum variable. As the frame number is reduced, each new textstring is added to the list of frames, so the final list is {“Frame5”,“Frame4”, “Frame3”, “Frame2”, “Frame1”}.
2-22 Default Command Set
2dmacro.bk : defaulcs.fm 23 Fri Mar 29 13:58:14 2002
Default Module Script Commands
String
Use: Converts arguments to a string.Command: none
Syntax: string arguments
StringListSetComponent
Use: Sets a string list entry. The modified list is the return value of thecommand. If the component has a value of -1, the new value is appendedto the list. The string list may be an empty list if you are creating a newstring list by adding the first component. Added components may bestring data, variables with string contents, or anything convertible tostrings.
Command: none
Syntax: stringlistsetcomponent {LIST} “STRING” COMPONENT
Note: LIST is a string list: {“string1” “string2” ...}Example: assign new_list stringlistsetcomponent new_list
“entry2” “boxdims”
This defines string list entry2 with the component of boxdims.
Strlen
Use: Returns the length of a string.Command: none
Syntax: strlen “string name”
Strstr
Use: Finds a substring within a string.Command: none
Syntax: strstr “string” “substring” starting_position
Note: starting position is the position from which to begin the search. Bydefault this is set to 0 to search at the beginning of the string. The returnvalue is 0-based index or - 1 if not found.
Sub
Use: Subtracts the second argument from the first.Command: none
Syntax: sub argument1 argument2
Note: Subtracted arguments can be either string or numerical values.
Default Command Set 2-23
2dmacro.bk : defaulcs.fm 24 Fri Mar 29 13:58:14 2002
Default Module Script Commands
Substring
Use: Extracts a substring from a string.Command: none
Syntax: substring “string” START_POSITION END_POSITION
Note: START_POSITION is the numerical start position of the string.END_POSITION is the numerical end position of the string.
Unassign
Use: Removes a variable definition.Command: none
Syntax: unassign variable name
Example: unassign xlength
This example removes the xlength variable.
Vec2
Use: Converts scalar values to a 2D vector (x- and y-components) that can beused for another command.
Command: none
Syntax: vec2 X_COMPONENT Y_COMPONENT
Example: vec2 2 2
This example creates the vector <2,2>.
Vec3
Use: Converts scalar values to a 3D vector (x-, y-, and z-components).Command: none
Syntax: vec3 X_COMPONENT Y_COMPONENT Z_COMPONENT
XOR
Use: Returns a value of 1 if exactly one of the entered arguments is non-zero,but not both .
Command: none
Syntax: xor argument1 argument2
Note: Arguments can be either string or numerical values.Example: xor line1 point1
If line1 is 10 mm and point1 is 0 mm, the command prompt windowreturns a value of 1.
2-24 Default Command Set
2dmacro.bk : generics.fm 1 Fri Mar 29 13:58:14 2002
3
Generic Script Commands
This chapter describes the generic script commands that aren’t specific to anyone module.The generic script commands include the following command sets:● Generic Module● mod3proj● mod3view
Generic Script Commands 3-1
2dmacro.bk : generics.fm 2 Fri Mar 29 13:58:14 2002
Generic Module Script Commands
Generic Module Script CommandsThe following script commands are classified as Generic Module scriptcommands.
CascadeAll
Use: Cascades all view and project windows.Command: Window/Cascade
Syntax: cascadeall
CascadeProjects
Use: Cascades all project windows.Command: none
Syntax: cascadeprojects
CascadeViews
Use: Cascades all view windows.Command: none
Syntax: cascadeviews
CloseWindow
Use: Closes the active view window.Command: Window/Close
Syntax: closewindow
ModuleIsPromptVisible
Use: Tests if the command prompt window is visible.Command: none
Syntax: moduleispromptvisible
ModuleSidewinLeft
Use: Moves the side window to the left of the screen.Command: View/Side Window/Left
Syntax: modulesidewinleft
ModuleSidewinRight
Use: Moves the side window to the right of the screen.Command: View/Side Window/Right
Syntax: modulesidewinright
3-2 Generic Script Commands
2dmacro.bk : generics.fm 3 Fri Mar 29 13:58:14 2002
Generic Module Script Commands
ModuleToggleMessage
Use: Toggles the status bar on and off.Command: none
Syntax: moduletogglemessage
ModuleTogglePrompt
Use: Toggles the command prompt window on and off.Command: View/Command Prompt
Syntax: moduletoggleprompt
ModuleToolbar(direction)
Use: Moves the tool bar to either the top, bottom, left, or right of the window.Command: View/Toolbar commands
Syntax: moduletoolbarbottom, moduletoolbartop,moduletoolbarleft, moduletoolbarright
ModuleToolbarHide
Use: Hides the tool bar.Command: View/Toolbar/Hide
Syntax: moduletoolbarhide
NewWindow
Use: Creates a new view window.Command: Window/New
Syntax: newwindow
PrintEntire
Use: Prints the contents of the entire module window.Command: none
Syntax: printentire
PrintProj
Use: Prints all the view windows for the current project.Command: none
Syntax: printproj
PrintRect
Use: Prints a rectangular area you select using the mouse.Command: none
Syntax: printrect
Generic Script Commands 3-3
2dmacro.bk : generics.fm 4 Fri Mar 29 13:58:14 2002
Generic Module Script Commands
PrintSubwin
Use: Prints the view window you select using the mouse.Command: none
Syntax: printsubwin
PrintView
Use: Prints all the view windows for the current project.Command: none
Syntax: printview
TileAllGrid
Use: Tiles all view and project windows in a grid.Command: Window/Tile
Syntax: tileallgrid
TileProjectsGrid
Use: Tiles all project windows in a grid.Command: none
Syntax: tileprojectsgrid
TileViewsGrid
Use: Tiles all view windows in a grid.Command: none
Syntax: tileviewsgrid
TileViewsHrz
Use: Tiles all view windows horizontally.Command: none
Syntax: tileviewshrz
TileViewsVrt
Use: Tiles all view windows vertically.Command: none
Syntax: tileviewsvrt
3-4 Generic Script Commands
2dmacro.bk : generics.fm 5 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
mod3proj Script CommandsThe following script commands are classified as mod3proj script commands.
AbortTimeout
Use: Sets the time-out, in milliseconds, for aborting a refresh of a viewwindow. While the software is refreshing a window, you are unable tomove (rotate, pan, and so forth) the object in the window. Setting theabort time-out sets the amount of time the software will spend refreshinga window before allowing the user to move the object.
Command: none
Syntax: aborttimeout TIME
ActivateView
Use: Activates the specified view window.Command: none
Syntax: activateview nn
Example: activateview 2
This activates the second view window.
CheckOverlap
Use: Checks for overlapping solids or 2D objects.Command: none
Syntax: checkoverlap
DeleteCS
Use: Deletes a saved coordinate system.Command: Coordinates/Delete CS
Syntax: deletecs “coordinate system name”
Example: deletecs “coord1”
This deletes the coordinate system coord1.
DeSelect
Use: Deselects the named selected objects.Command: Edit/Deselect All
Syntax: deselect “object_name1” “object_name2” ...
Example: deselect “terminal” “coil”
This deselects the selected objects terminal and coil in the model.
Generic Script Commands 3-5
2dmacro.bk : generics.fm 6 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
DispShaded
Use: Displays an object in flat shaded mode.Command: none
Syntax: dispshaded “object name”
Example: dispshaded “box1”
This displays the object box1 in flat shaded mode.
DispWire
Use: Displays an object in wire frame mode.Command: none
Syntax: dispwire “object name”
Example: dispwire “box1”
This displays the object box1 as a wire frame.
EditOrientations
Use: Access the Edit View Orientations window, allowing you to edit theviewing orientations.
Command: View/Orientations
Syntax: editorientations
GetCurPos
Use: Returns the current position (the blinking marker in the active viewwindow) in local coordinates.
Command: none
Syntax: getcurpos
GetDouble
Use: Prompts the user for a real value with the specified prompt and returns itto the script.
Command: none
Syntax: getdouble “Prompt name”
Example: animationsetstartvalue getdouble “Enter the startvalue for the animation plot.”
This example prompts the user for a value and assigns it as the start valuefor the variable of the animation plot. The text to the left of the promptreads “Enter the start value for the animation plot.”
3-6 Generic Script Commands
2dmacro.bk : generics.fm 7 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
GetLong
Use: Prompts the user for an integer value and returns it to the script.Command: none
Syntax: getlong “prompt name”
Example: assign IntVal getlong “Enter an Integer.”
This example prompts the user for a value and assigns IntVal the enteredvalue. The text to the left of the prompt will read “Enter an Integer.”
GetNumObjects
Use: Returns the total number of objects in the project, including invisibleobjects and background objects.
Command: none
Syntax: getnumobjects
GetNumViews
Use: Returns the total number of view windows.Command: none
Syntax: getnumviews
GetObjectName
Use: Returns a string of the object name for the specified object number.Command: none
Syntax: getobjectname OBJECT_NUMBER
Note: OBJECT_NUMBER is a sequential number from one to the GetNumObjectsvalue. If the OBJECT_NUMBER is out of range, an empty string is returned.
Example: echo getobjectname 1
This example displays the object name for the first object.
GetOrigin
Use: Returns the coordinate system origin in global coordinates.Command: none
Syntax: getorigin
Generic Script Commands 3-7
2dmacro.bk : generics.fm 8 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
GetPosition
Use: Prompts the user for a 3D position with the specified prompt and returnsit to the script. You may enter the position at the command prompt orclick the left mouse button on the point in the active view window.
Command: none
Syntax: getposition “prompt name”
Example: assign vertex1 getposition “Enter the position for thefirst vertex.”
This example prompts the user for a 3D position and assigns it to thevariable vertex1. The text to the left of the prompt reads “Enter theposition for the first vertex.”
GetString
Use: Prompts the user for a string with the specified prompt and returns it tothe script.
Command: none
Syntax: getstring “prompt name”
Example: assign NAME getstring “Enter a name for the object:”
This example prompts the user to enter a name for the object, thenassigns that string value to the variable NAME.
GetUnitConv
Use: Gets the unit conversion factor from meters. For example, if you are usingmillimeters, the unit conversion factor returned is 1000.
Command: none
Syntax: getunitconv
GetUnitName
Use: Gets the name of the current units.Command: none
Syntax: getunitname
3-8 Generic Script Commands
2dmacro.bk : generics.fm 9 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
GetVector
Use: Prompts you for an integer value and returns it to the script. You mayenter the vector at the command prompt or click the left mouse button inthe active view window to choose the vector points.
Command: none
Syntax: getvector “prompt name”
Example: assign vector1 getvector “Enter the vector:”
This example prompts you for a vector and assigns it to the variablevector1.
GlobalCS
Use: Switches to a global (absolute [0,0,0]) coordinate system.Command: Coordinates/Global
Syntax: globalcs
Hide
Use: Makes the specified object invisible.Command: none
Syntax: hide “object name”
Example: hide “box1”
This hides the object called box1.
HideOrient
Use: Hides an object’s orientation (the object’s local coordinate system).Command: none
Syntax: hideorient “Object name”
Example: hideorient “box1”
This hides the coordinate system of box1.
HideRegion
Use: Hides the problem region in the view windows.Command: Edit/Visibility/Toggle Region
Syntax: hideregion
HideSel
Use: Hides the selected objects in the view windows.Command: Edit/Visibility/Hide Selection
Syntax: hidesel
Generic Script Commands 3-9
2dmacro.bk : generics.fm 10 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
List
Use: Lists the objects in the modeler database.Command: none
Syntax: list
LocalCS
Use: Switches to the local coordinate system.Command: Coordinates/Local
Syntax: localcs
Lorigin
Use: Moves the local coordinate system’s origin to a new location.Command: none
Syntax: lorigin [Local coordinates]
Example: lorigin [10,10,10]
This example moves the local coordinate system’s origin to [10, 10,10] of the local coordinate system.
ObjectCS
Use: Makes the local coordinate system of an object the same as the localcoordinate system.
Command: Coordinates/Show ObjectCS
Syntax: objectcs “object name”
ObjectExists
Use: Checks for the existence of an object in the model.Command: none
Syntax: objectexists “object name”
Example: if objectexists “coil”dispshaded “coil”
This example checks to see if the object named coil exists and if itdoes, fills the object with a solid shading to make it more easilydiscernible in the model. The objectexists command is used primarilyin creating macros with conditions.
3-10 Generic Script Commands
2dmacro.bk : generics.fm 11 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
Origin
Use: Moves the global coordinate system’s origin to a new location.Command: Coordinates/Set Current CS/Move Origin
Syntax: origin [Global coordinates]
Example: origin [10,10,10]
This example moves the global coordinate system’s origin to[10, 10, 10] of the global coordinate system.
Origin?
Use: Displays the coordinates of the current global origin.Command: none
Syntax: origin?
PrintProj
Use: Prints all the windows for the current project (PC only).Command: none
Syntax: printproj
PrintView
Use: Prints the active view window (PC only).Command: none
Syntax: printview
Recolor
Use: Changes the colors of objects.Command: Edit/Attributes
Syntax: recolor “object name” <red(0-255)><green(0-255)><blue(0-255)>
Example: recolor “coil” 255 0 255
This example recolors coil to a deep violet shade.
RestoreCS
Use: Restores a saved local coordinate system.Command: none
Syntax: restorecs “coordinate system name”
Generic Script Commands 3-11
2dmacro.bk : generics.fm 12 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
RotateCS
Use: Rotates the local coordinate system about a vector by the specified angleof rotation.
Command: none
Syntax: rotatecs <Vector to rotate about> ANGLE
Example: rotatecs <0,0,10> 45
This example rotates the local coordinate system 45 degrees about thez-axis.
RotatedCS
Use: Switches to the latest rotated coordinate system, preserving the origin.Command: Coordinates/Rotated
Syntax: rotatedcs
SaveCmdWin
Use: Saves the contents of the command window to a text file. This isextremely useful when you wish to have a hardcopy of the contents of thecommand window.
Command: none
Syntax: savecmdwin “filename”
SaveCS
Use: Saves the current local coordinate system’s definition.Command: Coordinates/Save Current CS
Syntax: savecs “coordinate system name”
3-12 Generic Script Commands
2dmacro.bk : generics.fm 13 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
SaveWindow
Use: Saves the current active view window to a file.Command: none
Syntax: savewindow “filename” FILE_TYPE
Note: FILE_TYPE: Select from the following.
Example: savewindow “plot1.gif” 2
This saves the plot to a .gif file called plot1.gif.
Select
Use: Selects objects for further operations.Command: Edit/Select
Syntax: select “Object names”
Example: select { “layer1” “layer2” “layer3” }
This selects the three objects called layer1, layer2, and layer3. You donot need the brackets if you are only selecting one object.
SelInBox
Use: Selects objects located within a box.Command: none
Syntax: selinbox [Base vertex] SIZEX SIZEY SIZEZ
Example: selinbox [0,0,0] 10 10 10
This selects all objects in a box starting at the origin and extending 10units in the positive x, y, and z directions.
Number File type
0 bmp
1 ppm
2 gif
3 pict
4 rgb
5 tiff
6 ps
Generic Script Commands 3-13
2dmacro.bk : generics.fm 14 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
SetCurPos
Use: Sets the position of the cursor.Command: none
Syntax: setcurpos [X,Y,Z]
Example: setcurpos [0,0,0]
This defines the position of the cursor at the origin.
SetObjectCS
Use: Makes the specified object’s coordinate system the same as the localcoordinate system.
Command: Coordinates/Set Current CS
Syntax: setobjectcs “object name”
Example: setobjectcs “box1”
This sets the object coordinate system for box1 to the local coordinatesystem.
Show
Use: Shows a hidden object.Command: Edit/Visibility/By Item
Syntax: show “hidden object name”
Example: show “box1”
This example displays the object box1.
ShowAll
Use: Shows all hidden objects.Command: Edit/Show All
Syntax: showall
ShowOrient
Use: Shows the specified object’s coordinate system.Command: none
Syntax: showorient “object name”
ShowRegion
Use: Shows the problem region.Command: none
Syntax: showregion
3-14 Generic Script Commands
2dmacro.bk : generics.fm 15 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
ToggleRegion
Use: Toggles the visibility of the problem region.Command: none
Syntax: toggleregion
UnrotatedCS
Use: Switches to an unrotated coordinate system (that is parallel to the globalcoordinate system), preserving the origin.
Command: Coordinates/Unrotated
Syntax: unrotatedcs
VerifyRegion
Use: Verifies that the region encompasses all objects and that no objectsoverlap.
Command: none
Syntax: verifyregion
VisByItem
Use: Sets the visibility of individual objects. Select the items from the windowthat appears.
Command: Edit/Visibility/By Item
Syntax: visbyitem
XAxisAboutTo
Use: Rotates the local coordinate system’s x-axis about a vector so that thespecified point lies on a plane defined by the vector and the x-axis.
Command: Coordinates/Set Current CS/Rotate X
Syntax: xaxisaboutto <Vector to rotate about> [Point to rotateto]
Example: xaxisaboutto zunitvec [5,5,0]
This rotates the local coordinate system’s x-axis about the unit vectoron the z-axis so that the point [5,5,0] lies on the plane defined by thespecified unit vector and the x-axis.
XAxisTo
Use: Rotates the local coordinate system’s x-axis so that it goes through thegiven point.
Command: none
Syntax: xaxisto [point to rotate to]
Example: xaxisto [5,5,5]
This rotates the x-axis until the point at [5,5,5] lies on it.
Generic Script Commands 3-15
2dmacro.bk : generics.fm 16 Fri Mar 29 13:58:14 2002
mod3proj Script Commands
XUnitVec?
Use: Creates a unit vector along the x-axis.Command: none
Syntax: xunitvec?
YAxisAboutTo
Use: Rotates the local coordinate system’s y-axis about a vector so that thespecified point lies on a plane defined by the vector and the y-axis.
Command: Coordinates/Set Current CS/Rotate Y
Syntax: yaxisaboutto <vector to rotate about> [point to rotateto]
YAxisTo
Use: Rotates the local coordinate system’s y-axis so that the specified point lieson the axis.
Command: none
Syntax: yaxisto [Point to rotate to]
YUnitVec?
Use: Creates a unit vector along the y-axis.Command: none
Syntax: yunitvec?
ZAxisAboutTo
Use: Rotates the local coordinate system’s z-axis about a vector so that thespecified point lies on a plane defined by the vector and the z-axis.
Command: Coordinates/Rotate Z
Syntax: zaxisaboutto <vector to rotate about> [point to rotateto]
ZAxisTo
Use: Rotates the local coordinate system’s z-axis so that the specified point lieson the axis.
Command: none
Syntax: zaxisto [point to rotate to]
ZUnitVec?
Use: Creates a unit vector along the z-axis.Command: none
Syntax: zunitvec?
3-16 Generic Script Commands
2dmacro.bk : generics.fm 17 Fri Mar 29 13:58:14 2002
mod3view Script Commands
mod3view Script CommandsThe following script commands are classified as mod3view script commands.
AutoGrid
Use: Automatically sets the grid size to a specified number of pixels.Command: none
Syntax: autogrid GRID_DENSITY
Example: autogrid 20
This example places each grid point at 20 pixel intervals.
FitAll
Use: Displays all objects in the geometric model in the active view window.Command: View/Fit All/Active View
Syntax: fitall
FitAllViews
Use: Displays all objects in the geometric model in all view windows.Command: View/Fit All/All Views
Syntax: fitallviews
FitSel
Use: Displays the selected objects in the model in all view windows.Command: View/Fit Selection
Syntax: fitsel
Lookat
Use: Defines the center point of the view window.Command: none
Syntax: lookat <vector>
Example: lookat <20,20,10>
This example moves the center of the view window to the newreference point [20,20,10].
Ortho
Use: Selects the orthogonal projection of the active view window. The greaterthe view width, the smaller the objects in the view window appear.
Command: none
Syntax: ortho VIEW_WIDTH
Generic Script Commands 3-17
2dmacro.bk : generics.fm 18 Fri Mar 29 13:58:14 2002
mod3view Script Commands
Persp
Use: Selects the perspective projection.Command: none
Syntax: persp VIEW_ANGLE
PolarGrid
Use: Displays a polar grid. Choose a radius large enough to be displayed inthe active window. Otherwise the grid will not be visible.
Command: none
Syntax: polargrid ANGLE RADIUS
Example: polargrid 10 10
This example displays a polar grid with grid points spaced every 10units along the radius and in 10 degree increments around the origin.
RectGrid
Use: Sets up grid type and spacing.Command: none
Syntax: rectgrid <grid size>
Example: rectgrid <2,2,2>
This example displays a rectangular grid with grid points evenlyspaced every 2 units in each direction.
ResetViews
Use: Resets the windows to the original standard view.Command: none
Syntax: resetviews
RotView
Use: Rotates the viewpoint.Command: none
Syntax: rotview <vector to rotate about> ANGLE
Example: rotview zunitvec 45
This example rotates the view 45 degrees around the z unit vector.
3-18 Generic Script Commands
2dmacro.bk : generics.fm 19 Fri Mar 29 13:58:14 2002
mod3view Script Commands
Shaded
Use: Shows the active view window in a flat or smooth shaded view.Command: View/Render/Flat Shaded, View/Render/Smooth Shaded
Syntax: shaded “flat/smooth”
Example: shaded “flat”
This example displays a flat shaded view of all the objects in theactive view window.
Viewpoint
Use: Defines a viewpoint.Command: none
Syntax: viewpoint <view point>
Example: viewpoint <0,0,0>
This moves the viewpoint to the origin.
WireFrame
Use: Shows the active view window in wire frame mode.Command: View/Render/Wireframe
Syntax: wireframe
Generic Script Commands 3-19
2dmacro.bk : generics.fm 20 Fri Mar 29 13:58:14 2002
mod3view Script Commands
3-20 Generic Script Commands
2dmacro.bk : postcs.fm 1 Fri Mar 29 13:58:14 2002
4
Post Processor Script Commands
This chapter describes the script commands specific to the three post-processing modules available in Maxwell 2D. Refer to Chapter 3, “GenericScript Commands” for a complete list of the commands available in thesemodules.Each post-processing module uses the following generic command sets,which are described in Chapter 2 and Chapter 3:● Generic Module● mod2proj● mod2view● Default
The Post Processor modules have these additional command sets:● PostProcessor● Plot● FieldCalculator
This chapter describes the command sets for the post-processing modules.
Post Processor Script Commands 4-1
2dmacro.bk : postcs.fm 2 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Post Processor Command SetsThe PostProcessor, Plot, and FieldCalculator command sets are available in thePost Processor.
PostProcessor Script CommandsThe following script commands are classified as PostProcessor scriptcommands.
ArrowPlotOptions
Use: Opens the Arrow Plot Options window, allowing you to specify the typeand size of arrows in a plot.
Command: none
Syntax: arrowplotoptions
CalcVisToggle
Use: Opens the calculator. This command is identical to ShowCalc.Command: Data/Calculator
Syntax: calcvistoggle
CascadeAll
Use: Cascades and stacks all the open windows.Command: Window/Cascade
Syntax: cascadeall
CascadeProjects
Use: Cascades and stacks all open project windows.Command: Windows/Cascade
Syntax: cascadeprojects
CascadeViews
Use: Cascades and stacks all open view windows.Command: Windows/Cascade
Syntax: cascadeviews
CHelp
Use: Displays context-sensitive help.Command: Help/On Context
Syntax: chelp
4-2 Post Processor Script Commands
2dmacro.bk : postcs.fm 3 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
CloseProject
Use: Closes the active project.Command: File/Close
Syntax: closeproject
CloseWindow
Use: Closes the active view window.Command: Window/Close
Syntax: closewindow
DeleteGeometry
Use: Allows you to select a geometry that you want to delete, from thewindow that appears.
Command: Geometry/Delete
Syntax: deletegeometry
DeletePlot
Use: Deletes a plot.Command: Plot/Delete
Syntax: deleteplot “plot_name”
Example: deleteplot “plot1”
This example deletes plot1 from the active plots.
DisablePlineStitch
Use: Disables polyline stitching.Command: none
Syntax: disableplinestitch
EditFunctions
Use: Edits the function table.Command: Data/Functions/Edit
Syntax: editfunctions
EditPline
Use: Creates or edits a planar or polyline.Command: Geometry/Create/Line
Syntax: editpline “Polyline/sheet object”
Example: editpline “Line1”
This example creates (or edits, if it already exists) a polyline namedLine1. Edit Pline mode then starts, and you need to use the EditPlinescript commands to create the polyline.
Post Processor Script Commands 4-3
2dmacro.bk : postcs.fm 4 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
EditPline - AddVert
Use: Adds a vertex to the polyline.Command: Geometry/Create/Line
Syntax: addvert [x,y,z]
Example: addvert [0,0,0]
This example adds a vertex at the origin.
EditPline - AddVert3D
Use: Adds a vertex to the polyline.Command: Geometry/Create/Line
Syntax: addvert3d X Y Z
Example: addvert3d 0 0 0
This example adds a vertex at the origin.
EditPline - Arc
Use: Creates an arc.Command: Geometry/Create/Arc
Syntax: arc ARC_ANGLE
Example: arc 90
This example adds a 90-degree arc to the current polyline.
EditPline - CancelPline
Use: Cancels polyline edit or sheet edit mode.Command: none
Syntax: cancelpline
EditPline - Closepline
Use: Connects the last vertex entered with the first vertex entered, creating aclosed loop. The opposite of OpenPline.
Command: Geometry/Create/Line
Syntax: closepline
EditPline - DelEdge
Use: Deletes an edge of the polyline.Command: Geometry/Create/Line
Syntax: deledge EDGENUMBER
Example: deledge 0
This example deletes the first line segment created. The segmentnumbering begins at 0 with the first segment created. When youdelete an edge, the segments created after that edge are renumbered.
4-4 Post Processor Script Commands
2dmacro.bk : postcs.fm 5 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
EditPline - DelVert
Use: Deletes the specified vertex.Command: Geometry/Create/Line
Syntax: delvert [x,y,z]
Example: delvert [0,0,0]
This example deletes the vertex at the origin.
EditPline - EdgeGeom
Use: Changes the Edge Geometry of a segment.Command: Geometry/Create/Line
Syntax: edgegeom EDGE_NUMBER EDGE_GEOMETRY
Note: EDGE_GEOMETRY is 0=Straight, 1=Arc, or 2=SplineExample: edgegeom 1 1
This example changes the second line segment to an arc segment. Theline segment numbering begins at 0 with the first segment created.
EditPline - EdgeMode
Use: Specifies the Edge Geometry mode.Command: Geometry/Create/Line
Syntax: edgemode EDGE_GEOMETRY
Note: EDGE_GEOMETRY is 0=Straight, 1=Arc, or 2=SplineExample: edgemode 1
This example specifies the Edge Geometry mode as Arc. All segmentscreated after this will be arc segments.
EditPline - EndPline
Use: Use this when you have finished creating or editing the polyline and youwant to save it.
Command: Geometry/Create/Line
Syntax: endpline
EditPline - EndTangent
Use: Makes an edge of the arc end tangent to the next edge.Command: Geometry/Create/Line
Syntax: endtangent EDGE_NUMBER
Example: endtangent 2
This example makes the edge of the arc (edge number 1) end tangentto the next edge (edge number 2).
Post Processor Script Commands 4-5
2dmacro.bk : postcs.fm 6 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
EditPline - FindPlineVertNo
Use: Finds the vertex number for the specified vertex.Command: Geometry/Create/Line
Syntax: findplinevertno [x,y,z]
Example: findplinevertno [2,4,0]
This example finds the vertex number of the vertex at [2,4,0].
EditPline - GetPlineVert
Use: Finds the position of the specified vertex number.Command: Geometry/Create/Line
Syntax: getplinevert VERTEX_NUMBER
Example: getplinevert 3
This example returns the position of the third vertex.
EditPline - Insvert
Use: Inserts a vertex in the middle of a polyline.Command: Geometry/Create/Line
Syntax: insvert [vertex to insert before] [new position]
Example: insvert [2,4,0] [2,2,0]
This example inserts a new vertex at [2,2,0], before the vertex at[2,4,0].
EditPline - JoinSplines
Use: Joins two splines that share a vertex.Command: Geometry/Create/Line
Syntax: joinsplines VERTEX_NUMBER
Example: joinsplines 3
This example joins the two polylines that share the third vertex.
EditPline - MoveArcMidPt
Use: Moves the midpoint of an arc.Command: Geometry/Create/Line
Syntax: movearcmidpt EDGE_NUMBER [x,y,z]
Example: movearcmidpt 1 [2,2,0]
This example moves the midpoint of the arc (edge number 1) to[2,2,0].
4-6 Post Processor Script Commands
2dmacro.bk : postcs.fm 7 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
EditPline - MoveVert
Use: Moves a vertex to the specified position.Command: Geometry/Create/Line
Syntax: movevert [vertex position] [new position]
Example: movevert [2,4,0] [2,2,0]
This example moves the vertex at [2,4,0] to [2,2,0].
EditPline - OpenPline
Use: This creates an opening in a closed polyline by removing the segmentthat closed the loop. The opposite of ClosePline.
Command: Geometry/Create/Line
Syntax: openpline
EditPline - RenameCurPline
Use: Renames the polyline currently being edited.Command: Geometry/Modify/Line
Syntax: renamecurpline “new name”
EditPline - SetArcAngle
Use: Sets the angle of a polyline arc.Command: Geometry/Create/Line
Syntax: setarcangle EDGE_NUMBER ANGLE
Example: setarcangle 1 60
This example sets the angle of the arc (edge number 1) to 60 degrees.
EditPline - SetArcRadius
Use: Sets the radius of the polyline arc.Command: Geometry/Create/Line
Syntax: setarcradius EDGE_NUMBER RADIUS
Example: setarcradius 1 10
This example sets the radius of the arc (edge number 1) to 10. Theunits of the radius are the units you specified in the 2D Modeler.
EditPline - SetArcToFillet
Use: Sets a polyline arc to be a fillet with the specified radius.Command: Geometry/Create/Line
Syntax: setarctofillet EDGE_NUMBER RADIUS
Example: setarctofillet 1 10
This example sets the radius of the arc (edge number 1) to 10 andselects Fillet.
Post Processor Script Commands 4-7
2dmacro.bk : postcs.fm 8 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
EditPline - SplitSpline
Use: Splits a spline in two at the specified vertex.Command: Geometry/Create/Line
Syntax: splitspline VERTEX_NUMBER
Example: splitspline 3
This example splits the splines at the third vertex.
EditPline - StartTangent
Use: Makes an edge of the arc start tangent to the previous edge.Command: Geometry/Create/Line
Syntax: starttangent EDGE_NUMBER
Example: starttangent 1
This example makes edge number 1 of the arc start tangent to theprevious edge (edge number 0).
EnablePlineStitch
Use: Enables polyline stitching, allowing you to stitch polyline objects togetherwith the stitch commands.
Command: none
Syntax: enableplinestitch
Exit
Use: Exits the current module.Command: File/Exit
Syntax: exit
FormatPlotAxes
Use: Formats the axis labels and formats in the active plot.Command: Plot/Format/Axes
Syntax: formatplotaxes
FormatPlotGraphs
Use: Formats the graphs in the active plot.Command: Plot/Format/Graphs
Syntax: formatplotgraphs
4-8 Post Processor Script Commands
2dmacro.bk : postcs.fm 9 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
GeneralPlotOptions
Use: Displays the General Plot Options window, allowing you to specify thecolor and scaling preferences for the plot.
Command: none
Syntax: generalplotoptions
LinePlotOptions
Use: Displays the Line Plot Options window, allowing you to specify the colorand sizing preferences for a line plot.
Command: none
Syntax: lineplotoptions
ListPlotsProject
Use: Lists all plots in the current project.Command: none
Syntax: listplotsproject
ListPlotsView
Use: Lists all plots in the current view.Command: none
Syntax: listplotsview
Post Processor Script Commands 4-9
2dmacro.bk : postcs.fm 10 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
LoadCartesian3DPlot
Use: Loads and displays a 3D Cartesian plot in the plot window. To use thiscommand, you need to have previously created a plot.
Command: none
Syntax: loadcartesian3dplot “filename”
Note: You cannot add more than one trace to the plot.The input file has to be of the following format:
B_PLOT3D {[cartesian]} Heading str B_TRACE3D TraceName str B_LINES numlines num_points_on_line B_LINE x y z ... E_LINE ... E_LINES E_TRACE3DE_PLOT3D
Example: loadcartesian3dplot “plotlines”
This example loads the plotlines file and displays its associated plot inthe plot window.
MarkerPlotOptions
Use: Displays the Plot Marker Options window, allowing you to specify thetype and size of the markers in the plot.
Command: none
Syntax: markerplotoptions
ModifyPlot
Use: Displays a window to allow you to modify an existing plot.Command: Plot/Modify
Syntax: modifyplot “plot name”
Example: modifyplot “plot1”
This example accesses a window that allows you to modify the name,scale, and color map of plot1.
4-10 Post Processor Script Commands
2dmacro.bk : postcs.fm 11 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
ModifyVariables
Use: Modifies the variables in the function table.Command: Data/Functions/Modify
Syntax: modifyvariables
NewWindow
Use: Creates a new view window.Command: Window/New
Syntax: newwindow
OpenProject
Use: Opens a solved project.Command: File/Open
Syntax: openproject “project name” “solution name”
Example: openproject “magnet” “magnet”
This example opens the solutions file magnet in the magnet project.
PanelPlotDelete
Use: Deletes the existing plot.Command: Plot/Delete
Syntax: panelplotdelete
PanelPlotVisibility
Use: Edits the visibility of active plots.Command: Plot/Visibility
Syntax: panelplotvisibility
PostProcessorOptions
Use: Defines the user preferences for the settings of the Post Processor.Command: Options/Preferences
Syntax: postprocessoroptions
SaveDefinitions
Use: Saves the post-processing information to a file with the same name as theproject.
Command: File/Save
Syntax: savedefinitions
Post Processor Script Commands 4-11
2dmacro.bk : postcs.fm 12 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
ShowCalc
Use: Displays the field calculator. This command is identical to CalcVisToggle.Command: Data/Calculator
Syntax: showcalc
ShowPlotCoordinates
Use: Displays the coordinates of the active point.Command: Plot/Show Coordinates
Syntax: showplotcoordinates
ShowSolutionInfo
Use: Displays solution and mesh information.Command: Data/Solution Info
Syntax: showsolutioninfo
TileAllGrid
Use: Tiles all active windows.Command: Window/Tile
Syntax: tileallgrid
TileProjectsGrid
Use: Tiles the active project windows.Command: Window/Tile
Syntax: tileprojectsgrid
TileViewsGrid
Use: Tiles the active view windows.Command: Window/Tile
Syntax: tileviewsgrid
TogglePlotVisibility
Use: Toggles the visibility of the specified plots.Command: none
Syntax: toggleplotvisibility “Plot name”
Example: toggleplotvisibility “plot1”
This example toggles off the visible plot, plot1. Repeating thiscommand toggles the plot back on.
4-12 Post Processor Script Commands
2dmacro.bk : postcs.fm 13 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Plot Script CommandsThe following commands are classified as Plot script commands.
Graph3dSetColor
Use: Sets the color of the lines on a graph. Select the color from the windowthat appears.
Command: none
Syntax: graph3dsetcolor
Graph3dSetFilled
Use: Displays the graph as a shaded graph or a contour graph.Command: none
Syntax: graph3dsetfilled “Filled Yes/No”
Example: graph3dsetfilled “yes”
This displays the graph as a shaded graph.
Graph3dSetLine
Use: Defines the line attributes for graphs. Select the line attributes from thewindow that appears.
Command: none
Syntax: graph3dsetline
Graph3dSetOutline
Use: Displays the outline of the 3d graph.Command: none
Syntax: Graph3dSetOutline draw_outline
Note: draw_outline is the LONG value of the outline.
Graph3dSetRefinement
Use: Sets refinement levels for graphs, providing a smoother variation ofcolors.
Command: none
Syntax: graph3dsetrefinement LEVEL
Note: The LEVEL is 0=Low, 1=Medium, or 2=High.
☞Note: The Plot script commands require that a plot be present.
Post Processor Script Commands 4-13
2dmacro.bk : postcs.fm 14 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Graph3dSetShade
Use: Turns lighting effects on or off.Command: none
Syntax: graph3dsetshade ON/OFF
Note: ON/OFF settings are: 0=On, 1=Off
Graph3DSetToneShaded
Use: Displays the graph in tone shaded colors.Command: none
Syntax: graph3dsettoneshaded TONE
Note: TONE is the number that corresponds to a defined colormap shade.
Graph3dUpdateGraph
Use: Updates the graph to incorporate any changes (such as changing the lineattributes with the Graph3dSetLine command).
Command: none
Syntax: graph3dupdategraph
Plot3dDrawAxes
Use: Turns the axes on or off.Command: none
Syntax: plot3ddrawaxes ON/OFF
Note: ON/OFF settings are: 0=On, 1=Off
Plot3dDrawGrid
Use: Turns the grid on or off.Command: none
Syntax: plot3ddrawgrid ON/OFF
Note: ON/OFF settings are: 0=On, 1=Off
Plot3dSetAxesLabelSize
Use: Sets the size of the axis labels.Command: none
Syntax: plot3dsetaxeslabelsize SIZE
Example: plot3dsetaxeslabelsize 0.025
This example sets the size of the label for each axis to 0.025 points.
4-14 Post Processor Script Commands
2dmacro.bk : postcs.fm 15 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Plot3dSetColorMap
Use: Sets the type of color map to use for the graph. Select the type from thewindow that appears.
Command: none
Syntax: plot3dsetcolormap
Plot3dSetHeadExtrusion
Use: Extrudes the plot heading by the specified distance in the current units.Command: none
Syntax: plot3dsetheadextrusion DISTANCE
Plot3dSetHeading
Use: Sets the text for the heading of the plot.Command: none
Syntax: plot3dsetheading “Heading”
Plot3dSetHeadingColor
Use: Sets the color of the heading.Command: none
Syntax: plot3dsetheadingcolor COLOR
Note: Due to the wide variety of colors, they are not listed here. Experimentwith various numbers to find a color you like.
Example: plot3dsetheadingcolor 1
This example changes the color of the heading to white.
Plot3dSetHeadingFont
Use: Sets the font for the heading.Command: none
Syntax: plot3dsetheadingfont FONT
Note: The wide variety of fonts are not listed here. Experiment with variousnumbers to find a font you like.
Example: plot3dsetheadingfont 4
This example changes the font of the heading to Times Roman.
Plot3dSetHeadingSize
Use: Sets the size of the heading.Command: none
Syntax: plot3dsetheadingsize SIZE
Post Processor Script Commands 4-15
2dmacro.bk : postcs.fm 16 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Plot3dSetLighting
Use: Toggles the lighting effect on or off for the plots.Command: none
Syntax: plot3dsetlighting ON/OFF
Note: ON/OFF settings are: 0=On, 1=Off
Plot3dSetScale
Use: Allows you to change the scale of the plot.Command: none
Syntax: plot3dsetscale AUTO MIN MAX DIVISIONS LINEAR/LOG
Note: AUTO settings are: 0=Use min/max settings, 1=Use autoscaleLINEAR/LOG settings are: 0=Linear, 1=Logarithmic
Example: plot3dsetscale 0 0 10 10 0
This example defines a linear scale using a minimum setting of 0, amaximum setting of 10, and 10 divisions.
Plot3dShowColorKey
Use: Toggles the color key on or off.Command: none
Syntax: plot3dshowcolorkey ON/OFF
Note: ON/OFF settings are: 0=On, 1=Off
Plot3dUpdatePlots
Use: Updates the plots in the active window.Command: none
Syntax: plot3dupdateplots
4-16 Post Processor Script Commands
2dmacro.bk : postcs.fm 17 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
FieldCalculator Script CommandsThe following script commands are classified as FieldCalculator scriptcommands.
* (Multiply)
Use: Multiplies the contents of the top two registers on the stack.Command: Field Calculator
Syntax: *
+ (Add)
Use: Adds the contents of the top two registers on the stack.Command: Field Calculator
Syntax: +
– (Subtract)
Use: Subtracts the contents of the top two registers on the stack.Command: Field Calculator
Syntax: –
/ (Divide)
Use: Divides the contents of the top of the stack by the next entry.Command: Field Calculator
Syntax: /
1/
Use: Computes the inverse of the value in the top register of the calculatorstack.
Command: Field Calculator
Syntax: 1/
Abs
Use: Calculates the absolute value of the value in the top of the stack.Command: Field Calculator
Syntax: abs
AddFaceAtPos
Use: Adds the face at the specified position to a faces list.Command: none
Syntax: addfaceatpos “faces list” “object” [Face position]
Example: addfaceatpos “faces1” “abc” [10,5,0]
This example adds the face at [10,5,0] on the object abc to the faces1
Post Processor Script Commands 4-17
2dmacro.bk : postcs.fm 18 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
list.
AddObjectToList
Use: Adds an object to an existing list.Command: Geometry/Create/Object List
Syntax: addobjecttolist “list name” “object name”
Example: addobjecttolist “condlist” “coppercyl”
This example adds the object coppercyl to the object list condlist.
AnimationAddFrame
Use: Adds a frame in the current window to an animation.Command: Plot/Animation
Syntax: animationaddframe “plot name” “frame name” POSITION
Note: POSITION refers to the frame’s position in the frame list. For example:-1=Add to end of list 0=Add to beginning of list 1=Add after first frame 2=Add after second frame
Example: animationaddframe “Animation1” “Frame1” -1
This example adds the frame Frame1 to the animation plotAnimation1 at the end of the frame list.
AnimationDeleteFrame
Use: Removes a frame from the animation.
Command: Plot/Animation
Syntax: animationdeleteframe “plot name” FRAME_NUMBER
Example: animationdeleteframe “Animation1” 0
This example deletes the first frame from the animation plotAnimation1.
☞Note: The frame numbering begins at zero.
4-18 Post Processor Script Commands
2dmacro.bk : postcs.fm 19 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
AnimationMoveFrame
Use: Moves a frame to a new position in the animation.Command: Plot/Animation
Syntax: animationmoveframe “plot name” FRAME_NUMBER POSITION
Note: POSITION refers to the frame’s position in the frame list. For example:-1=Move to end of list 0=Move to beginning of list 1=Move after first frame 2=Move after second frame
Example: animationmoveframe “Animation1” 1 0
This example moves the second frame in the frame list to thebeginning of the list in the animation plot Animation1.
AnimationPlay
Use: Plays an animation plot.Command: Plot/Animation
Syntax: animationplay “Plot name” NUMBER_OF_FRAMES
Example: animationplay “magplot” 4
This example plays the next four frames of the animation namedmagplot.
AnimationPlot
Use: Creates an animation plot with the specified name and number of frames.Command: Plot/Animation
Syntax: animationplot “Plot name” NUMBER_OF_FRAMES
Example: animationplot “Plot1” 10
This example creates a 10-frame animation plot called Plot1.
AnimationSaveFrames
Use: Saves the frame of the selected animation to a file with the specifiedfilename prefix and extension.
Command: none
Syntax: animationsaveframes “plot name” “file’s base name”“format”
Note: format is one of the following: bmp, gif, pict, tiff, or sgiExample: animationsaveframes “mag H” “antenna” “gif”
This example saves the magnetic field frames for the antenna file in .gifformat.
Post Processor Script Commands 4-19
2dmacro.bk : postcs.fm 20 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
AnimationSavePlotUse: Saves the contents of the selected animation to a file.
Command: noneSyntax: animationsaveplot “plot name” “filename” “format”
DELAY GRAYSCALE [image_size] LOOPS BRIGHTNESS CONTRAST“avi compression” AVI_COMPRESSION_FACTOR
Note: The following settings are available:format: GIF or AVIDELAY: time delay between frames, in seconds.GRAYSCALE: 0 for no, 1 for yes.image_size: [xval, yval]. Defaults to [0,0].LOOPS: number of loops in the animation.BRIGHTNESS: the brightness from -0.5 to 0.5. Defaults to 0.CONTRAST: 0.5 to 2.avi_compression: None, Inelindeo, Cinepak, MSVideo.AVI_COMPRESSION_FACTOR: 0 to 100. Default is 50.
Example: animationsaveplot “magH” “antenna” “avi” 3 0 [100,100]8 0 0 “none” 0
This example saves plot magH for the antenna file as an AVI file whoseframes are spaced at 3-second intervals. The image size is 100x100 in fullcolor, with no compression or adjustments to the contrast or brightness.
AnimationSetDeltaValUse: Sets the value by which the animation variable changes between each
frame of animation. Use this command in conjunction withAnimationSetStartVal and AnimationSetStopVal.
Command: none
Syntax: animationsetdeltaval VALUE
AnimationSetPlayTimeUse: Plays the animation for the specified time, in milliseconds.Command: none
Syntax: AnimationSetPlayTime TIME
AnimationSetRefinementUse: Sets the refinement value for animation plots.Command: none
Syntax: AnimationSetRefinement LEVEL
Note: LEVEL is 0 to 2
☞Note: AVI output is available only on the PC.
4-20 Post Processor Script Commands
2dmacro.bk : postcs.fm 21 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
AnimationSetStartVal
Use: Sets the value at which the animation variable starts.Command: none
Syntax: animationsetstartval VALUE
AnimationSetStopVal
Use: Sets the value at which the animation variable stops.Command: none
Syntax: animationsetstopval VALUE
AnimationSetStoreFrame
Use: Sets whether you want to store the frames in memory for later use.Command: none
Syntax: animationsetstoreframe STORE_FRAMES?
Example: STORE_FRAMES? Use 0 for no, 1 for yes.
AnimationSetVarName
Use: Sets the variable you want to vary when creating an animation plot.Command: none
Syntax: animationsetvarname “variable name”
Example: animationsetvarname “PHASE”
This example creates an animation plot by varying the phase of theselected quantity.
AnimationShowFrame
Use: Displays the specified frame of an animation plot.Command: Plot/Animation
Syntax: animationshowframe “plot name” FRAME_NUMBER
AppendSolutions
Use: Appends a scalar value and a time, t, to a file. A scalar value must bepresent in the top register of the data calculator stack for this command towork.
Command: Append (Field Calculator)
Syntax: appendsolutions “File name”
Example: appendsolutions “transient1.sol”
This example appends the scalar value and time to the transient1.solfile.
Post Processor Script Commands 4-21
2dmacro.bk : postcs.fm 22 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
ArcCreate
Use: Defines an arc geometry.Command: Geometry/Create/Arc
Syntax: arccreate [center] ARC_AXIS RADIUS <radius vector>CLOCKWISE “angle/end_pos” SEGMENTS “object name”
Note: The following definitions are available:center: [xval, yval, zval]ARC_AXIS: 0 for X, 1 for Y, 2 for Z.radius_vector: <xval, yval, zval>CLOCKWISE?: 0 for counterclockwise, 1 for clockwise.angle/end_pos: angle or end position.
Example: arccreate [0,0,0] 0 10 <50,50,0> 1 “angle” 15 “arc1”
This example creates a clockwise arc named arc1 from the origin to[50,50,0] with 15 segments.
AtPhase
Use: Evaluates the complex quantity of the constant scalar and complex scalaror vector at the top of the stack at phase. The constant scalar needs to beat the top of the stack.
Command: Field Calculator
Syntax: atphase
BHPlot
Use: Plots the BH-curve for an object with nonlinear materials.Command: none
Syntax: bhplot “object name”
Example: bhplot “magnet1”
This example plots the BH-curve for the magnet1 object.
BuildPlotInfo
Use: Updates plots on the specified geometry.Command: none
Syntax: buildplotinfo “Geometry name”
Example: buildplotinfo “faces1”
This example updates the plot on the faces list faces1.
Clear
Use: Clears the stack contents in the Field Calculator.Command: Field Calculator
Syntax: clear
4-22 Post Processor Script Commands
2dmacro.bk : postcs.fm 23 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
CmplxI
Use: Makes a scalar or vector into a complex quantity using the scalar orvector in the top register of the calculator stack as the imaginary part.
Command: Field Calculator
Syntax: cmplxi
CmplxMag
Use: Calculates the complex magnitude of the top register of the stack.Command: Field Calculator
Syntax: cmplxmag
CmplxR
Use: Makes a scalar or vector into a complex quantity using the scalar orvector in the top register as the real part.
Command: Field Calculator
Syntax: cmplxr
Conj
Use: Calculates the conjugate of the top register of the stack.Command: Field Calculator
Syntax: conj
CreateAnimation
Use: Creates a new animation plot with a default name.Command: Plot/Animation
Syntax: createanimation NUMBER_OF_FRAMES
CreateBHPlot
Use: Accesses the BH Plot panel, allowing you to select the object for which toplot the BH-curve.
Command: Plot/BH Curves
Syntax: createbhplot
CreatePlot
Use: Creates a new field plot.Command: Plot/Field
Syntax: createplot
Post Processor Script Commands 4-23
2dmacro.bk : postcs.fm 24 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Cross
Use: Calculates the cross product of the top two registers of the stack.Command: Field Calculator
Syntax: cross
Curl
Use: Calculates the curl of the top register of the stack.Command: Field Calculator
Syntax: curl
D/Dx
Use: Calculates the derivative of the top register with respect to x.Command: Field Calculator
Syntax: d/dx
D/Dy
Use: Calculates the derivative of the top register with respect to y.Command: Field Calculator
Syntax: d/dy
D/Dz
Use: Calculates the derivative of the top register with respect to z.Command: Field Calculator
Syntax: d/dz
DefineCutPlane
Use: Defines a cutplane geometry.Command: none
Syntax: definecutplane “plane name” [position] <normal>
Example: definecutplane “plane1” [0,0,0] <0,0,10>
This example defines the cutplane named plane1 whose position restsat the origin and whose normal plane extends from [0,0,10].
DefineFacesList
Use: Creates an object list. Add faces to the list using the AddFaceWithId orAddFaceAtPos commands.
Command: none
Syntax: definefaceslist “list name”
4-24 Post Processor Script Commands
2dmacro.bk : postcs.fm 25 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
DefineFunction
Use: Defines a function. The new function is listed in the Functions table.Command: none
Syntax: definefunction “function definition”
Example: definefunction “f=sin(x)”
This example defines f as sin(x).
DefineObjectList
Use: Creates an object list. Add objects to the list using the AddObjectToListcommand.
Command: none
Syntax: defineobjectlist “list name”
DefinePoint
Use: Defines a point.Command: none
Syntax: definepoint “point name” [px,py,pz]
Example: definepoint “pointsource“ [100,50,50]
This example defines a point named pointsource at [100,50,50].
DeleteLine
Use: Deletes a line.Command: none
Syntax: deleteline “line name”
DeletePlot
Use: Deletes an existing plot.Command: none
Syntax: deleteplot “plot name”
DeletePoint
Use: Deletes a point.Command: none
Syntax: deletepoint “point name”
DeleteSurface
Use: Deletes a surface geometry.Command: none
Syntax: deletesurface “surface name”
Post Processor Script Commands 4-25
2dmacro.bk : postcs.fm 26 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
DeleteVolume
Use: Deletes a volume geometry.Command: none
Syntax: deletevolume “volume name”
DeltaModifyPoint
Use: Changes the point’s position by a specified incremental position.Command: Geometry/Create/Point
Syntax: deltamodifypoint “name” [px,py,pz]
Example: deltamodifypoint “point1” [0,0,1]
This example moves the point point1 by 1 unit in the positive z-direction. If the point had been at [0,0,2] it would now be at [0,0,3].
Divg
Use: Calculates the divergence of the value in the top register of the calculatorstack.
Command: Field Calculator
Syntax: divg
Domain
Use: Restricts a field quantity to a volume. The two top entries of the stackmust be a volume geometry and a numeric quantity, with the volume onthe top of the stack.
Command: Field Calculator
Syntax: domain
Dot
Use: Calculates the dot product of the top two stack registers.Command: Field Calculator
Syntax: dot
Draw
Use: Opens a drawing window, which allows you to draw a geometry (onlylines and surfaces) from the top stack register.
Command: Field Calculator
Syntax: draw
4-26 Post Processor Script Commands
2dmacro.bk : postcs.fm 27 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
DrawLine
Use: Draws the line contained in the top register of the stack. This command islike the Draw command, except it does not access the Line Drawingwindow.
Command: Field Calculator
Syntax: drawline “plot name”
DrawSurface
Use: Creates a plot of a surface.Command: Field Calculator
Syntax: drawsurface “plot name”
DrawVolume
Use: Creates a volume box.Command: Field Calculator
Syntax: drawvolume “plot name”
Enter
Use: Enters a solved field quantity in the top register of the stack.Command: Field Calculator
Syntax: enter “quantity name”
Example: enter “E”
This example enters the complex E-field vector in the top register ofthe stack.
EnterComplex
Use: Enters a complex constant in the top register of the stack. The quantitymust be in the form [Real, Imag].
Command: Field Calculator
Syntax: entercomplex [Real, Imaginary]
EnterComplexVector
Use: Enters a complex vector quantity in the top register of the stack.Command: Field Calculator
Syntax: entercomplexvector [X_real, X_imag] [Y_real, Y_imag][Z_real, Z_imag]
Post Processor Script Commands 4-27
2dmacro.bk : postcs.fm 28 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
EnterFrequency
Use: For frequency-dependent solutions, this command enters the frequencyvalue in the top register of the calculator stack.
Command: Field Calculator
Syntax: enterfrequency frequency_value
EnterLine
Use: Enters a specified line in the top register of the stack.Command: Field Calculator
Syntax: enterline “linename”
EnterPoint
Use: Enters a point in the top register of the stack.Command: Field Calculator
Syntax: enterpoint “point name”
EnterScalar
Use: Enters a scalar constant in the top register of the stack.Command: Field Calculator
Syntax: enterscalar VALUE
EnterScalarFunction
Use: Enters a scalar function in the top register of the stack.Command: Field Calculator
Syntax: enterscalarfunction “Function name”
EnterSurface
Use: Enters a surface in the top register of the stack.Command: Field Calculator
Syntax: entersurface “surface name”
EnterVector
Use: Enters a vector constant in the top register of the stack.Command: Field Calculator
Syntax: entervector <x,y,z>
4-28 Post Processor Script Commands
2dmacro.bk : postcs.fm 29 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
EnterVectorFunction
Use: Enters a previously defined vector function in the top register of thestack.
Command: Field Calculator
Syntax: entervectorfunction “X function” “Y function” “Zfunction”
Example: entervectorfunction “PHI” “YPOS” “XANGLE”
This example enters the vector function <PHI, YPOS, XANGLE> onthe calculator stack.
EnterVolume
Use: Enters a volume in the top register of the stack.Command: Field Calculator
Syntax: entervolume “volume name”
Evaluate
Use: Evaluates the operation in the top register of the stack.Command: Field Calculator
Syntax: evaluate
Exchange
Use: Exchanges the top two stack entries in the Field Calculator. For example,if the top entry in the stack is a vector quantity and the second entry is ascalar quantity, this command exchanges those two values so that the topentry is a scalar quantity and the second entry is a vector quantity.
Command: Field Calculator
Syntax: exchange
ExportAnimation
Use: Accesses the Export Animation window, allowing you to export theanimated plot to a standard animation format (AVI or GIF). UNIXplatforms can only export animated GIF plots.
Command: File/Export Animation
Syntax: exportanimation
Post Processor Script Commands 4-29
2dmacro.bk : postcs.fm 30 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
ExportToFile
Use: Exports the field quantity in the top register to a file, mapping it to a gridof points. Use this command to save field quantities in a format that canbe read by other modeling or post-processing software packages. Beforeusing this command, you must create a file containing the points.
Command: Field Calculator
Syntax: exporttofile “points filename” “export filename”
ExportToVolumeGrid
Use: Exports field values to locations on a grid.Command: Field Calculator
Syntax: exporttovolumegrid [Base vertex] [Box size] [Gridsize] “Export file name”
Example: exporttovolumegrid [-10,-10,-10] [20,20,20] [5,5,5]“export1.dat”
This example creates a 20x20x20 box that starts at the point [-10,-10,-10] and has grid points at every 5 units. The values are saved to thefile export1.dat.
FunctionValue
Use: Returns the value of the specified function.Command: none
Syntax: functionvalue “Name of function”
GetTopEntryValue
Use: Returns the value of the top register of the stack. The top register must bea constant and should be a real scalar or real vector. This information canthen be saved to a file or assigned to variables and used by other scriptcommands.
Command: Field Calculator
Syntax: gettopentryvalue
Grad
Use: Calculates the gradient of the top register of the stack.Command: Field Calculator
Syntax: grad
Imag
Use: Calculates the imaginary part of the top register of the stack.Command: Field Calculator
Syntax: imag
4-30 Post Processor Script Commands
2dmacro.bk : postcs.fm 31 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Integrate
Use: Integrates a field on a geometry. The contents of the top two registers ofthe stack need to be a geometry on the top register (other than a point orvolume box) followed by a scalar on the second register.
Command: Field Calculator
Syntax: integrate
IsoSurface
Use: Generates an iso-value surface of the field.Command: Field Calculator
Syntax: isosurface
LineCreate
Use: Creates a polyline. Use the EditPline commands to create the points onthe line.
Command: Geometry/Create/Line
Syntax: linecreate
LineModify
Use: Selects a line to modify. After you select a line to modify, use theEditPline commands to modify the line.
Command: Geometry/Modify/Line
Syntax: linemodify “line to modify”
LinePlot
Use: Creates a line plot from the contents of the top two registers of the stack.The contents of the top of the stack must be a line geometry followed by ascalar quantity in the second register. When you select a quantity and asurface using the Plot/Field command, they are loaded into the FieldCalculator.
Command: Plot/Field
Syntax: lineplot “plot name”
Post Processor Script Commands 4-31
2dmacro.bk : postcs.fm 32 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
LinePlot2D
Use: Creates a 2D line plot from the contents of the top two registers of thestack. The top of the stack must be a line geometry followed by a scalarquantity.
Command: Plot/Field, Field Calculator
Syntax: lineplot “plot name” COLOR WIDTH MARKER_STYLELINE_STYLE DRAW_MARKER? DRAW_LINE? NEW_WINDOW?
Note: The following definitions are available:COLOR is a value between 0 and 255.WIDTH: The higher the number, the thicker the line.MARKER_STYLE is one of the following types:
LINE_STYLE is one of the following types:
DRAW_MARKER?: 0=No Markers, 1=Draw MarkersDRAW_LINE?: 0=No lines, 1=Draw linesNEW_WINDOW?: 0=Add to current window, 1=New window
Example: lineplot2d “graph2” 1 1 0 1 0 1 1
This example creates a plot called graph2 in a new window. Thegraph uses thin, solid white lines, and no markers are displayed.
Type Marker Type Marker
0 no marker 6 Triangle
1 . 7 Circle
2 x 8 Solid Square
3 + 9 Solid Diamond
4 Square 10 Solid Triangle
5 Diamond 11 Solid Circle
Style Line Form
1 Solid line
2 Dashed line
3 Dotted line
4 Dash-dot line
5 Dash-dot-dot line
4-32 Post Processor Script Commands
2dmacro.bk : postcs.fm 33 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
LineRecalculate
Use: Updates all plots that depend on the line that is currently being modified.Command: Geometry/Modify/Line
Syntax: linerecalculate
Ln
Use: Takes the logarithm of the value in the top of the stack.Command: Field Calculator
Syntax: ln
Load2DPlot
Use: Reads in a 2D plot (.dat file).Command: Plot/Open/2D Plot
Syntax: load2dplot “file name”
LoadPlot
Use: Reads in a 3D plot (.dsp file).Command: Plot/Open/3D Plot
Syntax: loadplot “file name”
LockCutPlaneNormal
Use: Locks and unlocks the normal for a cutplane. Locked normals cannot bemodified.
Command: none
Syntax: lockcutplanenormal “plane name” LOCK
Note: LOCK: 0=Unlocked, 1=Locked
LockCutPlaneOrigin
Use: Locks and unlocks the origin for a cutplane. Locked origins cannot bemodified.
Command: none
Syntax: lockcutplaneorigin “plane name” LOCK
Note: LOCK: 0=Unlocked, 1=Locked
LockVolume
Use: Locks and unlocks the geometry. Locked geometries cannot be modified.Command: none
Syntax: lockvolume “volume name” LOCK
Note: LOCK: 0=Unlocked, 1=Locked
Post Processor Script Commands 4-33
2dmacro.bk : postcs.fm 34 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Log
Use: Takes the log base 10 value of the top register of the calculator stack.Command: Field Calculator
Syntax: log
Mag
Use: Computes the magnitude of the top register of the calculator stack.Command: Field Calculator
Syntax: mag
Material
Use: Multiplies or divides the vector in the top of the stack by the selectedmaterial property. At each tetrahedron, the field quantity in the topregister is multiplied or divided by the value of the selected materialproperty — taking the different material attributes of each object intoaccount.
Command: Field Calculator
Syntax: material “material” “operation”
Note: material options are mu, epsi, omega, and cond.operation options are mult(multiply) and divd (divide).
Example: material “mu” “mult”
This example multiplies the vector in the top of the stack by thepermeability.
MathFunc
Use: Evaluates the specified function using the value in the top of the stack asthe operand.
Command: Field Calculator
Syntax: mathfunc “function”
Note: The following functions are available:SinCosTanAsinAcosAtanAtan2
Example: mathfunc “Sin”
This example takes the sine of the quantity in the top of the stack.
4-34 Post Processor Script Commands
2dmacro.bk : postcs.fm 35 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Maximum
Use: Finds the maximum value of a field in a geometry. The top of the stackmust be a geometry (other than a point), followed by a numeric quantityin the second register.
Command: Field Calculator
Syntax: maximum
MaxPos
Use: Finds the position in a geometry where the field is at a maximum. The topof the stack must be a geometry (other than a point), followed by anumeric quantity in the second register.
Command: Field Calculator
Syntax: maxpos
Minimum
Use: Finds the minimum value of a scalar field in a geometry. The top of thestack must be a geometry (other than a point), followed by a numericquantity in the second register.
Command: Field Calculator
Syntax: minimum
MinPos
Use: Finds the position in a geometry where the field is at a minimum. The topvalue of the stack must be a geometry (other than a point), followed by anumeric quantity in the second register.
Command: Field Calculator
Syntax: minpos
ModelMax
Use: Displays the bounding box maximums.Command: none
Syntax: modelmax
ModelMin
Use: Displays the bounding box minimums.Command: none
Syntax: modelmin
Post Processor Script Commands 4-35
2dmacro.bk : postcs.fm 36 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
ModifyPlot
Use: Allows you to modify an existing plot from the window that appears. Thewindow that appears depends on the type of plot.
Command: Plot/Modify
Syntax: modifyplot “plot name”
ModifyPoint
Use: Changes the position of a point.Command: Geometry/Create/Point, Geometry/Modify/Point
Syntax: modifypoint “point name” [x,y,z]
Example: modifypoint “point1” [1,0,10]
This example changes the position of the point point1 to [1,0,10].
Neg
Use: Takes the negative of the value in the top register of the stack.Command: Field Calculator
Syntax: neg
Normal
Use: Returns the unit vector normal to the surface that is in the top register ofthe stack.
Command: Field Calculator
Syntax: normal
NormalComponent
Use: Computes the normal component of a vector quantity on a surface suchas a cutplane or an object surface. This is the equivalent of taking the dotproduct of the quantity with the surface’s unit normal vector.
Command: Field Calculator
Syntax: normalcomponent
ObjectListCreate
Use: Displays a window that allows you to create an object list.Command: Geometry/Create/Object List
Syntax: objectlistcreate
ObjectListModify
Use: Displays a window that allows you to modify an object list.Command: Geometry/Modify/Object List
Syntax: objectlistmodify
4-36 Post Processor Script Commands
2dmacro.bk : postcs.fm 37 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
OrphanPlots
Use: Makes all plots independent of both the geometry on which they werecreated and the numeric quantity they display.
Command: none
Syntax: orphanplots
Phase
Use: Calculates the phase of the contents of the top register of the stack.Command: Field Calculator
Syntax: phase
Plot
Use: Plots the field (second item on the stack) on a geometry (top item on thestack).
Command: Field Calculator
Syntax: plot
PlotMesh
Use: Draws a mesh for the current selection.Command: Plot/Mesh
Syntax: plotmesh
PlotModifyFunction
Use: Adds, updates, or deletes a function.Command: Data/Functions/Modify
Syntax: plotmodifyfunction OPERATION “function name” “functionexpression”
Note: OPERATION options are 0=add/update, and 1=delete.
Example: plotmodifyfunction 0 “Mat1” “X+5”
This example adds the new function Mat1 and defines it as X+5.
PointCreate
Use: Displays a window that allows you to create a point.Command: Geometry/Create/Point
Syntax: pointcreate
PointModify
Use: Displays a window that allows you to modify points.Command: Geometry/Modify/Point
Syntax: pointmodify
Post Processor Script Commands 4-37
2dmacro.bk : postcs.fm 38 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
PointValuePlot
Use: Creates a point value plot.Command: Field Calculator, Plot/Field
Syntax: pointvalueplot “plot name”
Pop
Use: Deletes the contents of the top register of the stack.Command: Field Calculator
Syntax: pop
PostprocessorOptions
Use: Accesses the 2D Post Processor Preferences window, allowing you todefine the plot lighting and the number of plot colorkey colors.
Command: Options/Preferences
Syntax: postprocessoroptions
Pow
Use: Calculates the power of the contents of the top register of the stack. Thenumber in the top register is raised to the number in the second registerof the stack.
Command: Field Calculator
Syntax: pow
ProjDir
Use: Returns the name and path of the current project directory.Command: none
Syntax: projdir
ProjName
Use: Returns the name of the current project.Command: none
Syntax: projname
Push
Use: Duplicates the top register, so that the same values appear in the top tworegisters of the calculator stack.
Command: Field Calculator
Syntax: push
4-38 Post Processor Script Commands
2dmacro.bk : postcs.fm 39 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
ReadSolutions
Use: Reads a register into the calculator from a disk file.Command: Field Calculator
Syntax: readsolutions “filename”
Real
Use: Calculates the real part of the value in the top register of the stack.Command: Field Calculator
Syntax: real
RectBoxCreate
Use: Defines a rectangle in the Maxwell 2D Post Processor.Command: Geometry/Create/Rectangle
Syntax: rectboxcreate <first point [x,y,z]> <plane normal to><width (along lower numbered axis)> <height (alonghigher numbered axis)> “Object name” <covered?>
Note: plane normal to is the rectangular plane normal to the axis (0=x, 1=y,2=z)covered is either 0=no or 1=yes. Covered surfaces form sheet objects.The default value is 1.
Example: rectboxcreate [0,0,0] 2 10 12 “sheet1” 1
This example creates a 10x12 covered rectangle, normal to the z-axis,named sheet1.
RemoveFaceAtPos
Use: Removes an object face at the specified position from a faces list.Command: none
Syntax: removefaceatpos “list name” “object name” [Position]
Example: removefaceatpos “faces1” “abc” [10,2,5]
For the faces list faces1 and the object name abc, this exampleremoves the face found at [10,2,5].
RemoveObjectFromList
Use: Removes an object from a list.Command: Geometry/Create/Object List, Geometry/Modify/Object List
Syntax: removeobjectfromlist “list name” “object name”
Post Processor Script Commands 4-39
2dmacro.bk : postcs.fm 40 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
RenameEntry
Use: Renames the entry in the top register of the calculator stack.Command: Field Calculator
Syntax: renameentry “new name”
RenameLine
Use: Renames a polyline.Command: none
Syntax: renameline “polyline name” “new name”
RenamePlot
Use: Renames a plot.Command: none
Syntax: renameplot “plot name” “new name”
RenamePoint
Use: Renames a point.Command: none
Syntax: renameplot “point name” “new name”
RenameSurface
Use: Renames a surface geometry.Command: none
Syntax: renamesurface “surface name” “new name”
RenameVolume
Use: Renames a volume geometry.Command: none
Syntax: renamevolume “volume name” “new name”
RollDn
Use: Rolls the bottom register to the top of the stack, moving the otherregisters down the stack.
Command: Field Calculator
Syntax: rolldn
RollUp
Use: Rolls the top register to the bottom of the stack, moving the otherregisters up the stack.
Command: Field Calculator
Syntax: rollup
4-40 Post Processor Script Commands
2dmacro.bk : postcs.fm 41 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
RZ_Integral
Use: Integrates the value in the top register of the field calculator over RZ.Command: Field Calculator
Syntax: rz_integral
Save2DPlot
Use: Saves a 2D Plot to a .dat file.Command: Plot/Save As/2D Plot
Syntax: save2dplot “filename”
SavePlot
Use: Saves a 3D plot to a .dsp file.Command: Plot/Save As/3D Plot
Syntax: saveplot “plotname” “filename” BINARY
Note: BINARY is 0 (save in binary format) or 1 (do not save in binary format).Example: saveplot “plot1” “magplots” 0
This example saves plot1 to the magplots.dsp file in binary format.
ScalarX
Use: Converts a vector to a scalar, using the x-component only.Command: Field Calculator
Syntax: scalarx
ScalarY
Use: Converts a vector to a scalar, using the y-component only.Command: Field Calculator
Syntax: scalary
ScalarZ
Use: Converts a vector to a scalar, using the z-component only.Command: Field Calculator
Syntax: scalarz
Scalar_PHI
Use: Converts a vector to a scalar, using the phi-component only.Command: Field Calculator
Syntax: scalar_phi
Post Processor Script Commands 4-41
2dmacro.bk : postcs.fm 42 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Scalar_R
Use: Converts a vector to a scalar, using the r-component only.Command: Field Calculator
Syntax: scalar_r
Scalar_Z
Use: Converts a vector to a scalar, using the z-component only.Command: Field Calculator
Syntax: scalar_z
SetArrow
Use: Sets up arrow attributes.Command: none
Syntax: setarrow TYPE MAP_SIZE? MAP_COLOR? SIZE
Note: TYPE is 0 (2D), or 1 (3D)MAP_SIZE is 0 (Off), or 1 (On)MAP_COLOR is 0 (Off), 1 (On)
SetColormap
Use: Selects the color to use for the plot.Command: none
Syntax: setcolormap COLOR
Note: Enter one of the following COLOR parameters:
Parameter Color
0 Spectrum, Rainbow
1 Spectrum, Temperature
2 Spectrum, Magenta
3 Spectrum, Grayscale
8-23 Ramp color. The numbering begins in theupper left corner of the color map square andcounts down each column.
4-42 Post Processor Script Commands
2dmacro.bk : postcs.fm 43 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
SetFilled
Use: Displays the graph as a shaded graph or a contour graph. Use thiscommand in conjunction with the SetPlotAttributes and UpdatePlotscommands.
Command: none
Syntax: setfilled FILLED
Note: FILLED settings are 0 (Contour), or 1 (Shaded).Example: setfilled 1
This example displays the graph as a shaded graph.
SetGridSpacing
Use: Sets up grid spacing. Use this in conjunction with the SetPlotAttributesand UpdatePlots commands.
Command: none
Syntax: setgridspacing SPACING
Example: setgridspacing 2
This example sets the space between grid points to 2.
SetHiddenLine
Use: Toggles between two types of wire frame view. The first wire frame viewallows you to see the wire frame lines of every tetrahedron. The secondallows you to see only the wire frame lines of the tetrahedra on top. Inother words, if a tetrahedron is “behind” another tetrahedron, it is notvisible. Use this command in conjunction with the SetPlotAttributes andUpdatePlots commands.
Command: none
Syntax: sethiddenline TOGGLE
Note: TOGGLE values are 0 for all lines visible, and 1 for hidden lines (invisible,meaning only text can be seen on top).
Example: sethiddenline 0
This example sets the view to one in which all wire frame lines arevisible.
☞Note: To set the view to a shaded one, use the SetFilled command.
Post Processor Script Commands 4-43
2dmacro.bk : postcs.fm 44 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
SetLine
Use: Sets up line attributes.Command: none
Syntax: setline WIDTH LINE_STYLE
Note: WIDTH is the width of the line. The higher the number, the thicker theline.LINE_STYLE is defined as:
SetMarker
Use: Sets up a scalar marker.Command: none
Syntax: setmarker MARKER_STYLE MAP_SIZE MAP_COLOR SIZE
Note: MARKER_STYLE is defined as one of the following types:
MAP_SIZE is defined by 0 (Off), or 1 (On).MAP_COLOR is defined as one of the following parameters:
Style Line Form
1 Solid line.
2 Dashed line.
3 Dotted line.
4 Dash-dot line.
5 Dash-dot-dot line.
Type Marker
10 Sphere
11 Box
12 Tetrahedron
13 Octahedron
Parameter Color
0 Spectrum, Rainbow
1 Spectrum, Temperature
2 Spectrum, Magenta
3 Spectrum, Grayscale
8-23 Ramp color. The numbering begins in theupper left corner of the color map square andcounts down each column.
4-44 Post Processor Script Commands
2dmacro.bk : postcs.fm 45 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
SetMeshExternal
Use: Selects whether tetrahedra are drawn on the surface of objects or insidethe objects.
Command: none
Syntax: setmeshexternal TOGGLE
Note: TOGGLE values are 0 (inside object), and 1 (object surfaces only).Example: setmeshexternal 1
This example displays the mesh tetrahedra only on the surfaces ofobjects.
SetMeshScale
Use: Sets the percentage of the original size at which mesh tetrahedra aredrawn.
Command: none
Syntax: setmeshscale SCALE_FACTOR
Example: setmeshscale 80
This example draws the tetrahedra at 80% of their original size.
SetNumPoints
Use: Sets up the number of points for line plots.Command: Geometry/Create/Line, Geometry/Modify/Line
Syntax: setnumpoints NUMBER
SetPlotAttributes
Use: Updates the plot attributes to the current settings. Use this commandafter setting the attributes and before updating the plot usingUpdatePlots.
Command: none
Syntax: setplotattributes “plot name”
SetRefinement
Use: Sets refinement levels for plots, providing a smoother variation of colors.Command: none
Syntax: setrefinement LEVEL
Note: LEVEL values are 0 (Low), 1 (Medium), or 2 (High).
Post Processor Script Commands 4-45
2dmacro.bk : postcs.fm 46 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
SetScale
Use: Sets up a plot scale.Command: none
Syntax: setscale AUTOSCALE? MIN MAX LEVELS LOG?
Note: AUTOSCALE settings are 0 (use manual scale), or 1 (use autoscale)LOG values are 0 (linear), or 1 (logarithmic).
Example: setscale 0 0 10 12 0
This example creates a manual linear plot scale whose values rangebetween 0 and 10 units with 12 divisions.
SetTextMarker
Use: Specifies whether to use text or markers for point value plots. If you selecttext, the value of the field at that point is displayed.
Command: none
Syntax: settextmarker SHOW_TEXT
Note: SHOW_TEXT options are 0 (use markers), or 1 (show text).Example: settextmarker 1
This example toggles markers to display the text. Use the SetMarkercommand to set the marker parameters.
SetTransparency
Use: Sets the transparency of the plotted mesh on a percentage scale (0-100).Command: Plot/Mesh
Syntax: settransparency PERCENTAGE
ShowColorKey
Use: Shows or hides the color key for a plot.Command: none
Syntax: showcolorkey “plot name” SHOW_FLAG
Note: SHOW_FLAG options are 0 (hide color key), or 1 (show color key).
Smooth
Use: Smooths the data in the top register of the stack.Command: Field Calculator
Syntax: smooth
SolutionName
Use: Displays the name of the solution file.Command: none
Syntax: solutionname
4-46 Post Processor Script Commands
2dmacro.bk : postcs.fm 47 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
Sqrt
Use: Computes the square root of the value in the top register of the stack.Command: Field Calculator
Syntax: sqrt
StoreComputations
Use: Stores the contents of the top register of the stack in memory for later use.Command: Field Calculator
Syntax: storecomputations STORE
Note: STORE options are 0 (do not store), or 1 (store).
SurfacePlot
Use: Creates a surface plot from the contents of the top two registers of thestack. The top register must be a surface geometry, and the next registermust be scalar quantity. When you select a quantity and a surface usingPlot/Field, they are loaded into the Field Calculator.
Command: Plot/Field
Syntax: surfaceplot “plot name”
Tangent
Use: Returns the unit vector tangential to the line in the top register of thestack.
Command: Field Calculator
Syntax: tangent
TangentComponent
Use: Computes the tangential component of a vector along a line.Command: Field Calculator
Syntax: tangentcomponent
Top
Use: Displays the top register of the stack.Command: Field Calculator
Syntax: top
Undo
Use: Undoes the previous specified number of operations.Command: Field Calculator
Syntax: undo NUMBER_OF_STEPS
Post Processor Script Commands 4-47
2dmacro.bk : postcs.fm 48 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
UpdatePlots
Use: Refreshes all plots, regenerating those that were modified.Command: none
Syntax: updateplots
Value
Use: Evaluates the value of the stack at a specified point. The top register mustbe a geometry, and the next register must be a numeric quantity.
Command: Field Calculator
Syntax: value
VecX
Use: Converts a scalar value to a vector using only the x-component.Command: Field Calculator
Syntax: vecx
VecY
Use: Converts a scalar value to a vector using only the y-component.Command: Field Calculator
Syntax: vecy
VecZ
Use: Converts a scalar value to a vector using only the z-component.Command: Field Calculator
Syntax: vecz
Vec_PHI
Use: Converts a scalar value to a vector using only the phi-component.Command: Field Calculator
Syntax: vec_phi
Vec_R
Use: Converts a scalar value to a vector using only the r-component.Command: Field Calculator
Syntax: vec_r
Vec_Z
Use: Converts a scalar value to a vector using only the z-component.Command: Field Calculator
Syntax: vec_z
4-48 Post Processor Script Commands
2dmacro.bk : postcs.fm 49 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
VolumePlot
Use: Creates a volume plot from the top two contents of the calculator stack.The top two entries of the stack must be a volume geometry followed by ascalar quantity. When you select a quantity and a volume using Plot/Field,they are loaded into the Field Calculator.
Command: Plot/Field
Syntax: volumeplot “plotname”
WriteSolutions
Use: Writes field values to a file.Command: Field Calculator
Syntax: writesolutions “filename”
Post Processor Script Commands 4-49
2dmacro.bk : postcs.fm 50 Fri Mar 29 13:58:14 2002
Post Processor Command Sets
4-50 Post Processor Script Commands
2dmacro.bk : wizardcs.fm 1 Fri Mar 29 13:58:14 2002
5
Wizard Script Commands
This chapter describes the script commands that allow you to create wizards.A wizard is a graphical interface that prompts the user for the necessaryinformation to complete a task.
Wizard Script Commands 5-1
2dmacro.bk : wizardcs.fm 2 Fri Mar 29 13:58:14 2002
Wizard Arguments
Wizard ArgumentsSeveral wizard script commands require complex arguments that areexplained in detail in this section, rather than the Default commands lists inwhich they reside.
Information TypesWhen creating a wizard field using the AddWizardField command, you mustspecify the type of information the wizard expects the user to enter. There arenine types of information:
LONG An integer.DOUBLE A double precision floating point number.DOUBLE LIST A list of double precision floating point numbers. The user
must enter the data in the following form: {# # #}.STRING A character sequence. The user does not need to enclose
the character sequence in quotes unless it contains embed-ded blanks or punctuation.
STRING LIST A list of strings. The user must enter the data in the fol-lowing form: {“string1” “string2” “string3”}.
VEC2 A 2D vector, with an x- and y-component. The user mustenter the data in the following form: <x, y>.
VEC3 A 3D vector, with an x-, y-, and z-component. The usermust enter the data in the following form: <x, y, z>.
POS2 A 2D position, with an x- and y-component. The usermust enter the data in the following form: [x, y].
POS3 A 3D position, with an x-, y-, and z-component. The usermust enter the data in the following form: [x, y, z].
5-2 Wizard Script Commands
2dmacro.bk : wizardcs.fm 3 Fri Mar 29 13:58:14 2002
Wizard Arguments
Mathematical FunctionsWhen creating a validating expression to test the contents entered in thewizard’s fields with the AddWizardValidatorExpr command, use theappropriate syntax for the mathematical functions. The following legalfunctions may be used to define mathematical expressions:
/ Divide.+ Add.- Subtract or unary minus.* Multiply.% Modulus.** Exponentiate.<< Left shift.>> Right shift.= Assign.== Equal to.!= Not equal to.> Greater than.< Less than.>= Greater than or equal to.<= Less than or equal to.& Bitwise AND.| Bitwise OR.^ Bitwise XOR.~ 1’s compliment.&& Logical AND.II Logical OR.! Factorial.if IF statement.sign Returns the sign of an argument. Syntax: sign (x)abs Absolute value. Syntax: abs (x)exp Exponential. Syntax: exp (x) = ex.pow Raises the specified value to the specified power. Syntax: pow
(x, y) = xy.ln Natural log. Syntax: ln (x)log Log base 10. Syntax: log (x)lg Log base 2. Syntax: lg (x)sqrt Square root. Syntax: sqrt (x)floor Round down. Syntax: floor (x)
Wizard Script Commands 5-3
2dmacro.bk : wizardcs.fm 4 Fri Mar 29 13:58:14 2002
Wizard Arguments
All trigonometric expressions expect their arguments to be in degrees, and theinverse trigonometric functions’ return values are in degrees. These functionnames are reserved and may not be used as variable names.
ceil Round up. Syntax: ceil (x)round Round to nearest x. Syntax: round (x)rand Generate a random number between 0 and 1. Syntax: rand ()deg Convert radians to degrees. Syntax: deg (x)rad Convert degrees to radians. Syntax: rad (x)sin Sine. Syntax: sin (x)cos Cosine. Syntax: cos (x)tan Tangent. Syntax: tan (x)asin Arc sine. Syntax: asin (x)acos Arc cosine. Syntax: acos (x)atan Arc tangent. Syntax: atan (x)atan2 Arc tangent (in the range of -n/2 to n/2). Syntax: atan2 (x)sinh Hyperbolic sine. Syntax: sinh (x)cosh Hyperbolic cosine. Syntax: cosh (x)tanh Hyperbolic tangent. Syntax: tanh (x)
5-4 Wizard Script Commands
2dmacro.bk : wizardcs.fm 5 Fri Mar 29 13:58:14 2002
Wizard Arguments
User Menu AdditionsThe following commands are classified as Default commands in the interface,but are part of the commands referred to as User Menu Additions, and are nottruly part of any module.
AddHelpSelboxItem
Use: Adds an item to the active module help selection box.Command: none
Syntax: addhelpselboxitem {item hierarchy} “description”“macro filename”
Note: The acceptable values are as follows:Item hierarchy is a string list.Description is a string that describes the help item.Macro filename is a string containing the name of the macro file.
Example: addhelpselboxitem {“sketch” “fill”} “Fills the currentsketch with color” “sketch2d.mac”
This example adds the description to the Sketch/Fill command, whichuses the sketch2d.mac macro file to complete the step when invoked.
AddMenuItem
Use: Adds a menu item to the end of the menu bar or to the end of an existingmenu. The macro file is executed when the menu item is selected.
Command: none
Syntax: addmenuitem {item hierarchy} “Description” “macrofilename”
Note: The acceptable values are as follows:Item hierarchy is a string list.Description is a string that describes the help item.Macro filename is a string containing the name of the macro file.
Example: addmenuitem {“sketch” “fill”} “Fills the currentsketch with color” “sketch2d.mac”
This adds the Sketch/Fill command to the menu and invokes thesketch2d.mac to execute the command.
Wizard Script Commands 5-5
2dmacro.bk : wizardcs.fm 6 Fri Mar 29 13:58:14 2002
Wizard Arguments
AddMenuSeparator
Use: Adds a user menu separator.Command: none
Syntax: addmenuseparator <menu hierarchy>
Note: Menu hierarchy is a string list.Example: Addmenuseparator <“sketch” “fill”>
This adds a separator after Sketch/Fill in the user-defined menu.
DebugFileExec
Use: Accesses the Macro Debugger to allow you to monitor the execution andmodify values in a running macro. Refer to the online documentation formore information on the Macro Debugger.
Command: none
Syntax: debugfileexec “macro file”
Note: The macro file can include the path and filename of the macro.Example: debugfileexec “c:\Maxwell\antenna.pjt\modelant.mac”
This example loads the modelant.mac file in the Macro Debugger andaccesses the debugger window.
DeleteHelpSelboxItem
Use: Deletes a help selection box item.Command: none
Syntax: deletehelpselboxitem {item hierarchy}
Note: Item hierarchy is a string list.Example: deletehelpselboxitem {“sketch” “fill”}
This example deletes the item for the Sketch/Fill hierarchy.
DeleteMenuItem
Use: Deletes a menu item from the hierarchy. You may delete an intermediatelayer of the hierarchy, provided it is a user-defined addition.
Command: none
Syntax: deletemenuitem {item hierarchy}
Note: Item hierarchy is a string list.Example: deletemenuitem {“sketch” “fill”}
This example removes the user-defined item Sketch/Fill from themenu.
5-6 Wizard Script Commands
2dmacro.bk : wizardcs.fm 7 Fri Mar 29 13:58:14 2002
Wizard Arguments
DisableMenuItem
Use: Disables a user-defined menu item.Command: none
Syntax: disablemenuitem {item hierarchy}
Note: Item hierarchy is a string list.Example: disablemenuitem {“sketch”}
This example disables the user-defined Sketch menu item.
MacroDebugger
Use: Accesses the Ansoft Macro Debugger.Command: none
Syntax: macrodebugger “macro filename”
Note: The macro filename must include the path to the macro.SetMenuItemHotkey
Use: Defines the hotkey for a user-defined menu item.Command: none
Syntax: setmenuitemhotkey {hierarchy} “hotkey”
Note: hierarchy is a string list identifying the menu item to which to assignthe hotkey.
Example: setmenuitemhotkey {“sketch” “fill”} “ctrl-f4”
This example sets Control-F4 as the hotkey for the user-defined menuitem “Sketch/Fill.”
Wizard Script Commands 5-7
2dmacro.bk : wizardcs.fm 8 Fri Mar 29 13:58:14 2002
Wizard Arguments
Wizard Script CommandsThe following script commands are classified as Wizard script commands.
AddWizardButtons
Use: Adds a push, checkbox, radio button, or buttons to the wizard. Eachbutton is assigned a variable that allows the software to track whether thebutton was selected or not. In addition, several wizard script commandsuse the variables assigned to buttons to manipulate them.
Command: none
Syntax: addwizardbuttons “wizard name” “button type”BUTTON_WIDTH {“variable names”} {“button labels”}{“command actions”} “orientation” {pixmap files}
Note: Button type: Enter one of the following:
BUTTON_WIDTH is the width, in characters, of the buttons.variable names are the variables used to identify the buttons.button labels are the text labels of the buttons.command actions are the commands to execute when button ispressed. Use FileExec to execute multiple commands for each button.orientation options are vert (vertical), or horiz (horizontal).pixmap files is a string list where optional contents are used only forPUSH buttons and specifies the files containing the pixmap definitions
Example: addwizardbuttons "input_geo" "push" 20 {"var1" "var2""var3"} {"Box 1" "Box 2" "Box 3" } {"FileExec'geo.mac" "Box [0, 100, 100] 100 100 100 'box2'" "Box[0, 100, 100] -100 -100 -100 'box3'"} "vertical"
This creates three buttons labeled Box 1, Box 2, Box 3 in a verticalformation. The buttons are identified by the variables var1, var2,var3. The first button executes the script command geo.mac, whichcould contain a second wizard that acts as a subwindow. The secondand third buttons draw boxes named Box 2 and Box 3, respectively.
☞Note: For checkboxes and radio buttons, the variables associated with these but-
tons have two possible values: 1 indicates that the button is selected, 0 indi-cates that the button is deselected.
Type Description
push A push button.
check A checkbox. Allows you to turn an option on and off.
radio A radio button. Allows you to select from among severalstyles.
5-8 Wizard Script Commands
2dmacro.bk : wizardcs.fm 9 Fri Mar 29 13:58:14 2002
Wizard Arguments
AddWizardField
Use: Creates the fields in which values are entered from the wizard window.Each field is given a variable name that is assigned the value the userenters. When you create a field, you must specify the variable type of thevalue entered. The variable types are listed in detail at the beginning ofthis chapter.
Command: none
Syntax: addwizardfield “wizard name” “variable name” “variabletype” “prompt”
Note: variable name is the variable to which the value entered is assigned.variable type is one of the following:
prompt is the name or prompt for the field.Example: addwizardfield “input_geo” “width” “DBL” “Enter the
width:”
This example creates a field labeled “Enter the width:” for the wizardinput_geo. The value entered in this field is a double precisionfloating point number and is assigned to the variable width.
AddWizardHelp
Use: Adds a help button to the wizard with the specified help text. Whenspecifying the help text, use \n to indicate a carriage return.
Command: none
Syntax: addwizardhelp “wizard name” “help text”
Example: addwizardhelp “wizard1” “You must enter a value \ngreater than zero.”
This example creates a help button in the wizard wizard1 with thetext, “You must enter a value greater than zero.” The text takes uptwo lines, with the second line starting with “greater.”
LONGDOUBLE (or DBL)DOUBLE_LIST (or DLIST)STRING (or STR)STRING_LIST (or STRLIST, or LIST)POS2POS3VEC2VEC3
Wizard Script Commands 5-9
2dmacro.bk : wizardcs.fm 10 Fri Mar 29 13:58:14 2002
Wizard Arguments
AddWizardSelbox
Use: Adds a selection box to a wizard panel.Command: none
Syntax: addwizardselbox “wizard name” “field name” “fieldprompt” “initial text” WIDTH “onselect macro”
Note: WIDTH is 20 characters by default.onselect macro defaults to “‘’“.
AddWizardSelboxItems
Use: Adds items to an existing wizard selection box.Command: none
Syntax: addwizardselboxitems “wizard name” “field name” {itemlist} POSITION
Note: item list is a string list.POSITION defaults to a value of -1.
AddWizardText
Use: Adds text to the wizard. When specifying the text, use \n to indicate acarriage return or to cause an open space between controls.
Command: none
Syntax: addwizardtext “wizard name” “text”
Example: addwizardtext “wizard1” “Select one of the following:”
This example displays the text, “Select one of the following:” on thewizard1 wizard.
5-10 Wizard Script Commands
2dmacro.bk : wizardcs.fm 11 Fri Mar 29 13:58:14 2002
Wizard Arguments
AddWizardValidatorExpr
Use: Evaluates the specified expression when OK is chosen from the wizardpanel. This allows you to use a mathematical expression to test the valuesentered in the wizard’s fields. The expression may use variables definedby the wizard fields or buttons. Use the mathematical functions listed atthe beginning of this chapter for the expression. If the expression is valid,the wizard continues running. If the expression is invalid, an errormessage appears, and the wizard remains displayed. An invalid state isindicated when the expression evaluates to zero.
Command: none
Syntax: addwizardvalidatorexpr “Wizard name” “Validator ID”“Expression”
Example: addwizardvalidatorexpr “wizard1” “val1” “log (y)/2” ==0.5
This evaluates the expression (log y)/2 = 0.5. If the expression is valid(y = 10), the wizard panel disappears and the macro continuesrunning. If the expression is invalid (y does not equal 10), an errormessage appears and the wizard remains displayed.
CreateWizard
Use: Creates a new wizard with the name you specify. This name is used bythe system to identify the wizard.
Command: none
Syntax: createwizard “wizard name”
DeleteWizardValidatorExpr
Use: Deletes the validator expression created with the AddWizard-ValidatorExpr command from the wizard definition.
Command: none
Syntax: deletewizardvalidatorexpr “wizard name” “validator ID”
☞Note: If the variable y is not defined, the expression cannot be evaluated and will
always display an error message.
Wizard Script Commands 5-11
2dmacro.bk : wizardcs.fm 12 Fri Mar 29 13:58:14 2002
Wizard Arguments
DestroyWizard
Use: Removes the wizard’s definition from memory. A running wizard mustfirst be stopped. A wizard still runs while its panel is displayed andduring the time between when the user chooses OK to start the wizardand the StopWizard command is executed.
Command: none
Syntax: destroywizard “wizard name”
ExecWizard
Use: Executes the RunWizard, FileExec, and StopWizard commands. Themacro file can make use of any defined variable, which remain defineduntil the macro file completes its execution.
Command: none
Syntax: execwizard “wizard name” “macro name”
GetWizardRunResult
Use: Returns the result of the most recent RunWizard command for thespecified wizard.
Command: none
Syntax: getwizardrunresult “wizard name”
GetWizardSelboxIndex
Use: Returns the selection index from a wizard selection box.Command: none
Syntax: getwizardselboxindex “wizard name” “variable name”
Example: getwizardwelboxindex “modelcolor” “red”
In this example, the software returns the index number assigned tored in the modelcolor wizard. The index value is set using theSetWizardSelboxIndex command.
GetWizardSelboxText
Use: Returns the text label from a wizard selection box.Command: none
Syntax: getwizardselboxtext “wizard name” “field name”
5-12 Wizard Script Commands
2dmacro.bk : wizardcs.fm 13 Fri Mar 29 13:58:14 2002
Wizard Arguments
IsWizardControlChecked
Use: Checks the status of the variables that identify a button defined by thewizard. This command returns a value of 0 if the variable is anythingother than a radio button or checkbox. For a radio button or checkbox, itreturns a 1 if selected, and a 0 if deselected. This command works onlywhen a wizard panel is displayed.
Command: none
Syntax: iswizardcontrolchecked “wizard name” “variable name”
RunWizard
Use: Starts the wizard window using the interface features defined for thespecified wizard, and sets the initial state of the buttons or fields in thewizard. The script commands that create the interface features and thewizard must precede this command.
Command: none
Syntax: runwizard “wizard name” {“variable:state”}“optional initalizer command”
Note: variable is the variable of the state initializer.state lists the state initializers. Use check, disable, or hide as the state.
Example: assign status runwizard “setup1” {“num_passes:disable”“n_modes:disable”} “setwizardcontrolstate” “wizard1”“box” 0 1 0
This executes the setup1 wizard and initially disables the fields orbuttons associated with the num_passes and n_modes variables. Italso invokes the SetWizardControlState command, which disables thebutton identified by the variable in the wizard named wizard1command upon initialization. The variable status indicates whetherthe user chose OK or Cancel.
☞Note: The wizard is still considered to be running after the user chooses OK from
the window displayed by the wizard. The return value from the wizardindicates whether the user has selected OK (return value = 1) or Cancel(return value =0).
Once OK is chosen, the wizard variables are automatically assigned. Ifvariables are currently defined that match variables the wizard is trying tocreate, the macro stops with an error.
You do not need to use StopWizard when Cancel is chosen.
Wizard Script Commands 5-13
2dmacro.bk : wizardcs.fm 14 Fri Mar 29 13:58:14 2002
Wizard Arguments
SetWizardControlState
Use: Changes the state of a button. For example, you can make a buttondisabled or enabled, visible or invisible, or (for checkboxes and radiobuttons) selected or deselected. This command can only be used when thewizard’s interface is displayed. Because of this, it can only be used as acommand action in the AddWizardButtons command or in a RunWizardinitializer.
Command: none
Syntax: setwizardcontrolstate “wizard name” “variable name”ENABLED VISIBLE CHECKED
Note: ENABLED options are 0 (disabled), or 1 (enabled).VISIBLE options are 0 (invisible), or 1 (visible).CHECKED options are 0 (unchecked), or 1 (checked).
Example: setwizardcontrolstate “wizard1” “box” 0 1 0
This disables the button identified by the variable name box in thewizard1 wizard. The variable name must match the variable name ofa button or field created with the AddWizardButtons orAddWizardField commands.
SetWizardControlText
Use: Changes the text of a button. This command can only be used when thewizard’s interface is displayed. Because of this, it can only be used as acommand action in the AddWizardButtons command or in an aRunWizard initializer.
Command: none
Syntax: setwizardcontroltext “wizard name” “variable name”“text”
Example: addwizardbuttons "input_geo" "push" 20 {"variable1"}{"Box"} {"setwizardcontroltext ‘input_geo’ ‘variable1’‘Button Pressed’"} "horizontal"
This creates a horizontal push button labeled Box in the wizard’sinterface. When pressed, the button label changes to Button Pressed.This example is only meant as a demonstration of the command.
5-14 Wizard Script Commands
2dmacro.bk : wizardcs.fm 15 Fri Mar 29 13:58:14 2002
Wizard Arguments
SetWizardFieldChoices
Use: Sets the acceptable values that a user may enter in a field. These values donot appear in the interface. You can use the SetWizardFieldDefaultcommand to visually indicate the acceptable values for a field. If the userenters a value that is not specified by SetWizardFieldChoices, an errormessage appears.
Command: none
Syntax: setwizardfieldchoices “wizard name” “variable name”{“Choice1” “Choice2” ... }
Example: setwizardfieldchoices “input_geo” “x_size” {“10” “20”“30”}
In the input_geo wizard, this defines the acceptable values for thefield assigned the variable x_size as 10, 20, and 30
SetWizardFieldDefault
Use: Initializes the value for a specified field. The default value appears in theedit box in the wizard panel.
Command: none
Syntax: setwizardfielddefault “wizard name” “variable name”“command expression”
Note: command expression can be a value or any single script command.The results of the script command are displayed as the initial value forthe field.
Example: setwizardfielddefault “input_geo” “width” “(sub temp110)”
In the input_geo wizard, this sets the default value for the fieldidentified by the variable width to the results in a value of temp1-10.
SetWizardFieldPrompt
Use: Changes the runtime prompt text for edit controls in a wizard panel.Command: none
Syntax: setwizardfieldprompt “wizard name” “field name”“prompt”
Example: setwizardfieldprompt “inputcur” “current” “enter thecurrent value.”
This prompts the user to enter the current value in the current fieldname for the wizard named inputcur.
Wizard Script Commands 5-15
2dmacro.bk : wizardcs.fm 16 Fri Mar 29 13:58:14 2002
Wizard Arguments
SetWizardFieldRange
Use: Sets the acceptable range of values that a user may enter in a field. Thesevalues do not appear in the interface. You can use the SetWizardField-Default command to visually indicate the acceptable values for a field. Ifthe user enters a value that is not in the range specified bySetWizardFieldRange, an error message appears.
Command: none
Syntax: setwizardfieldrange “wizard name” “variable name”MIN_VALUE MAX_VALUE
Example: setwizardfieldrange “input_geo” “x_size” 10 50
In the input_geo wizard this defines an acceptable range of valuesbetween 10 and 50 for the field assigned the variable x_size .
SetWizardSelboxIndex
Use: Defines the selection by index for a wizard selection box.Command: none
Syntax: setwizardselboxindex “wizard name” “variable name”ITEM_INDEX
Note: ITEM_INDEX starts at 0, and corresponds to an item in the selection box.Example: setwizardselboxindex “modelcolor” “red” 2
This example assigns an index number of 2 to correspond to red in theselection box for the modelcolor wizard.
SetWizardTitle
Use: Sets the title of the window that appears when the wizard is invoked.Command: none
Syntax: setwizardtitle “wizard name” “title”
StopWizard
Use: Deletes the variables created by the wizard. It does not delete the wizarddefinition, based on the commands that created the wizard, so you canuse RunWizard again after using this command.
Command: none
Syntax: stopwizard “wizard name”
5-16 Wizard Script Commands
2dmacro.bk : 2dmacroIX.doc 1 Fri Mar 29 13:58:14 2002
Index
- (Subtract) 4-17
Symbols* (Multiply) 4-17+ (Add) 4-17/ (Divide) 4-17
Numerics1/ 4-17
AAbortTimeout 3-5Abs 4-17ActivateView nn 3-5Add 2-2ADD expression 1-10AddFaceAtPos 4-17AddHelpSelBoxItem 5-5AddMenuItem 5-5AddMenuSeparator 5-6AddObjectToList 4-18AddWizardSelbox 5-10AddWizardSelboxItems 5-10AND 2-2
AnimationAddFrame 4-18AnimationDeleteFrame 4-18AnimationMoveFrame 4-19AnimationPlay 4-19AnimationPlot 4-19AnimationSaveFrames 4-19AnimationSavePlot 4-20AnimationSetDeltaVal 4-20AnimationSetPlayTime 4-20AnimationSetRefinement 4-20AnimationSetStartVal 4-21AnimationSetStopVal 4-21AnimationSetStoreFrame 4-21AnimationSetVarName 4-21AnimationShowFrame 4-21Ansoft Macro Editor 1-11AppendSolutions 4-21ArcCreate 4-22ArrowPlotOptions 4-2Assign 2-2AtPhase 4-22AutoGrid 3-17
BBHPlot 4-22Boundary module Command Set
DefineBndFuncs 5-8, 5-9, 5-10, 5-11, 5-12, 5-
Index-1
2dmacro.bk : 2dmacroIX.doc 2 Fri Mar 29 13:58:14 2002
13, 5-14, 5-15, 5-16BoundaryKernel Command Set
PlotModifyFunction 4-37BuildPlotInfo 4-22
CCacsadeAll 4-2CalcVisToggle 4-2CancelPline 4-4CascadeAll 3-2CascadeProjects 3-2, 4-2CascadeViews 3-2, 4-2CheckOverlap 3-5CHelp 4-2Clear 4-22ClearAll 2-3ClearFunctions 2-3ClearVars 2-3CloseProject 4-3CloseWindow 3-2, 4-3CmplxI 4-23CmplxMag 4-23CmplxR 4-23command sets 1-4ComplexFormat 2-3Component 2-3ComponentCount 2-4conditionals 1-9
EQ 1-9GE 1-9GT 1-9LE 1-9LT 1-9NE 1-9
Conj 4-23CreateAnimation 4-23CreateBHPlot 4-23CreatePlot 4-23Cross 4-24Curl 4-24
DD/Dx 4-24D/Dy 4-24D/Dz 4-24DatabaseAddRow 2-4DatabaseGetColumns 2-4DatabaseGetField 2-5DatabaseGetRows 2-5DatabaseSetField 2-5DebugFileExec 5-6Default Command Set
Add 2-2AND 2-2Assign 2-2ClearAll 2-3ClearFunctions 2-3ClearVars 2-3ComplexFormat 2-3Component 2-3ComponentCount 2-4DatabaseAddRow 2-4DatabaseGetColumns 2-4DatabaseGetField 2-5DatabaseGetRows 2-5DatabaseSetField 2-5DeleteDatabase 2-6Div 2-6DoubleListSetComponent 2-6DumpDatabase 2-6Echo 2-6Error 2-7ExecPgmAndWait 2-8ExportDatabase 2-8FileExec 2-8FileExecErrExitIf 2-9FileExecPause 2-9FileExists 2-9FileOpen 2-9FileRead 2-10FileReadLine 2-12FileRecord 2-12FileRecordAppend 2-12
Index-2
2dmacro.bk : 2dmacroIX.doc 3 Fri Mar 29 13:58:14 2002
FileRecStop 2-12FileWrite 2-13FuncDef 2-13FuncHelp 2-13FuncSave 2-14FuncUndef 2-14GE 2-14GetDateAndTime 2-14GetFileList 2-14GetFileName 2-15GetMacroPath 2-15GetMacroPathList 2-15GetProductId 2-15GetUserOption 2-15GetVersion 2-15Global 2-16GlobalAssign 2-16GT 2-16Help 2-16ImportDatabase 2-16ImportRawDatabase 2-17IsCommandEnabled 2-17IsDirectory 2-17LE 2-17Log10 2-17LT 2-18Minus 2-18Mul 2-18NE 2-18NewDatabase 2-18OR 2-19ParametricFileExec 2-19Pos2 2-20Pos3 2-20Pos3Dist 2-20PrependMacroPath 2-20PrintHelp 2-20PrivateAssign 2-20ProtectedAssign 2-21RandomFraction 2-21RemoveMacroPath 2-21SetEchoEnabled 2-21SetMacroPathList 2-21SetRecordingEnabled 2-21
Sleep 2-22StrConcat 2-22String 2-23StringListSetComponent 2-23Strlen 2-23Strstr 2-23Sub 2-23Substring 2-24Unassign 2-24Vec2 2-24Vec3 2-24XOR 2-24
DefineBndFuncs 5-8, 5-9, 5-10, 5-11, 5-12, 5-13,5-14, 5-15, 5-16
DefineCutPlane 4-24DefineFacesList 4-24DefineFunction 4-25DefineObjectList 4-25DefinePoint 4-25DeleteCS 3-5DeleteDatabase 2-6DeleteGeometry 4-3DeleteHelpSelboxItem 5-6DeleteLine 4-25DeleteMenuItem 5-6DeletePlot 4-3, 4-25DeletePoint 4-25DeleteSurface 4-25DeleteVolume 4-26DeltaModifyPoint 4-26DeSelect 3-5DisableMenuItem 5-7DisablePlineStitch 4-3DispShaded 3-6DispWire 3-6Div 2-6DIV expression 1-10Divg 4-26Domain 4-26Dot 4-26DoubleListSetComponent 2-6Draw 4-26DrawLine 4-27DrawSurface 4-27
Index-3
2dmacro.bk : 2dmacroIX.doc 4 Fri Mar 29 13:58:14 2002
DrawVolume 4-27DumpDatabase 2-6
EEcho 2-6EditFunctions 4-3EditOrientations 3-6EditPline 4-3EditPline - AddVert 4-4EditPline - AddVert3D 4-4EditPline - Arc 4-4EditPline - Closepline 4-4EditPline - DelEdge 4-4EditPline - DelVert 4-5EditPline - EdgeGeom 4-5EditPline - EdgeMode 4-5EditPline - EndPline 4-5EditPline - EndTangent 4-5EditPline - FindPlineVertNo 4-6EditPline - GetPlineVert 4-6EditPline - Insvert 4-6EditPline - JoinSplines 4-6EditPline - MoveArcMidPt 4-6EditPline - MoveVert 4-7EditPline - OpenPline 4-7EditPline - RenameCurPline 4-7EditPline - SetArcAngle 4-7EditPline - SetArcRadius 4-7EditPline - SetArcToFillet 4-7EditPline - SplitSpline 4-8EditPline - StartTangent 4-8EnablePlineStitch 4-8Enter 4-27EnterComplex 4-27EnterComplexVector 4-27EnterFrequency 4-28EnterLine 4-28EnterPoint 4-28EnterScalar 4-28EnterScalarFunction 4-28EnterSurface 4-28EnterVector 4-28EnterVectorFunction 4-29
EnterVolume 4-29EQ conditional 1-9Error 2-7Evaluate 4-29Exchange 4-29ExecPgmAndWait 2-8executing a macro 1-3Exit 4-8ExportAnimation 4-29ExportDatabase 2-8ExportToFile 4-30ExportToVolumeGrid 4-30expressions
ADD 1-10DIV 1-10MINUS 1-10MUL 1-10SUB 1-10
FFieldCalculator Command Set
- (Subtract) 4-17* (Multiply) 4-17+ (Add) 4-17/ (Divide) 4-171/ 4-17Abs 4-17AddFaceAtPos 4-17AddObjectToList 4-18AnimationAddFrame 4-18AnimationDeleteFrame 4-18AnimationMoveFrame 4-19AnimationPlay 4-19AnimationPlot 4-19AnimationSaveFrames 4-19AnimationSavePlot 4-20AnimationSetDeltaVal 4-20AnimationSetPlayTime 4-20AnimationSetRefinement 4-20AnimationSetStartVal 4-21AnimationSetStopVal 4-21AnimationSetStoreFrame 4-21AnimationSetVarName 4-21
Index-4
2dmacro.bk : 2dmacroIX.doc 5 Fri Mar 29 13:58:14 2002
AnimationShowFrame 4-21AppendSolutions 4-21ArcCreate 4-22AtPhase 4-22BHPlot 4-22BuildPlotInfo 4-22Clear 4-22CmplxI 4-23CmplxMag 4-23CmplxR 4-23Conj 4-23CreateAnimation 4-23CreateBHPlot 4-23CreatePlot 4-23Cross 4-24Curl 4-24D/Dx 4-24D/Dy 4-24D/Dz 4-24DefineCutPlane 4-24DefineFacesList 4-24DefineFunction 4-25DefineObjectList 4-25DefinePoint 4-25DeleteLine 4-25DeletePlot 4-25DeletePoint 4-25DeleteSurface 4-25DeleteVolume 4-26DeltaModifyPoint 4-26Divg 4-26Domain 4-26Dot 4-26Draw 4-26DrawLine 4-27DrawSurface 4-27DrawVolume 4-27Enter 4-27EnterComplex 4-27EnterComplexVector 4-27EnterFrequency 4-28EnterLine 4-28EnterPoint 4-28EnterScalar 4-28
EnterScalarFunction 4-28EnterSurface 4-28EnterVector 4-28EnterVectorFunction 4-29EnterVolume 4-29Evaluate 4-29Exchange 4-29ExportAnimation 4-29ExportToFile 4-30ExportToVolumeGrid 4-30FunctionValue 4-30GetTopEntryValue 4-30Grad 4-30Imag 4-30Integrate 4-31IsoSurface 4-31LineCreate 4-31LineModify 4-31LinePlot 4-31LinePlot2D 4-32LineRecalculate 4-33Ln 4-33Load2DPlot 4-33LoadPlot 4-33LockCutPlaneNormal 4-33LockCutPlaneOrigin 4-33LockVolume 4-33Log 4-34Mag 4-34Material 4-34MathFunc 4-34Maximum 4-35MaxPos 4-35Minimum 4-35MinPos 4-35ModelMax 4-35ModelMin 4-35ModifyPlot 4-36ModifyPoint 4-36Neg 4-36Normal 4-36NormalComponent 4-36ObjectListCreate 4-36ObjectListModify 4-36
Index-5
2dmacro.bk : 2dmacroIX.doc 6 Fri Mar 29 13:58:14 2002
OrphanPlots 4-37Phase 4-37Plot 4-37PlotMesh 4-37PointCreate 4-37PointModify 4-37PointValuePlot 4-38Pop 4-38Postprocessoroptions 4-38Pow 4-38ProjDir 4-38ProjName 4-38Push 4-38ReadSolutions 4-39Real 4-39RectBoxCreate 4-39RemoveFaceAtPos 4-39RemoveObjectFromList 4-39RenameEntry 4-40RenameLine 4-40RenamePlot 4-40RenamePoint 4-40RenameSurface 4-40RenameVolume 4-40RollDn 4-40RollUp 4-40RZ_Integral 4-41Save2DPlot 4-41SavePlot 4-41Scalar_PHI 4-41Scalar_Z 4-42ScalarR 4-42ScalarX 4-41ScalarY 4-41ScalarZ 4-41SetArrow 4-42SetColormap 4-42SetFilled 4-43SetGridSpacing 4-43SetHiddenLine 4-43SetLine 4-44SetMarker 4-44SetMeshExternal 4-45SetMeshScale 4-45
SetNumPoints 4-45SetPlotAttributes 4-45SetRefinement 4-45SetScale 4-46SetTextMarker 4-46SetTransparency 4-46ShowColorKey 4-46Smooth 4-46SolutionName 4-46Sqrt 4-47StoreComputations 4-47SurfacePlot 4-47Tangent 4-47TangentComponent 4-47Top 4-47Undo 4-47UpdatePlots 4-48Value 4-48Vec_PHI 4-48Vec_R 4-48Vec_Z 4-48VecX 4-48VecY 4-48VecZ 4-48VolumePlot 4-49WriteSolutions 4-49
FileExec 2-8FileExecErrExitIf 2-9FileExecPause 2-9FileExists 2-9FileOpen 2-9FileRead 2-10FileReadLine 2-12FileRecord 2-12FileRecordAppend 2-12FileRecStop 2-12FileWrite 2-13FitAll 3-17FitAllViews 3-17FitSel 3-17FormatPlotAxes 4-8FormatPlotGraphs 4-8FuncDef 2-13FuncHelp 2-13
Index-6
2dmacro.bk : 2dmacroIX.doc 7 Fri Mar 29 13:58:14 2002
FuncSave 2-14FunctionValue 4-30FuncUndef 2-14
GGE 2-14GE conditional 1-9GeneralPlotOptions 4-9Generic Module Command Set
CascadeAll 3-2CascadeProjects 3-2CascadeViews 3-2CloseWindow 3-2ModuleIsPromptVisible 3-2ModuleSidewinLeft 3-2ModuleSidewinRight 3-2ModuleToggleMessage 3-3ModuleTogglePrompt 3-3ModuleToolbar(direction) 3-3ModuleToolbarHide 3-3NewWindow 3-3PrintEntire 3-3PrintProj 3-3PrintRect 3-3PrintSubwin 3-4PrintView 3-4TileAllGrid 3-4TileProjectsGrid 3-4TileViewsGrid 3-4TileViewsHrz 3-4TileViewsVrt 3-4
GetCurPos 3-6GetDateAndTime 2-14GetDouble 3-6GetFileList 2-14GetFileName 2-15GetLong 3-7GetMacroPath 2-15GetMacroPathList 2-15GetNumObjects 3-7GetNumVIews 3-7GetObjectName 3-7GetOrigin 3-7
GetPosition 3-8GetProductId 2-15GetString 3-8GetTopEntryValue 4-30GetUnitConv 3-8GetUnitName 3-8GetUserOption 2-15GetVector 3-9GetVersion 2-15GetWizardRunResult 5-12GetWizardSelboxIndex 5-12Global 2-16GlobalAssign 2-16GlobalCS 3-9Grad 4-30Graph3dSetColor 4-13Graph3dSetFilled 4-13Graph3dSetLine 4-13Graph3dSetOutline 4-13Graph3dSetRefinement 4-13Graph3dSetShade 4-14Graph3dSetToneShaded 4-14Graph3dUpdateGraph 4-14GT 2-16GT conditional 1-9
HHelp 2-16Hide 3-9HideOrient 3-9HideRegion 3-9HideSel 3-9
IIF statement 1-7Imag 4-30ImportDatabase 2-16ImportRawDatabase 2-17Installing Maxwell software ivIntegrate 4-31IsCommandEnabled 2-17IsDirectory 2-17
Index-7
2dmacro.bk : 2dmacroIX.doc 8 Fri Mar 29 13:58:14 2002
IsoSurface 4-31IsWizardControlChecked 5-12
LLE 2-17LE conditional 1-9LineCreate 4-31LineModify 4-31LinePlot 4-31LinePlot2D 4-32LinePlotOptions 4-9LineRecalculate 4-33List 3-10ListPlotsProject 4-9ListPlotsView 4-9Ln 4-33Load2DPlot 4-33LoadCartesian3DPlot 4-10LoadPlot 4-33LocalCS 3-10LockCutPlaneNormal 4-33LockCutPlaneOrigin 4-33LockVolume 4-33Log 4-34Log10 2-17Lookat 3-17Lorigin 3-10LT 2-18LT conditional 1-9
Mmacro editor
defining macros 1-11tool bar 1-12
macro editor commands 1-12MacroDebugger 5-7macros 1-2
command prompt hotkey 1-2executing a macro 1-3executing from the command line 1-3executing from the command prompt 1-3executing with a hotkey 1-3
recording a macro 1-2Mag 4-34MarkerPlotOptions 4-10Material 4-34MathFunc 4-34Maximum 4-35MaxPos 4-35Maxwell 3D, installing ivMinimum 4-35MinPos 4-35Minus 2-18MINUS expression 1-10Mod3proj Command Set
AbortTimeout 3-5ActivateView nn 3-5CheckOverlap 3-5DeleteCS 3-5DeSelect 3-5DispShaded 3-6DispWire 3-6EditOrientations 3-6GetCurPos 3-6GetDouble 3-6GetLong 3-7GetNumObjects 3-7GetNumVIews 3-7GetObjectName 3-7GetOrigin 3-7GetPosition 3-8GetString 3-8GetUnitConv 3-8GetUnitName 3-8GetVector 3-9GlobalCS 3-9Hide 3-9HideOrient 3-9HideRegion 3-9HideSel 3-9List 3-10LocalCS 3-10Lorigin 3-10ObjectCS 3-10ObjectExists 3-10Origin 3-11
Index-8
2dmacro.bk : 2dmacroIX.doc 9 Fri Mar 29 13:58:14 2002
Origin? 3-11PrintProj 3-11PrintView 3-11Recolor 3-11RestoreCS 3-11RotateCS 3-12RotatedCS 3-12SaveCmdWin 3-12SaveCS 3-12SaveWindow 3-13Select 3-13SelInBox 3-13SetCurPos 3-14SetObjectCS 3-14Show 3-14ShowAll 3-14ShowOrient 3-14ShowRegion 3-14ToggleRegion 3-15UnrotatedCS 3-15VerifyRegion 3-15VisByItem 3-15XAxisAboutTo 3-15XAxisTo 3-15XUnitVec? 3-16YAxisAboutTo 3-16YAxisTo 3-16YUnitVec? 3-16ZAxisAboutTo 3-16ZAxisTo 3-16ZUnitVec? 3-16
Mod3view Command SetAutoGrid 3-17FitAll 3-17FitAllViews 3-17FitSel 3-17Lookat 3-17Ortho 3-17Persp 3-18PolarGrid 3-18RectGrid 3-18ResetViews 3-18RotView 3-18Shaded 3-19
Viewpoint 3-19Wireframe 3-19
ModelMax 4-35ModelMin 4-35ModifyPlot 4-10, 4-36ModifyPoint 4-36ModifyVariables 4-11ModuleIsPromptVisible 3-2ModuleSidewinLeft 3-2ModuleSidewinRight 3-2ModuleToggleMessage 3-3ModuleTogglePrompt 3-3ModuleToolbar(direction) 3-3ModuleToolbarHide 3-3Mul 2-18MUL expression 1-10
NNE 2-18NE conditional 1-9Neg 4-36NewDatabase 2-18NewWindow 3-3, 4-11Normal 4-36NormalComponent 4-36
OObjectCS 3-10ObjectExists 3-10ObjectListCreate 4-36ObjectListModify 4-36OpenProject 4-11OR 2-19Origin 3-11Origin? 3-11OrphanPlots 4-37Ortho 3-17
PPanelPlotDelete 4-11PanelPlotVisibility 4-11
Index-9
2dmacro.bk : 2dmacroIX.doc 10 Fri Mar 29 13:58:14 2002
ParametricFileExec 2-19Persp 3-18Phase 4-37Plot 4-37Plot3D Command Set
Graph3dSetColor 4-13Graph3dSetFilled 4-13Graph3dSetLine 4-13Graph3dSetOutline 4-13Graph3dSetRefinement 4-13Graph3dSetShade 4-14Graph3dSetToneShaded 4-14Graph3dUpdateGraph 4-14Plot3dDrawAxes 4-14Plot3dDrawGrid 4-14Plot3dSetAxesLabelSize 4-14Plot3dSetColorMap 4-15Plot3dSetHeadExtrusion 4-15Plot3dSetHeading 4-15Plot3dSetHeadingColor 4-15Plot3dSetHeadingFont 4-15Plot3dSetHeadingSize 4-15Plot3dSetLighting 4-16Plot3dSetScale 4-16Plot3dShowColorKey 4-16Plot3dUpdatePlots 4-16
Plot3dDrawAxes 4-14Plot3dDrawGrid 4-14Plot3dSetAxesLabelSize 4-14Plot3dSetColorMap 4-15Plot3dSetHeadExtrusion 4-15Plot3dSetHeading 4-15Plot3dSetHeadingColor 4-15Plot3dSetHeadingFont 4-15Plot3dSetHeadingSize 4-15Plot3dSetLighting 4-16Plot3dSetScale 4-16Plot3dShowColorKey 4-16Plot3dUpdatePlots 4-16PlotMesh 4-37PlotModifyFunction 4-37PointCreate 4-37PointModify 4-37PointValuePlot 4-38
PolarGrid 3-18Pop 4-38Pos2 2-20Pos3 2-20Pos3Dist 2-20PostProcessor3D Command Set
ArrowPlotOptions 4-2CacsadeAll 4-2CalcVisToggle 4-2CancelPline 4-4CascadeProjects 4-2CascadeViews 4-2CHelp 4-2CloseProject 4-3CloseWindow 4-3DeleteGeometry 4-3DeletePlot 4-3DisablePlineStitch 4-3EditFunctions 4-3EditPline 4-3EditPline - AddVert 4-4EditPline - AddVert3D 4-4EditPline - Arc 4-4EditPline - Closepline 4-4EditPline - DelEdge 4-4EditPline - DelVert 4-5EditPline - EdgeGeom 4-5EditPline - EdgeMode 4-5EditPline - EndPline 4-5EditPline - EndTangent 4-5EditPline - FindPlineVertNo 4-6EditPline - GetPlineVert 4-6EditPline - Insvert 4-6EditPline - JoinSplines 4-6EditPline - MoveArcMidPt 4-6EditPline - MoveVert 4-7EditPline - OpenPline 4-7EditPline - RenameCurPline 4-7EditPline - SetArcAngle 4-7EditPline - SetArcRadius 4-7EditPline - SetArcToFillet 4-7EditPline - SplitSpline 4-8EditPline - StartTangent 4-8EnablePlineStitch 4-8
Index-10
2dmacro.bk : 2dmacroIX.doc 11 Fri Mar 29 13:58:14 2002
Exit 4-8FormatPlotAxes 4-8FormatPlotGraphs 4-8GeneralPlotOptions 4-9LinePlotOptions 4-9ListPlotsProject 4-9ListPlotsView 4-9LoadCartesian3DPlot 4-10MarkerPlotOptions 4-10ModifyPlot 4-10ModifyVariables 4-11NewWindow 4-11OpenProject 4-11PanelPlotDelete 4-11PanelPlotVisibility 4-11PostProcessorOptions 4-11SaveDefinitions 4-11ShowCalc 4-12ShowPlotCoordinates 4-12ShowSolutionInfo 4-12TileAllGrid 4-12TilePlotVisibility 4-12TileProjectsGrid 4-12TileViewsGrid 4-12
PostProcessorOptions 4-11Postprocessoroptions 4-38Pow 4-38PrependMacroPath 2-20PrintEntire 3-3PrintHelp 2-20PrintProj 3-3, 3-11PrintRect 3-3PrintSubwin 3-4PrintView 3-4, 3-11PrivateAssign 2-20ProjDir 4-38ProjName 4-38ProtectedAssign 2-21Push 4-38
RRandomFraction 2-21ReadSolutions 4-39
Real 4-39Recolor 3-11recording a macro 1-2RectBoxCreate 4-39RectGrid 3-18RemoveFaceAtPos 4-39RemoveMacroPath 2-21RemoveObjectFromList 4-39RenameEntry 4-40RenameLine 4-40RenamePlot 4-40RenamePoint 4-40RenameSurface 4-40RenameVolume 4-40REPEAT statement 1-7ResetViews 3-18RestoreCS 3-11RollDn 4-40RollUp 4-40RotateCS 3-12RotatedCS 3-12RotView 3-18RZ_Integral 4-41
SSave2DPlot 4-41SaveCmdWin 3-12SaveCS 3-12SaveDefinitions 4-11SavePlot 4-41SaveWindow 3-13Scalar_PHI 4-41Scalar_Z 4-42ScalarR 4-42ScalarX 4-41ScalarY 4-41ScalarZ 4-41script commands 1-4
- (Subtract) 4-17* (Multiply) 4-17+ (Add) 4-17/ (Divide) 4-171/ 4-17
Index-11
2dmacro.bk : 2dmacroIX.doc 12 Fri Mar 29 13:58:14 2002
AbortTimeout 3-5Abs 4-17ActivateView nn 3-5AddFaceAtPos 4-17AddObjectToList 4-18AnimationAddFrame 4-18AnimationDeleteFrame 4-18AnimationMoveFrame 4-19AnimationPlay 4-19AnimationPlot 4-19AnimationSetDeltaVal 4-20AnimationSetStartVal 4-21AnimationSetStopVal 4-21AnimationSetVarName 4-21AnimationShowFrame 4-21AppendSolutions 4-21ArrowPlotOptions 4-2AtPhase 4-22AutoGrid 3-17BHPlot 4-22BuildPlotInfo 4-22CacsadeAll 4-2CalcVisToggle 4-2CancelPline 4-4CascadeAll 3-2CascadeProjects 3-2, 4-2CascadeViews 3-2, 4-2CheckOverlap 3-5CHelp 4-2Clear 4-22CloseProject 4-3CloseWindow 3-2CloseWindowt 4-3CmplxI 4-23CmplxMag 4-23CmplxR 4-23command sets 1-4Conj 4-23CreateAnimation 4-23CreateBHPlot 4-23CreatePlot 4-23Cross 4-24Curl 4-24D/Dx 4-24
D/Dy 4-24D/Dz 4-24DefineBndFuncs 5-8, 5-9, 5-10, 5-11, 5-12, 5-
13, 5-14, 5-15, 5-16DefineCutPlane 4-24DefineFacesList 4-24DefineFunction 4-25DefineObjectList 4-25DefinePoint 4-25DeleteCS 3-5DeleteGeometry 4-3DeleteLine 4-25DeletePlot 4-3, 4-25DeletePoint 4-25DeleteSurface 4-25DeleteVolume 4-26DeltaModifyPoint 4-26DeSelect 3-5DisablePlineStitch 4-3DispShaded 3-6DispWire 3-6Divg 4-26Domain 4-26Dot 4-26Draw 4-26DrawLine 4-27DrawSurface 4-27DrawVolume 4-27EditFunctions 4-3EditOrientations 3-6EditPline 4-3EditPline - AddVert 4-4EditPline - AddVert3D 4-4EditPline - Arc 4-4EditPline - Closepline 4-4EditPline - DelEdge 4-4EditPline - DelVert 4-5EditPline - EdgeGeom 4-5EditPline - EdgeMode 4-5EditPline - EndPline 4-5EditPline - EndTangent 4-5EditPline - FindPlineVertNo 4-6EditPline - GetPlineVert 4-6EditPline - Insvert 4-6
Index-12
2dmacro.bk : 2dmacroIX.doc 13 Fri Mar 29 13:58:14 2002
EditPline - JoinSplines 4-6EditPline - MoveArcMidPt 4-6EditPline - MoveVert 4-7EditPline - OpenPline 4-7EditPline - SetArcAngle 4-7EditPline - SetArcRadius 4-7EditPline - SetArcToFillet 4-7EditPline - SplitSpline 4-8EditPline - StartTangent 4-8EnablePlineStitch 4-8Enter 4-27EnterComplex 4-27EnterComplexVector 4-27EnterFrequency 4-28entering from the command prompt 1-5EnterLine 4-28EnterPoint 4-28EnterScalar 4-28EnterScalarFunction 4-28EnterSurface 4-28EnterVector 4-28EnterVectorFunction 4-29EnterVolume 4-29Evaluate 4-29Exchange 4-29Exit 4-8ExportAnimation 4-29ExportToFile 4-30ExportToVolumeGrid 4-30FitAll 3-17FitAllViews 3-17FitSel 3-17FormatPlotAxes 4-8FormatPlotGraphs 4-8FunctionValue 4-30GeneralPlotOptions 4-9GetCurPos 3-6GetDouble 3-6GetLong 3-7GetNumObjects 3-7GetNumVIews 3-7GetObjectName 3-7GetOrigin 3-7GetPosition 3-8
GetTopEntryValue 4-30GetVector 3-9GlobalCS 3-9Grad 4-30Graph3dSetColor 4-13Graph3dSetFilled 4-13Graph3dSetLine 4-13Graph3dSetRefinement 4-13Graph3dSetShade 4-14Graph3dUpdateGraph 4-14Hide 3-9HideOrient 3-9HideRegion 3-9HideSel 3-9Imag 4-30Integrate 4-31IsoSurface 4-31layout 1-6LineCreate 4-31LineModify 4-31LinePlot 4-31LinePlot2D 4-32LinePlotOptions 4-9LineRecalculate 4-33List 3-10ListPlotsProject 4-9ListPlotsView 4-9Load2DPlot 4-33LoadPlot 4-33LocalCS 3-10LockCutPlaneNormal 4-33LockCutPlaneOrigin 4-33LockVolume 4-33Lookat 3-17Lorigin 3-10Mag 4-34MarkerPlotOptions 4-10Material 4-34MathFunc 4-34Maximum 4-35MaxPos 4-35Minimum 4-35MinPos 4-35ModelMax 4-35
Index-13
2dmacro.bk : 2dmacroIX.doc 14 Fri Mar 29 13:58:14 2002
ModelMin 4-35ModifyPlot 4-10, 4-36ModifyPoint 4-36ModifyVariables 4-11ModuleIsPromptVisible 3-2ModuleSidewinLeft 3-2ModuleSidewinRight 3-2ModuleToggleMessage 3-3ModuleTogglePrompt 3-3ModuleToolbar(direction) 3-3ModuleToolbarHide 3-3Neg 4-36NewWindow 3-3, 4-11Normal 4-36NormalComponent 4-36ObjectCS 3-10ObjectExists 3-10ObjectListCreate 4-36ObjectListModify 4-36OpenProject 4-11Origin 3-11Origin? 3-11OrphanPlots 4-37Ortho 3-17PanelPlotDelete 4-11PanelPlotVisibility 4-11Persp 3-18Phase 4-37Plot 4-37Plot3dDrawAxes 4-14Plot3dDrawGrid 4-14Plot3dSetAxesLabelSize 4-14Plot3dSetColorMap 4-15Plot3dSetHeadExtrusion 4-15Plot3dSetHeading 4-15Plot3dSetHeadingColor 4-15Plot3dSetHeadingFont 4-15Plot3dSetHeadingSize 4-15Plot3dSetLighting 4-16Plot3dSetScale 4-16Plot3dShowColorKey 4-16Plot3dUpdatePlots 4-16PlotMesh 4-37PlotModifyFunction 4-37
PointCreate 4-37PointModify 4-37PointValuePlot 4-38PolarGrid 3-18Pop 4-38Postprocessoroptions 4-38Pow 4-38PrintEntire 3-3PrintProj 3-3, 3-11PrintRect 3-3PrintSubwin 3-4PrintView 3-4, 3-11ProjDir 4-38ProjName 4-38Push 4-38ReadSolutions 4-39Real 4-39Recolor 3-11RectBoxCreate 4-39RectGrid 3-18RemoveFaceAtPos 4-39RemoveObjectFromList 4-39RenameEntry 4-40RenameLine 4-40RenamePlot 4-40RenamePoint 4-40RenameSurface 4-40RenameVolume 4-40ResetViews 3-18RestoreCS 3-11RollDn 4-40RollUp 4-40RotateCS 3-12RotatedCS 3-12RotView 3-18RZ_Integral 4-41Save2DPlot 4-41SaveCmdWin 3-12SaveCS 3-12SaveDefinitions 4-11SavePlot 4-41SaveWindow 3-13Scala_rZ 4-42Scalar_PHI 4-41
Index-14
2dmacro.bk : 2dmacroIX.doc 15 Fri Mar 29 13:58:14 2002
ScalarR 4-42ScalarX 4-41ScalarY 4-41ScalarZ 4-41Select 3-13SelInBox 3-13SetArrow 4-42SetColormap 4-42SetCurPos 3-14SetFilled 4-43SetGridSpacing 4-43SetHiddenLine 4-43SetLine 4-44SetMarker 4-44SetMeshExternal 4-45SetMeshScale 4-45SetNumPoints 4-45SetObjectCS 3-14SetPlotAttributes 4-45SetRefinement 4-45SetScale 4-46SetTextMarker 4-46SetTransparency 4-46Shaded 3-19Show 3-14ShowAll 3-14ShowCalc 4-12ShowColorKey 4-46ShowOrient 3-14ShowPlotCoordinates 4-12ShowRegion 3-14ShowSolutionInfo 4-12Smooth 4-46SolutionName 4-46Sqrt 4-47StoreComputations 4-47SurfacePlot 4-47syntax conventions 1-6Tangent 4-47TangentComponent 4-47TileAllGrid 3-4, 4-12TilePlotVisibility 4-12TileProjectsGrid 3-4, 4-12TileViewsGrid 3-4, 4-12
TileViewsHrz 3-4TileViewsVrt 3-4ToggleRegion 3-15Top 4-47Undo 4-47UnrotatedCS 3-15UpdatePlots 4-48Value 4-48Vec_PHI 4-48Vec_R 4-48Vec_Z 4-48VecX 4-48VecY 4-48VecZ 4-48VerifyRegion 3-15Viewpoint 3-19VisByItem 3-15VolumePlot 4-49Wireframe 3-19WriteSolutions 4-49XAxisAboutTo 3-15XAxisTo 3-15XUnitVec? 3-16YAxisAboutTo 3-16YAxisTo 3-16YUnitVec? 3-16ZAxisAboutTo 3-16ZAxisTo 3-16ZUnitVec? 3-16
script control commands 1-7conditionals 1-9expressions 1-10IF 1-7REPEAT 1-7WHILE 1-8
Select 3-13SelInBox 3-13SetArrow 4-42SetColormap 4-42SetCurPos 3-14SetEchoEnabled 2-21SetFilled 4-43SetGridSpacing 4-43SetHiddenLine 4-43
Index-15
2dmacro.bk : 2dmacroIX.doc 16 Fri Mar 29 13:58:14 2002
SetLine 4-44SetMacroPathList 2-21SetMarker 4-44SetMenuItemHotkey 5-7SetMeshExternal 4-45SetMeshScale 4-45SetNumPoints 4-45SetObjectCS 3-14SetPlotAttributes 4-45SetRecordingEnabled 2-21SetRefinement 4-45SetScale 4-46SetTextMarker 4-46SetTransparency 4-46SetWizardFieldPrompt 5-15SetWizardSelboxIndex 5-16Shaded 3-19Show 3-14ShowAll 3-14ShowCalc 4-12ShowColorKey 4-46ShowOrient 3-14ShowPlotCoordinates 4-12ShowRegion 3-14ShowSolutionInfo 4-12Sleep 2-22Smooth 4-46SolutionName 4-46Sqrt 4-47StoreComputations 4-47StrConcat 2-22String 2-23StringListSetComponent 2-23Strlen 2-23Strstr 2-23Sub 2-23SUB expression 1-10Substring 2-24SurfacePlot 4-47
TTangent 4-47TangentComponent 4-47
TileAllGrid 3-4, 4-12TilePlotVisibility 4-12TileProjectsGrid 3-4, 4-12TileViewsGrid 3-4, 4-12TileViewsHrz 3-4TileViewsVrt 3-4ToggleRegion 3-15tool bar, about 1-12Top 4-47
UUnassign 2-24Undo 4-47UnrotatedCS 3-15UpdatePlots 4-48User menu additions
AddHelpSelboxItem 5-5AddMenuItem 5-5AddMenuSeparator 5-6DebugFileExec 5-6DeleteHelpSelboxItem 5-6DeleteMenuItem 5-6DisableMenuItem 5-7MacroDebugger 5-7SetMenuItemHotkey 5-7
VValue 4-48Vec_PHI 4-48Vec_R 4-48Vec_Z 4-48Vec2 2-24Vec3 2-24VecX 4-48VecY 4-48VecZ 4-48VerifyRegion 3-15Viewpoint 3-19VisByItem 3-15VolumePlot 4-49
Index-16
2dmacro.bk : 2dmacroIX.doc 17 Fri Mar 29 13:58:14 2002
WWHILE statement 1-8Wireframe 3-19Wizard Command Set
AddWizardSelbox 5-10AddWizardSelboxItems 5-10GetWizardRunResult 5-12GetWizardSelboxIndex 5-12IsWizardControlChecked 5-12SetWizardFieldPrompt 5-15SetWizardSelboxIndex 5-16
WriteSolutions 4-49
XXAxisAboutTo 3-15XAxisTo 3-15XOR 2-24XUnitVec? 3-16
YYAxisAboutTo 3-16YAxisTo 3-16YUnitVec? 3-16
ZZAxisAboutTo 3-16ZAxisTo 3-16ZUnitVec? 3-16
Index-17
2dmacro.bk : 2dmacroIX.doc 18 Fri Mar 29 13:58:14 2002
Index-18
top related