- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
Re: CST MWS vba script parameter sweep ASCII export
录入:edatop.com 点击:
Hi everybody
I have a little problem with the CST VB.
I design a model in CST MWS. Know
I want to performe a Parameter-Sweep.
I choose a userdefined output.
Cause I want to analyze some data in matlab,
I want, what CST save for expample the energy in a ascii file.
A new file for every run of the sweep.
But this is not working.
Do you have a idea?
The code:
Code:
Thanking for your in anticipation.
PS:
I found the answer.
It was to easy!
' userdefined watch for parameter sweep
I have a little problem with the CST VB.
I design a model in CST MWS. Know
I want to performe a Parameter-Sweep.
I choose a userdefined output.
Cause I want to analyze some data in matlab,
I want, what CST save for expample the energy in a ascii file.
A new file for every run of the sweep.
But this is not working.
Do you have a idea?
The code:
Code:
Code:
Option Explicit Sub ParameterSweepWatch(action As Integer) 'Please define actions for the parameter sweep watch here. Select Case action Case 0 'Please define actions before the parametersweep starts. Case 1 'Please define actions after each calculation. Dim zaehler As Integer Dim Dateiname As String Dim filename As String Dim Fileendung As String Dim strwert As String Dim wertdouble As Double wertdouble= ParameterSweep.GetValueOfVaryingParameter() strwert = CStr(wertdouble) filename = "I:\simulation-Output\File-" Fileendung = ".txt" Dateiname = SelectTreeItem ("1D Results\Energy\Energy [5]") With ASCIIExport .Reset .FileName (Dateiname) .Mode ("FixedNumber") .Execute End With Case 2 'Please define actions after the parametersweep has finished. End Select End Sub Sub Main() ParameterSweepWatch 0 ParameterSweepWatch 1 ParameterSweepWatch 2 End Sub
PS:
I found the answer.
It was to easy!
' userdefined watch for parameter sweep
Code:
Option Explicit Sub ParameterSweepWatch(action As Integer) 'Please define actions for the parameter sweep watch here. Select Case action Case 0 'Please define actions before the parametersweep starts. Case 1 'Please define actions after each calculation. Dim zaehler As Integer Dim Dateiname As String Dim filename As String Dim Fileendung As String Dim strwert As String Dim wertdouble As Double wertdouble = ParameterSweep.GetValueOfVaryingParameter(0) Parametername = ParameterSweep.GetNameOfVaryingParameter(0) strwert = CStr(wertdouble) filename = "I:\simulation-Output\File-" Fileendung = ".txt" Dateiname =filename & Parametername & strwert & Fileendung SelectTreeItem ("1D Results\Energy\Energy [5]") With ASCIIExport .Reset .FileName (Dateiname) .Mode ("FixedNumber") .Step(100) .Execute End With Case 2 'Please define actions after the parametersweep has finished. End Select End Sub Sub Main() ParameterSweepWatch 0 ParameterSweepWatch 1 ParameterSweepWatch 2 End Sub
what is your problem?
you can get your results directly from file-export-ascii format
may that i understand from your question,if not forgive me for misunderstand
申明:网友回复良莠不齐,仅供参考。如需专业解答,请学习易迪拓培训专家讲授的CST视频培训教程。
上一篇:Problem with using Frequency Domain Solver in CST
下一篇:CST MWS: Parameter Sweep : 2 Parameters in one Sequence