Professional Documents
Culture Documents
CST Studio Suite™ Introduction in VBA Macro Usage and Programming
CST Studio Suite™ Introduction in VBA Macro Usage and Programming
Introduction in VBA
Macro usage and programming
M. Balk
Existing Macros
Different Macro Types
Templates
Structure of a Macro
Example
1 www.cst.com | Oct-07
Outline
2 www.cst.com | Oct-07
Outline
3 www.cst.com | Oct-07
Why Macro Programming?
4 www.cst.com | Oct-07
Integration Into Workflow
e.g. ppt-Reports
MS Windows Excel, Word,
Scripting Matlab, AutoCad,
Host etc...
COM reports
DCOM
e.g. bidirectional Excel link
CST Software
(MWS, DS)
Execute command in Matlab 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
6 www.cst.com | Oct-07
Project Templates
Customize the default settings for particular types of applications.
7 www.cst.com | Oct-07
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
9 www.cst.com | Oct-07
Customize CST MWS
exactly to your needs
Postprocessing
10 www.cst.com | Oct-07
Outline
11 www.cst.com | Oct-07
Useful, predefined macros
12 www.cst.com | Oct-07
Useful, predefined macros
13 www.cst.com | Oct-07
Useful, predefined macros
14 www.cst.com | Oct-07
Useful, predefined macros
15 www.cst.com | Oct-07
Outline
16 www.cst.com | Oct-07
Structure Macros and Control Macros
Structure macros
17 www.cst.com | Oct-07
Structure Macros and Control Macros
Control macros
18 www.cst.com | Oct-07
Project Macros and Global Macros
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
Performs an action
20 www.cst.com | Oct-07
Result Templates
Returns a value
21 www.cst.com | Oct-07
Outline
22 www.cst.com | Oct-07
The Integrated Development Environment
Open IDE
23 www.cst.com | Oct-07
The Integrated Development Environment
24 www.cst.com | Oct-07
The Integrated Development Environment
Macro Debugger:
Set breakpoints
Step through the macro
Watch variables
etc
25 www.cst.com | Oct-07
The Integrated Development Environment
26 www.cst.com | Oct-07
How to Create Macros?
27 www.cst.com | Oct-07
Outline
28 www.cst.com | Oct-07
Getting More Information
29 www.cst.com | Oct-07