- 易迪拓培训,专注于微波、射频、天线设计工程师的培养
HFSS15: Named Array Argument
The recommended approach here is to simply replace a VBScript array with a python array. The mapping is quite simple:
Change Array( to [ and close with a ] instead of the )
Remove the line continuation symbols: _
Map Boolean values correctly
oEditor.CreateCone Array("NAME:ConeParameters", "XCenter:=", "0mm", _
"YCenter:=", "0mm", "ZCenter:=", "0mm", "WhichAxis:=", "Z", "Height:=", "2mm",_ "BottomRadius:=", "1.56204993518133mm", "TopRadius:=", "0mm"), Array("NAME:Attributes", "Name:=", "Cone1", "Flags:=", "", "Color:=", _
"(132 132 193)", "Transparency:=", 0, "PartCoordinateSystem:=", _
"Global", "UDMId:=", "", "MaterialValue:=", _
"" & Chr(34) & "vacuum" & Chr(34) & "", "SolveInside:=", true)
Sample Script 4: Create cone recorded snippet
For instance, method and named VBScript arrays in the snippet above are translated to
oEditor.CreateCone(
[
"NAME: ConeParameters",
"XCenter:=" , "0mm",
"YCenter:=" , "0mm",
"ZCenter:=" , "0mm",
"WhichAxis:=" , "Z",
"Height:=" , "2mm",
"BottomRadius:=" , "1.56204993518133mm",
"TopRadius" , "0mm"
],
[
"NAME:Attributes",
"Name:=" , "Cone1",
"Flags:=" , "",
"Color:=" , "(132 132 193)",
"Transparency:=" , 0,
"PartCoordinateSystem:=" , "Global",
"UDMId:=" , "",
"MaterialValue:=" , ""vacuum"",
"SolveInside:=" , True
])
Sample Script 5: Create a cone in IronPython
Note that the formatting (which helps readability immensely) is not really needed. All that had to be done was
Add the parentheses since the VBScript subroutine omits it
Replace the Array( ) delimiters with [ ].
Remove the Char(34) function (which introduced a double quote) and replace it with the escaped double quote ” literal.
Replace true with True
Remove the line continuation symbol, _
HFSS 学习培训课程套装,专家讲解,视频教学,帮助您全面系统地学习掌握HFSS
上一篇:Moving the Cursor Along the Z-Axis
下一篇:Moving and Resizing Desktop Windows