Sub Main ()
With cylind
Dim i As Integer
i=0
While i<1000
With Cylinder
.Reset
.Name "solid(i)"-----------------------------------------此处有问题,因为name默认是字符串,i起不到作用
.Component "component1"
.Material "PEC"
.OuterRadius "10"
.InnerRadius "0.0"
.Axis "y"
.Yrange "0", "50"
.Xcenter "i"
.Zcenter "0"
.Segments "0"
.Create-----------------------------------------------------此处运行时发现显示This name already exists, please choose a unique name(,Create)
End With
i=i+10
Wend
End With
End Sub
之前做过一个需要“i”的VBA,希望能给你一些参考:
For i=1 To 32 //定义循环从端口1到32(如果端口数目不同,可以自行改变数目)
SelectTreeItem"2D/3D ResultsH-Fieldh-ield(f=63.6;z=0) ["+cstr(i)+"]“
这样出来的结果,就是[1] [2]........[32]
声明:网友回复良莠不齐,仅供参考。如需更专业系统地学习CST,可以购买资深专家讲授的CST最新视频培训课程。