- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
CST MWS VBA
录入:edatop.com 点击:
Hi all.
I m trying to sweep the input resistance of an antenna. I m using for that VBA code below. It is working well but at the begin of each simulation the simulator asks me whether i want to delete the old results or save them. So i was thinking of deleting all the results at the end of each simulation. Can anyone please help me with that?
Thank you in advance.
Yousif
Sub Main
For i=1 To 10
'@ delete lumped element: element1
LumpedElement.Delete "element1"
'@ define lumped element: element1
With LumpedElement
.Reset
.SetName "element1"
.SetType "RLCSerial"
.SetR "1"
.SetL "0"
.SetC "0"
.SetGs "0"
.SetI0 "1e-14"
.SetT "300"
.SetP1 "False", ".25", "0", "0"
.SetP2 "False", "-.25", "0", "0"
.SetInvert "False"
.SetMonitor "True"
.Create
End With
'define the simulation
With Solver
.CalculationType "TD-PLW"
.StimulationPort "Plane wave"
.StimulationMode "1"
.SteadyStateLimit "-30"
.MeshAdaption "False"
.StoreTDResultsInCache "False"
.FullDeembedding "False"
.UseNetworkComputing "False"
End With
'start the simulation
With Solver
.Start
End With
'store the results
SelectTreeItem("1D Results\Lumped Elements\Voltages\Signals\element1 [pw]")
ExportPlotData "vt" & i &".sig"
SelectTreeItem("1D Results\Lumped Elements\Voltages\|U| linear\element1 [pw]")
ExportPlotData "vf" & i &".sig"
SelectTreeItem("1D Results\Lumped Elements\Currents\Signals\element1 [pw]")
ExportPlotData "it" & i &".sig"
SelectTreeItem("1D Results\Lumped Elements\Currents\|I| linear\element1 [pw]")
ExportPlotData "if" & i &".sig"
'remove the results
Next i
End Sub
I m trying to sweep the input resistance of an antenna. I m using for that VBA code below. It is working well but at the begin of each simulation the simulator asks me whether i want to delete the old results or save them. So i was thinking of deleting all the results at the end of each simulation. Can anyone please help me with that?
Thank you in advance.
Yousif
Sub Main
For i=1 To 10
'@ delete lumped element: element1
LumpedElement.Delete "element1"
'@ define lumped element: element1
With LumpedElement
.Reset
.SetName "element1"
.SetType "RLCSerial"
.SetR "1"
.SetL "0"
.SetC "0"
.SetGs "0"
.SetI0 "1e-14"
.SetT "300"
.SetP1 "False", ".25", "0", "0"
.SetP2 "False", "-.25", "0", "0"
.SetInvert "False"
.SetMonitor "True"
.Create
End With
'define the simulation
With Solver
.CalculationType "TD-PLW"
.StimulationPort "Plane wave"
.StimulationMode "1"
.SteadyStateLimit "-30"
.MeshAdaption "False"
.StoreTDResultsInCache "False"
.FullDeembedding "False"
.UseNetworkComputing "False"
End With
'start the simulation
With Solver
.Start
End With
'store the results
SelectTreeItem("1D Results\Lumped Elements\Voltages\Signals\element1 [pw]")
ExportPlotData "vt" & i &".sig"
SelectTreeItem("1D Results\Lumped Elements\Voltages\|U| linear\element1 [pw]")
ExportPlotData "vf" & i &".sig"
SelectTreeItem("1D Results\Lumped Elements\Currents\Signals\element1 [pw]")
ExportPlotData "it" & i &".sig"
SelectTreeItem("1D Results\Lumped Elements\Currents\|I| linear\element1 [pw]")
ExportPlotData "if" & i &".sig"
'remove the results
Next i
End Sub
I have already solved the problem using autoit. But still would like to get any comment about my question.
vba is very useful for modeling in HFSS and CST.but there is few talk on this topic.
Thanks for your reply. You are right there are few people who are working on this. But i am happy i could solve the problem by my self.
申明:网友回复良莠不齐,仅供参考。如需专业解答,请学习易迪拓培训专家讲授的CST视频培训教程。