MatchLab - CST export macro
===========================
Ampnode Technologies - https://matchlab.ampnode.in

What it does
  One click in CST creates one zip file in your Downloads folder:
    <project>_MatchLab_bundle.zip
  It contains the S-parameters of ALL ports (Touchstone .sNp), the antenna
  efficiency of each port, and a small log (export_log.txt).
  Drop that zip on the MatchLab "CST export bundle" box and MatchLab loads
  the antenna data and the efficiency together.

Before you start
  - Run your solver so the results are in the Navigation Tree.
  - Add farfield monitors across your band (the efficiency is derived from
    them). Without them the macro cannot find efficiency data.

Install (once)
  1. In CST open: Macros > Make VBA Macro...
  2. Open Export_MatchLab_Bundle.mcr in a text editor, copy everything,
     paste it into the CST macro window, and Save.
  3. Press F5 (Run).
  Optional: save the file as a .mcr inside CST's macro folder to get a menu
  entry for next time.

Use
  1. Open your simulated project in CST.
  2. Run the macro.
  3. A message shows where the zip was saved. Open MatchLab, go to
     Data, and drop the zip on the "CST export bundle" box.

If it says "no efficiency data found"
  Open export_log.txt inside the zip. It lists what was tried. You can still
  load the .sNp file on its own; MatchLab then assumes a lossless antenna.
  Send the log to info@ampnode.in if you need help.

Notes
  - The macro only reads your project and writes files to your Downloads
    folder. It does not change your CST project.
  - Written for CST Studio Suite 2026. Other versions may differ.
