Named Arguments
Many Electronics Desktop script commands use named arguments. The names can appear in three ways:
- Named data, where name precedes data.
For example:
..., "SolveInside:=", true, ...
- Named Array, where name precedes array.
For example:
..., "Attributes:=", Array(...),...
- Named Array, where name is inside an array.
For example:
..., Array("NAME:Attributes",...),...
In the first and second examples, the name is formatted
as "<Name>:=". This signals to Electronics Desktop that this is a name for the next argument in the
script command. In the third example, the name is formatted as
"NAME:<name>" and is the first
element of the array.
The names are used both to identify what the data means to you and to inform Electronics Desktop which data is being given. The names must be included or the script will not play back correctly. However, if you are writing a script, you do not need to pass in every piece of data that the command can take. For example, if you are modifying a boundary, the script will be recorded to include every piece of data needed for the boundary, whether or not it was modified. If you are writing a script by hand, you can add only the data that changed and omit anything that you do not want to change. Electronics Desktop will use the names to determine which data you provided.
IronPython Example
When editing a port excitation, Electronics Desktop
records the Edit command as follows in IronPython:
oModule.Edit("Port1",
["NAME:Port1",
["NAME:Properties",
"PortSolver:=", "true",
"Phase:=", "0deg",
"Magnitude:=", "2mA",
"Impedance:=", "50Ohm",
"Theta:=", "0deg",
"Phi:=", "0deg",
"PostProcess:=", "false",
"Renormalize:=", "50Ohm + 0i Ohm",
"Deembed:=", "0mm",
"RefToGround:=", "false"
],
"Type:=", "EdgePort",
"IsGapSource:=", true,
"UpperProbe:=", false,
"LayoutObject:=", "Port1",
"Pin:=", "",
"ReferencePort:=", ""
]
)
If you only wish to change the magnitude, you can leave out the other data arguments when manually writing a script:
oModule.Edit("Port1",
["NAME:Port1",
["Magnitude:=", "1mA"]
]
)