• 易迪拓培训,专注于微波、射频、天线设计工程师的培养
首页 > CST > CST使用问答 > CST MW Studio VBA macro advice

CST MW Studio VBA macro advice

录入:edatop.com     点击:
Hi Lads,

I created a macor to generate an antenna with a port and all but it doesnt update automatically when i chage the parameters. Some parts repeat themselves and i replace them with functions. Unfortunately the macro runs once but when i update it doesnt recognise the functions anymore and gives and error like nothing is declared. For some reason the functions do not get passed properly into CST.Here is a simple expample. Tried public declaration but no effect. Unfortunately i need to fix this as is because for any mods in the structure countelss number of lines require modifications-really hard to do it and confusing-the more complicated drawing funtions are some 2 pages long with numerous parameters

Really appreciate your help
Thanks Syl

Code:
sub main()
 set_fr4
 set_copper
 set_vacuum
 end sub

Public Function set_fr4'define substrate FR-4 lossyWith Material	     .Reset	     .Name "FR-4 (lossy)"	     .Folder ""	.FrqType "all"	.Type "Normal"	.SetMaterialUnit "GHz", "mm"	.Epsilon "4.3"	.Mue "1.0"	.Kappa "0.0"	.TanD "0.025"	.TanDFreq "10.0"	.TanDGiven "True"	.TanDModel "ConstTanD"	.KappaM "0.0"	.TanDM "0.0"	.TanDMFreq "0.0"	.TanDMGiven "False"	.TanDMModel "ConstKappa"	.DispModelEps "None"	.DispModelMue "None"	.DispersiveFittingSchemeEps "General 1st"	.DispersiveFittingSchemeMue "General 1st"	.UseGeneralDispersionEps "False"	.UseGeneralDispersionMue "False"	.Rho "0.0"	.ThermalType "Normal"	.ThermalConductivity "0.3"	.SetActiveMaterial "all"	.Colour "0.94", "0.82", "0.76"	.Wireframe "False"	.Transparency "0"	.CreateEnd With
End Function
Function set_copper

'define material: Copper (annealed)
With Material	     .Reset	     .Name "Copper (annealed)"	     .Folder ""	.FrqType "static"	.Type "Normal"	.SetMaterialUnit "Hz", "mm"	.Epsilon "1"	.Mue "1.0"	.Kappa "5.8e+007"	.TanD "0.0"	.TanDFreq "0.0"	.TanDGiven "False"	.TanDModel "ConstTanD"	.KappaM "0"	.TanDM "0.0"	.TanDMFreq "0.0"	.TanDMGiven "False"	.TanDMModel "ConstTanD"	.DispModelEps "None"	.DispModelMue "None"	.DispersiveFittingSchemeEps "1st Order"	.DispersiveFittingSchemeMue "1st Order"	.UseGeneralDispersionEps "False"	.UseGeneralDispersionMue "False"	.FrqType "all"	.Type "Lossy metal"	.SetMaterialUnit "GHz", "mm"	.Mue "1.0"	.Kappa "5.8e+007"	.Rho "8930.0"	.ThermalType "Normal"	.ThermalConductivity "401.0"	.HeatCapacity "0.39"	.MetabolicRate "0"	.BloodFlow "0"	.VoxelConvection "0"	.MechanicsType "Isotropic"	.YoungsModulus "120"	.PoissonsRatio "0.33"	.ThermalExpansionRate "17"	.Colour "1", "1", "0"	.Wireframe "False"	.Reflection "False"	.Allowoutline "True"	.Transparentoutline "False"	.Transparency "0"	.CreateEnd With
End Function
Function set_vacuum
'define vacuumWith Material	.Name "Vacuum"	.Colour "0.5", "0.8", "1"	.Wireframe "False"	.Reflection "False"	.Allowoutline "True"	.Transparentoutline "False"	.Transparency "52"	.ChangeColourEnd With
End Function

申明网友回复良莠不齐,仅供参考。如需专业解答,请学习易迪拓培训专家讲授的CST视频培训教程

上一篇:Adding attenuation effect on signal in CST
下一篇:How to account for dielectric loss in CST?

CST培训课程推荐详情>>

  网站地图