ANSYS Electronics Desktop : Scripting Guide

Transcription

ANSYS Electronics Desktop :Scripting GuideANSYS, Inc.SouthpointeJune 2015ANSYS Electromagnetics Suite 16.22600 ANSYS DriveCanonsburg, PA 15317ansysinfo@ansys.comhttp://www.ansys.com(T) 724-746-3304(F) 724-514-9494ANSYS, Inc. iscertified to ISO9001:2008.

Copyright and Trademark Information 2015 SAS IP, Inc. All rights reserved. Unauthorized use, distribution or duplication is prohibited.ANSYS, HFSS, HFSS-IE, and Optimetrics and any and all ANSYS, Inc. brand, product, service andfeature names, logos and slogans are registered trademarks or trademarks of ANSYS, Inc. or itssubsidiaries in the United States or other countries. All other brand, product, service and featurenames or trademarks are the property of their respective owners.Disclaimer NoticeTHIS ANSYS SOFTWARE PRODUCT AND PROGRAM DOCUMENTATION INCLUDE TRADE SECRETSAND ARE CONFIDENTIAL AND PROPRIETARY PRODUCTS OF ANSYS, INC., ITS SUBSIDIARIES, ORLICENSORS. The software products and documentation are furnished by ANSYS, Inc., itssubsidiaries, or affiliates under a software license agreement that contains provisions concerningnon-disclosure, copying, length and nature of use, compliance with exporting laws, warranties,disclaimers, limitations of liability, and remedies, and other provisions. The software products anddocumentation may be used, disclosed, transferred, or copied only in accordance with the termsand conditions of that software license agreement.ANSYS, Inc. is certified to ISO 9001:2008.U.S. Government RightsFor U.S. Government users, except as specifically granted by the ANSYS, Inc. software licenseagreement, the use, duplication, or disclosure by the United States Government is subject torestrictions stated in the ANSYS, Inc. software license agreement and FAR 12.212 (for non-DODlicenses).Third-Party SoftwareSee the legal information in the product help files for the complete Legal Notice for ANSYSproprietary software and third-party software. If you are unable to access the Legal Notice,please contact ANSYS, Inc.Published in the U.S.A.

Table of ContentsCopyright and Trademark Information . . . . . . . . . . . . . . . . 1-21. Introduction to VBScriptA Sample HFSS Script . . . . . . . . . . . . . . . . . . . . . . . . . . . .A Sample Designer Script . . . . . . . . . . . . . . . . . . . . . . . . .A Sample Q3D Extractor Script . . . . . . . . . . . . . . . . . . . . .Simple and Composite Names . . . . . . . . . . . . . . . . . . . . .VBScript Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-31-41-71-91-10Declaring Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Variable Naming Conventions . . . . . . . . . . . . . . . . . . . . . .Scope and Lifetime of Variables . . . . . . . . . . . . . . . . . . . .Array Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-101-101-101-11VBScript Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12Operator Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . .Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . .Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1-121-121-131-13Controlling Program Execution . . . . . . . . . . . . . . . . . . . . . 1-13Using If.Then.Else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13Using Select Case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14Looping Through Code . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-14Contents-1ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics DesktopUsing a For.Next Loop . . . . . . . . . . . . . . . . . . . . . . . . . . .Using a Do Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Repeating Statements While a Condition is True . . . . . . .Repeating a Statement Until a Condition Becomes True .1-141-151-151-15VBScript Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15Function Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15Sub Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-15Converting Between Data Types . . . . . . . . . . . . . . . . . . . .Including Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Aborting Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Interacting with a Script . . . . . . . . . . . . . . . . . . . . . . . . . . .Recommended VBScript References . . . . . . . . . . . . . . . .1-161-161-161-171-172. ANSYS Electronics Desktop and VBScriptOverview of ANSYS Electronics Desktop Script VariablesRecording a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Stopping Script Recording . . . . . . . . . . . . . . . . . . . . . . . . .Running a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Pausing and Resuming a Script . . . . . . . . . . . . . . . . . . . .Stopping a Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Modifying a Script for Easier Playback . . . . . . . . . . . . . . .ANSYS Electronics Desktop Scripting Conventions . . . . .Syntax Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Script Command Conventions . . . . . . . . . . . . . . . . . . . . .Named Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Setting Numerical Values . . . . . . . . . . . . . . . . . . . . . . . . .ANSYS Electronics Desktop Layout Scripts and theActive Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Scripts and Locked Layers . . . . . . . . . . . . . . . . . . . . . . . .Event Callback Scripting . . . . . . . . . . . . . . . . . . . . . . . . . -14Executing a Script from Within a Script . . . . . . . . . . . . . . . 2-15Editing Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16Contents-2ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics Desktop3. Ansoft Application Object Script CommandsGetAppDesktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2GetDesiredRamMBLimit(deprecated) . . . . . . . . . . . . . . . 3-2GetHPCLicenseType(deprecated) . . . . . . . . . . . . . . . . . . 3-2GetMaximumRamMBLimit (deprecated) . . . . . . . . . . . . . 3-2GetMPISpawnCmd(deprecated) . . . . . . . . . . . . . . . . . . . 3-2GetMPIVendor(deprecated) . . . . . . . . . . . . . . . . . . . . . . . 3-2GetNumberOfProcessors(deprecated) . . . . . . . . . . . . . . 3-2GetUseHPCForMP(deprecated) . . . . . . . . . . . . . . . . . . . 3-2SetDesiredRamMBLimit(deprecated) . . . . . . . . . . . . . . . 3-2SetHPCLicenseType(deprecated) . . . . . . . . . . . . . . . . . . 3-2SetMaximumRamMBLimit (deprecated) . . . . . . . . . . . . . 3-2SetMPISpawnCmd (deprecated) . . . . . . . . . . . . . . . . . . . 3-2SetMPIVendor (deprecated) . . . . . . . . . . . . . . . . . . . . . . 3-2SetNumberOfProcessors (deprecated) . . . . . . . . . . . . . . 3-2SetUseHPCForMP (deprecated) . . . . . . . . . . . . . . . . . . . 3-24. Desktop Object Script CommandsClear Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3CloseAllWindows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3CloseProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4CloseProjectNoForce . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5EnableAutoSave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6GetActiveProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7GetAutoSaveEnabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-8GetDesigns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-9GetDistributedAnalysisMachines . . . . . . . . . . . . . . . . . . . 4-10GetName [Desktop] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10GetLibraryDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-12GetMessages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-13GetPersonalLibDirectory . . . . . . . . . . . . . . . . . . . . . . . . . 4-15GetProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16Contents-3ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics DesktopGetProjectDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17GetProjectList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17GetSysLibDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-18GetTempDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19GetUserLibDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-20GetVersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21ImportANF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-21ImportAutoCAD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-22ImportGDSII . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-23ImportODB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24NewProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-24OpenAndConvertProject . . . . . . . . . . . . . . . . . . . . . . . . . 4-25OpenMultipleProjects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-25OpenProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-26PauseScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-27Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28QuitApplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-28RestoreWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-29RunProgram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30RunScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-30SetActiveProject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-31SetActiveProjectByPath . . . . . . . . . . . . . . . . . . . . . . . . . . 4-32SetLibraryDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33SetProjectDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33SetTempDirectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-33Sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-34Desktop Commands For Registry Values . . . . . . . . . . . . . 4-35DoesRegistryValueExist . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35GetRegistryInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-35GetRegistryString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36SetRegistryFromFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36SetRegistryInt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-36SetRegistryString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-37Contents-4ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics Desktop5. Project Object Script CommandsClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2CopyDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2CutDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3DeleteDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3GetActiveDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3GetDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3GetName [Project] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4GetPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4GetTopDesignList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-4InsertDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-5Paste [Design] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-6Redo [Project Level] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-7Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8SaveAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-8SetActiveDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10SimulateAll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-10Undo [Project] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-116. Material Script CommandsAddMaterial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2CloneMaterial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4DoesMaterialExist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4EditMaterial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6ExportMaterial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6RemoveMaterial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-67. Property Script CommandsCallback Scripting Using PropHost Object . . . . . . . . . . . 7-4ChangeProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-8PropHost Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22Abort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22AddMenuProp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22AddMenuProp2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-22Contents-5ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics DesktopAddProp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23AddProp2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23ExecuteScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-23GetApplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24GetCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24GetChangedProperty . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24GetDescription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-24GetDesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25GetEditor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25GetEvaluatedText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-25GetFileName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26GetHidden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26GetProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26GetPropHost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-26GetPropServers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-27GetPropTabType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-27GetReadOnly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-27GetRunStatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28GetProgress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28GetTabTypeName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28GetText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28GetValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-28IsValueConstant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-29PropertyExists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-29RemoveProp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-29SetCallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30SetDescription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30SetHidden . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30SetReadOnly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-30SetText . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31SetValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31Additional Property Scripting Commands . . . . . . . . . . . . . 7-31GetProperties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-31Contents-6ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics DesktopGetPropertyValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32GetArrayVariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-32GetVariables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-33GetVariableValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-33SetPropertyValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-33SetVariableValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-34Additional Property Scripting Example . . . . . . . . . . . . . . . 7-35Example Use of Record Script and Edit Properties . . . . . 7-378. Dataset Script CommandsAddDataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2DeleteDataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2EditDataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2ImportDataset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39. Design Object Script CommandsApplyMeshOps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4Analyze . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4AnalyzeDistributed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5AssignDCThickness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5ConstructVariationString . . . . . . . . . . . . . . . . . . . . . . . . . 9-6DeleteFieldVariation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7DeleteFullVariation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8DeleteLinkedDataVariation . . . . . . . . . . . . . . . . . . . . . . . 9-9DeleteVariation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11ExportConvergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-11ExportMatrixData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-13ExportMatrixData (2D Extractor) . . . . . . . . . . . . . . . . . . . 9-14ExportNetworkData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-16ExportNMFData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-18ExportMeshStats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-19ExportProfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-20GetEdit SourcesCount . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21GetExcitationsModule . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-21Contents-7ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics DesktopGetModule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-23GetName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24GetNominalVariation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24GetSelections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-24GetSolutionType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25GetSolveInsideThreshold . . . . . . . . . . . . . . . . . . . . . . . . . 9-25GetSourceContexts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-25GetVariationVariableValue . . . . . . . . . . . . . . . . . . . . . . . . 9-26Redo [Design] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26RenameDesignInstance . . . . . . . . . . . . . . . . . . . . . . . . . . 9-26ResetToTimeZero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-27SARSetup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-27SetActiveEditor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-28SetBackgroundMaterial . . . . . . . . . . . . . . . . . . . . . . . . . . 9-28SetDesignSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-29SetLengthSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-30SetSolutionType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-31SetSolveInsideThreshold . . . . . . . . . . . . . . . . . . . . . . . . . 9-32SetSourceContexts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-32Solve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-32RunToolkit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-33Undo [Design] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3610. Model Setup Script CommandsAssign Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2DeleteArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3EditArray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-411. 3D Modeler Editor Script CommandsDraw Menu Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2Create3D Component . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3CreateBondwire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4CreateBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-5CreateCircle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6Contents-8ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics DesktopCreateCone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7CreateCutplane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-7CreateCylinder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8CreateEllipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-8CreateEquationCurve . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-9CreateEquationSurface . . . . . . . . . . . . . . . . . . . . . . . . . 11-9CreateHelix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-10CreatePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-11CreateUserDefinedPart . . . . . . . . . . . . . . . . . . . . . . . . . 11-11CreatePolyline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-12CreateRectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-15CreateRectangle (2D Extractor) . . . . . . . . . . . . . . . . . . . 11-15CreateRegion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-16CreateRegularPolyhedron . . . . . . . . . . . . . . . . . . . . . . . 11-18CreateRegularPolygon . . . . . . . . . . . . . . . . . . . . . . . . . . 11-19CreateRegularPolyhedron (2D Extractor) . . . . . . . . . . . 11-20CreateSphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-20CreateSpiral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-21CreateTorus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-21CreateUserDefinedPart . . . . . . . . . . . . . . . . . . . . . . . . . 11-22Edit3DComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-23EditPolyline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-23Get3DComponentParameters . . . . . . . . . . . . . . . . . . . . 11-24Get3DComponentDefinitionNames . . . . . . . . . . . . . . . . 11-24Get3DComponentInstanceNames . . . . . . . . . . . . . . . . . 11-24Get3DComponentMaterialNames . . . . . . . . . . . . . . . . . 11-25Get3DComponentMaterialProperties . . . . . . . . . . . . . . . 11-25Insert3DComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-25InsertPolylineSegment . . . . . . . . . . . . . . . . . . . . . . . . . . 11-26SweepAlongPath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-27SweepAlongVector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-27SweepAroundAxis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-28SweepFacesAlongNormal . . . . . . . . . . . . . . . . . . . . . . . 11-28Contents-9ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics DesktopSweepFacesAlongNormalWithAttributes . . . . . . . . . . . . 11-29UpdateComponentDefinition . . . . . . . . . . . . . . . . . . . . . 11-30Edit Menu Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-30Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-30DeletePolylinePoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-31DuplicateAlongLine . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-31DuplicateAroundAxis . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-32DuplicateAroundAxis (2D Extractor) . . . . . . . . . . . . . . . 11-33DuplicateMirror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-33DuplicateMirror (2D Extractor) . . . . . . . . . . . . . . . . . . . . 11-34Mirror . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-35Mirror (2D Extractor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-35Move . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-36OffsetFaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-36Paste [Model Editor] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-36Rotate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-37Rotate (2D Extractor) . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-37Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-37Scale (2D Extractor) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-38Modeler Menu Commands . . . . . . . . . . . . . . . . . . . . . . . 11-38AssignMaterial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-39Chamfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-40Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-40CoverLines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-40CoverSurfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-41CreateEntityList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-41CreateFaceCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-41CreateFaceCS (2D Extractor) . . . . . . . . . . . . . . . . . . . . 11-43CreateObjectCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-44CreateObjectFromEdges . . . . . . . . . . . . . . . . . . . . . . . . 11-47CreateObjectFromFaces . . . . . . . . . . . . . . . . . . . . . . . . 11-47CreateRelativeCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-48CreateRelativeCS (2D Extractor) . . . . . . . . . . . . . . . . . . 11-49Contents-10ANSYS Electromagnetics Suite 16.2 - SAS IP, Inc. All rights reserved. - Contains proprietary and confidential informationof ANSYS, Inc. and its subsidiaries and affiliates.

Introduction to Scripting in ANSYS Electronics DesktopDeleteLastOperation . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-49DetachFaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-49EditEntityList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-50EditFaceCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-50EditObjectCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-51EditRelativeCS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-53EditRelativeCS (2D Extractor) . . . . . . . . . . . . . . . . . . . . 11-53Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-54ExportModelImageToFile . . . . . . . . . . . . . . . . . . . . . . . . 11-54Fillet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-56GenerateHistory . . . . . . . . . .

ANSYS, Inc. Southpointe 2600 ANSYS Drive Canonsburg, PA 15317 ansysinfo@ansys.com http://www.ansys.com (T) 724-746-3304 (F) 724-514-9494 June 2015