0% found this document useful (0 votes)
57 views

CST Vba

This document discusses macro usage and programming in CST Studio Suite. It covers existing macros, different macro types, templates, and the structure of macros. It also discusses creating and testing new macros, and ways to get more information on macro programming.

Uploaded by

ciliw61754
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

CST Vba

This document discusses macro usage and programming in CST Studio Suite. It covers existing macros, different macro types, templates, and the structure of macros. It also discusses creating and testing new macros, and ways to get more information on macro programming.

Uploaded by

ciliw61754
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

CST STUDIO SUITE™

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

Why macro programming?


Existing macros
Different types of macros
Creating and testing new macros
Getting more information
Why Macro Programming?

 Automate common tasks, save time, increase productivity


 Extend the program‘s capabilities, e.g. post processing, optimization
 Customize the program for particular applications
 Make advanced functionality available to less experienced users

CST STUDIO SUITE‘s 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
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)

CST Studios can be both: OLE client and server


OLE: CommunicationStandard for Data Exchange
Integration Into Workflow
Call via command line option
CST Software
Matlab (CST MWS,
CST DS)

Call: ! "C:\Program Files\CST STUDIO SUITE 2006B\CST DESIGN ENVIRONMENT.exe" –m D:\MBK\Start_CST_5.bas

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.

At the beginning: File -> New...


or later: File -> Select Template...

The template library can be easily extended


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“
Customize CST MWS
exactly to your needs

Postprocessing

 Import and compare with measured data


 Special postprocessing (e.g. TDR)
 Store Views and Animations in different formats
 Userdefined goal-functions (e.g. antenna goal)
 Creating a Powerpoint Presentation
Outline

Why macro programming?


Existing macros
Different types of macros
Creating and testing new macros
Getting more information
Useful, predefined macros
Useful, predefined macros
Useful, predefined macros
Useful, predefined macros
Outline

Why macro programming?


Existing macros
Different types of macros
Creating and testing new macros
Getting more information
Structure Macros and Control Macros

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

Macros -> Construct -> Coils -> Sectioned Spiral


Structure Macros and Control Macros

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.

Macros -> Calculate -> Calculate Analytical Line


Impedance
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
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
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
Outline

Why macro programming?


Existing macros
Different types of macros
Creating and testing new macros
Getting more information
The Integrated Development Environment

Open IDE
The Integrated Development Environment

Run the macro Debug the macro

Edit macro code here (syntax highlighting)


The Integrated Development Environment

Macro Debugger:

 Set breakpoints
 Step through the macro
 Watch variables
 etc…
The Integrated Development Environment

Graphical GUI builder

Source code for the dialog box is automatically created and


Inserted at the caret‘s position
How to Create Macros?

There exist different ways to create a macro

 Copy and modify an existing macro


 Go to the history list, select lines and press „Macro“
 Use Macro -> Make VBA Control Macro and start from Scratch
 Let MWS create the macro‘s framework by pressing „Edit“ for
 User defined excitation function
 User defined parameter sweep watch
 User defined optimizer goal function
Outline

Why macro programming?


Existing macros
Different types of macros
Creating and testing new macros
Getting more information
Getting More Information

 Advanced Topics Manual


 Check the VBA online manual
(Help -> VBA Macro Language)
 Have a look at the pre-loaded
macro examples
 Visit a special training class on macro
programming
 Learning by doing….

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy