淘宝官方店     推荐课程     在线工具     联系方式     关于我们  
 
 

微波射频仿真设计   Ansoft Designer 中文培训教程   |   HFSS视频培训教程套装

 

Agilent ADS 视频培训教程   |   CST微波工作室视频教程   |   AWR Microwave Office

          首页 >> Ansoft Designer >> Ansoft Designer在线帮助文档


Ansoft Designer / Ansys Designer 在线帮助文档:


Script Guide >
Desktop Scripting with IronPython >
   Translating Script commands from VBScript to IronPython >
       Converting VBScript Function calls to IronPython Syntax >
           Named Array Argument               


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, _

Related Topics

Converting VBScript Function calls to IronPython Syntax

 




HFSS视频教学培训教程 ADS2011视频培训教程 CST微波工作室教程 Ansoft Designer 教程

                HFSS视频教程                                      ADS视频教程                               CST视频教程                           Ansoft Designer 中文教程


 

      Copyright © 2006 - 2013   微波EDA网, All Rights Reserved    业务联系:mweda@163.com