Beruflich Dokumente
Kultur Dokumente
M. Balk
www.cst.com | Oct-07
Outline
Why macro programming? Existing macros Different types of macros Creating and testing new macros Getting more information
www.cst.com | Oct-07
Outline
Why macro programming? Existing macros Different types of macros Creating and testing new macros Getting more information
www.cst.com | Oct-07
CST STUDIO SUITEs macro language: Compatible to the widely used VBA (Visual Basic for Applications) COM based CST STUDIO SUITE can be controlled by other applications CST STUDIO SUITE can control other applications
www.cst.com | Oct-07
reports
Matlab
Call:
CST MWS is called Path of the VBA script within the CST DESIGN Sub Main ENVIRONMENT Opens an existing CST MWS file OpenFile("D:\MBK\test1\test1.mod") Solver.Start Start of Transient Solver Save End Sub Saves results and gives control back to Matlab
www.cst.com | Oct-07
Project Templates
Customize the default settings for particular types of applications.
At the beginning: or later:
Project Templates
Input some commands you often use for your MWS structures, e.g.:
Frequency range, units, Background-mat + boundaries Definition of materials (parameters, favorite colours ...) Working plane settings (especially snapping !) Monitors at favorite frequencies, ...
Open the history list Mark the commands, press Macro Give a name to your macro, e.g. File / My defaults Click Make globally available, then OK
www.cst.com | Oct-07
10
www.cst.com | Oct-07
Outline
Why macro programming? Existing macros Different types of macros Creating and testing new macros Getting more information
11
www.cst.com | Oct-07
12
www.cst.com | Oct-07
13
www.cst.com | Oct-07
14
www.cst.com | Oct-07
15
www.cst.com | Oct-07
Outline
Why macro programming? Existing macros Different types of macros Creating and testing new macros Getting more information
16
www.cst.com | Oct-07
Structure macros Modify the structure Stored in the history list for parametric model definition Name: ... . mcs Example: Creation of advanced geometry, e.g. spirals,c
17
www.cst.com | Oct-07
Control macros Do not modify the structure Do not need to be stored in the history list Name: ... . mcr Examples: Postprocessing, Calculation of analytical line impedance, etc.
18
www.cst.com | Oct-07
Project macros Can be either command macros or structure macros Specific for a particular project Stored with the project. Not available for other projects as well Global macros Can be either command macros or structure macros Generally useful Stored in a global location (Global Macro Path) Can be shared accross projects
19 www.cst.com | Oct-07
Result Templates
Purpose: Customized and automized postprocessing Store in <installationpath>/Library/Result Templates/my_template.rtp Will be evaluated after each solver run. Can perform just an action or return 1D or 0D values.
Performs an action
20
www.cst.com | Oct-07
Result Templates
Purpose: Customized and automized postprocessing Store in <installationpath>/Library/Result Templates/my_template.rtp Will be evaluated after each solver run. Can perform just an action or return 1D or 0D values.
Returns a value
21
www.cst.com | Oct-07
Outline
Why macro programming? Existing macros Different types of macros Creating and testing new macros Getting more information
22
www.cst.com | Oct-07
Open IDE
23
www.cst.com | Oct-07
24
www.cst.com | Oct-07
Macro Debugger: Set breakpoints Step through the macro Watch variables etc
25
www.cst.com | Oct-07
Source code for the dialog box is automatically created and Inserted at the carets position
26
www.cst.com | Oct-07
27
www.cst.com | Oct-07
Outline
Why macro programming? Existing macros Different types of macros Creating and testing new macros Getting more information
28
www.cst.com | Oct-07
29
www.cst.com | Oct-07