IInnttrroodduuccttiioonn ttoo AANNSSYYSS WWoorrkkbbeenncchh SSccrriippttiinngg iinn AAAANNNNSSSSYYYYSSSS 11112222..1111 NNNNoooovvvveeeemmmmbbbbeeeerrrr 2222000000009999 ©© 22000099 AANNSSYYSS,, IInncc.. AAllll rriigghhttss rreesseerrvveedd.. 11 AANNSSYYSS,, IInncc.. PPrroopprriieettaarryy Agenda •• OOvveerrvviieeww ooff AANNSSYYSS WWoorrkkbbeenncchh SSccrriippttiinngg • Recording & Replaying Journals •• CCoommmmaanndd WWiinnddooww • Scripting Basics • PPrroojjeecctt && DDaattaa MMooddeell CCoonncceeppttss • Scripting with Data-Integrated Applications • WWhhere tto GGett HHellp • Examples © 2009 ANSYS, Inc. All rights reserved. 2 ANSYS, Inc. Proprietary Scripting Overview • AANNSSYYSS 1122..11 ffuullllyy ssuuppppoorrttss WWoorrkkbbeenncchh jjoouurrnnaalliinngg aanndd scripting – Project concepts & operations – PParametter managementt – Native applications • PPrroojjeecctt SScchheemmaattiicc, DDeessiiggnn EExxpplloorraattiioonn, EEnnggiinneeeerriinngg DDaattaa – File management and data models • Python-based scripting language – Object-oriented – Platform-independent • FFuullllyy ddooccuummeenntteedd && ssuuppppoorrtteedd • Works “hand-in-hand” with application-level scripting – DesignModeler, Meshing, MMechhaniicall, MMechhaniicall AAPPDDLL, FLUENT, CFX, etc. © 2009 ANSYS, Inc. All rights reserved. 3 ANSYS, Inc. Proprietary Journaling •• WWoorrkkbbeenncchh ooppeerraattiioonnss aarree rreeccoorrddeedd iinn aa journal file – OOnlly operattiions whhiichh moddiiffy ddatta moddell – Files have *.wbjn extension • Each session creates a new journal file • PPllaayyiinngg bbaacckk tthhee jjoouurrnnaall rreeccrreeaatteess tthhee sseessssiioonn • Journals should not be confused with log files – LLog ffiilles recordd speciiffiic WWorkkbbenchh eventts – Log files cannot be replayed © 2009 ANSYS, Inc. All rights reserved. 4 ANSYS, Inc. Proprietary Journaling •• TTwwoo ttyyppeess ooff WWoorrkkbbeenncchh jjoouurrnnaallss – Automatically recorded session journals • Restore work from a complete session – NOT designed to archive simulation projects – Manually recorded journals • Starting points for creating custom Workbench scripts • Communicate sequential Workbench steps to colleagues or ANSYS Customer Support © 2009 ANSYS, Inc. All rights reserved. 5 ANSYS, Inc. Proprietary Journaling Options (Preferences) •• TToooollss ->> OOppttiioonnss… ->> JJoouurrnnaallss aanndd LLooggss © 2009 ANSYS, Inc. All rights reserved. 6 ANSYS, Inc. Proprietary Manually Recorded Journals SSttaarrtt aa jjoouurrnnaall recording Stop a journal recording © 2009 ANSYS, Inc. All rights reserved. 7 ANSYS, Inc. Proprietary Replaying Journals •• RReeppllaayy aa jjoouurrnnaall aatt aannyy ttiimmee dduurriinngg aann interactive session – FFiille SScriipttiing RRun SScriiptt FFiille… © 2009 ANSYS, Inc. All rights reserved. 8 ANSYS, Inc. Proprietary Replaying Journals •• AA jjoouurrnnaall ccaann aallssoo bbee rreeppllaayyeedd ffrroomm tthhee command line – AAdddd –RR <ffiillename.wbbjjn> – Add –I for interactive mode or –B for batch © 2009 ANSYS, Inc. All rights reserved. 9 ANSYS, Inc. Proprietary Workbench Command Line OOppttiioonnss Argument Operation -BB RRuunn WWoorrkkbbeenncchh iinn bbaattcchh mmooddee.. TThhee uusseerr iinntteerrffaaccee iiss nnoott displayed and a console window is opened. The functionality of the console window is the same as the Workbench Command Window. -R <ANSYS Workbench Replay the specified Workbench script file on start-up. If script file> specified in conjunction with –B, Workbench will start in batch mode, execute the specified script, and shut down at the ccoommpplleettiioonn ooff ssccrriipptt eexxeeccuuttiioonn. -I Run Workbench in interactive mode. This is typically the default, but if specified in conjunction with –B, both the user interface and ccoonnssoollee wwiinnddooww aarree ooppeenneedd. -X Run Workbench interactively and then exit upon completion of script execution. Typically used in conjunction with –R. -FF <<AANNSSYYSS WWorkkbbenchh LLoadd tthhe speciiffiiedd WWorkkbbenchh projjectt ffiille on sttartt-up. project file> -E <command> Execute the specified Workbench scripting command on start-up. YYoouu ccaann iissssuuee mmuullttiippllee ccoommmmaannddss, sseeppaarraatteedd wwiitthh sseemmiiccoolloonnss ((;;)), or specify this argument multiple times and the commands will be executed in order. © 2009 ANSYS, Inc. All rights reserved. 10 ANSYS, Inc. Proprietary
Description: