CST Vba
CST Vba
Introdu
oduct
ctio
ion
n in VB
VBA
Macro usage and programming
M. Balk
Exis
Existin
ting
g Macro
Macross
Diff
Differen
erentt Macro
Macro Types
Types
Templates
Struc
Structur
ture
e of a Macr
Macro
o
Example
Outline
Why
Why macr
cro
o progra
ogram
mmin
ming?
Exis
Existi
tin
ng mac
macros
ros
Differ
Different
ent types
types of macr
macros
os
Crea
Creati
ting
ng and
and tes
testi
tin
ng new
new macr
macros
os
Gett
Gettin
ing
g more
more info
inform
rmat
atio
ion
n
Outline
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
Project Templates
Customize the default settings for particular types of applications.
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“
Customize CST MWS
exactly to your needs
Postprocessing
Structure macros
Control 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
Result Templates
Performs an action
Result Templates
Returns a value
Outline
Open IDE
The Integrated Development Environment
Macro Debugger:
Set breakpoints
Step through the macro
Watch variables
etc…
The Integrated Development Environment