Object referring to a block. Use this object to create or to manipulate a block.
Reset
Resets all internal settings to their default values.
Type ( string type )
Sets the type for a block. This setting must be made before calling Create. The type can not be modified after the creation. The list of block types contains all valid options.
Name ( name blockname )
Sets the name of a block before calling Create. Furthermore, this method can be used to select an existing block of your model prior of calling queries.
Specifies the position of the block. This setting must be made before calling Create. Furthermore, it can be used to modify a block's position. Possible values are 0 < x, y <100000, i.e. (50000, 50000) is the center of the schematic. It is always ensured that the block is aligned with the grid, therefore the specified position might get adjusted slightly.
Create
Creates a new block. All necessary settings for this block have to be made previously. If the name has not been set, a default name for the specified block type will be used.
SetName ( name blockname )
Modifies the name of an existing block.
Rotate ( int angle )
Rotates the block by the given angle in degrees around its center point. If this setting is made before calling Create, the angle is only stored. The rotation will then be done in Create (after any horizontal or vertical flip was applied).
FlipHorizontal
Horizontally flips a block. If this setting is made before calling Create, the flip is only stored. It will then be done in Create (before any rotation is applied).
FlipVertival
Vertically flips a block. If this setting is made before calling Create, the flip is only stored. It will then be done in Create (before any rotation is applied).
Moves a block by the given offset. Note that the schematic size is given by 0 < x, y <100000. Use Position to specify a certain location. It is always ensured that the block is aligned with the grid, therefore the specified offset might get adjusted slightly. This setting must not be made before calling Create.
SetDoubleProperty ( name propertyname, string value )
SetIntegerProperty ( name propertyname, string value )
SetBoolProperty ( name propertyname, string value )
SetStringProperty ( name propertyname, string value )
SetDoubleArrayProperty ( name propertyname, string array value )
SetIntegerArrayProperty ( name propertyname, string array value )
Sets the given value for the specified property. The list of properties available is individual for each type of block.
SetLocalUnitForProperty ( name propertyname, string unit )
Sets the given unit for the specified property, i.e. the property's value will not refer to the project's global unit any more but to this local unit.
SetGlobalUnitForProperty ( name propertyname )
Sets the global unit for the specified property.
Delete
Deletes the currently selected block.
SetFile ( filename filename )
Sets the file for a block. This is only possible for block types that reference external data.
SetRelativePath ( bool relative )
Specifies a relative file name. This is only possible for some types of blocks.
SetInterpolation ( bool interpolate )
Switches on/off interpolation for a block. This is only possible for some types of blocks.
SetInterpolationDataForProperty ( name propertyname, double min, double max, int samples )
Sets the interval for a block's property inside that interpolation will be performed with a given number of samples. This is only possible for some types of blocks.
CopyInterpolationDataToProject
Sets the block's interpolation data for all blocks of the same type that are contained in your model. This is only possible for some types of blocks.
SetNumericalEvaluation ( bool numerical, bool analyticalincaseoffailure )
Switches on/off numerical evaluation for a block. Set analyticalincaseoffailure if you don't want the simulation to stop in case an error occurs during the numerical evaluation.
SetSolver ( string solver )
Sets a solver for a block.
SetReferenceBlock ( name blockname )
Sets the reference block for a block. This is only possible for some types of blocks.
SetAsDefaultReference
Makes a reference block the project's default reference block.
SetClonedBlock ( name blockname )
Sets the cloned block for a clone block.
SetDeembedded ( bool deembed )
Sets the de-embedding property for a block, i.e. the inverse S-matrix will be considered for that block then.
SetDifferentialPorts ( bool differential )
Sets differential ports for a block, i.e. its reference pins can also be accessed. This is only possible for some types of blocks.
SetDifferentialCablePorts ( bool differential )
Sets differential ports for a block using cable models, i.e. its reference pins can also be accessed. This is only possible for SimLab TL/PEEC file blocks and CST CABLE STUDIO blocks.
SetRenormForBlockLinks ( bool renorm )
Specifies if the block's S-parameters will be re-normalized if its impedances differ from the impedances of a connected block.
SetRenormRangeForBlockLinks ( int percent )
Specifies the range of relative differences of the block's impedances and a connected block's impedances that is considered as equal, e.g. a value of 15 means that a deviation of up to 15 percent will be ignored.
SetRenormForPortLinks ( bool renorm )
Specifies if the block's S-parameters will be re-normalized if its impedances differ from the impedances of a connected external port.
SetRenormRangeForPortLinks ( int percent )
Specifies the range of relative differences of the block's impedances and a connected external port's impedance (if a fix impedance is set there) that is considered as equal, e.g. a value of 15 means that a deviation of up to 15 percent will be ignored.
SetMOR_DesiredAccuracy( double percent )
Specifies the desired approximation accuracy of model order reduction (MOR) in transient simulation. The accuracy is specified in %. If the argument is zero by value, the default of 5% is applied. The method can only be applied to blocks that can use model order reduction. This can be queried by the method CanUseMOR().
SetMOR_InitialPoles(int poles )
Specifies the initial number of poles used in model order reduction (MOR) in transient simulation. If the argument is zero by value, the required number of poles is estimated automatically in the MOR algorithm. The method can only be applied to blocks that can use model order reduction. This can be queried by the method CanUseMOR().
SetMOR_PoleIncrement(int increment )
Specifies the increment in the number of poles used in model order reduction (MOR) in transient simulation. In the MOR algorithm, the number of poles is increased by the increment from iteration to iteration, starting at the initial number of poles. If the argument is zero by value, an appropriate pole increment is calculated automatically by the MOR algorithm. The method can only be applied to blocks that can use model order reduction. This can be queried by the method CanUseMOR().
SetMOR_InitialPoles(int poles )
Specifies the initial number of poles used in model order reduction (MOR) in transient simulation. If the argument is zero by value, the required number of poles is estimated automatically in the MOR algorithm. The method can only be applied to blocks that can use model order reduction. This can be queried by the method CanUseMOR().
SetMOR_PassivationRelativeBandwidth( double bandwidth )
Specifies the passivation bandwidth used in model order reduction (MOR) in transient simulation. The relative passivation bandwidth is defined as the maximum frequency, to which passivity of the generated reduced order model is enforced, in relation to the maximum frequency to which S-Parameter data is fitted. If the argument is zero by value, passivation of the S-Parameters is completely disabled. Otherwise, the value should be larger than one. Generally, a larger passivation bandwidth will enhance the stability of transient simulation, but it might reduce the accuracy of the approximated S-Parameters in the frequency range of interest. The method can only be applied to blocks that can use model order reduction. This can be queried by the method CanUseMOR().
SetMOR_PassivateToInfinity( bool passivatetoinfinity )
Specifies whether S-Parameters are to be passivated to an infinite frequency in model order reduction (MOR) in transient simulation. This guaranties absolute stability of the reduced order model, but it might reduce the accuracy of the approximated S-Parameters in the frequency range of interest. The method can only be applied to blocks that can use model order reduction. This can be queried by the method CanUseMOR().
SetMOR_DownsampleData ( bool downsample )
Specifies whether the input data will be reduced via downsampling in model order reduction (MOR) in transient simulation. By downsampling, the number of frequency sample points in the MOR is reduced, enhancing the performance of the algorithm, but no essential spectral information will be dropped. By default, downsampling is applied. The method can only be applied to blocks that can use model order reduction. This can be queried by the method CanUseMOR().
SetIFT_TruncationAccuracy( double percent )
Specifies the truncation accuracy of the impulse response, when applying the inverse Fourier transform (IFT) as convolution method. It is specified in %. It is defined as the energy of the neglected portion of the impulse response (following the truncation) in relation to the total energy of the impulse response. Note that the model order reduction (MOR) does not involve a truncation error in this sense, because it relies on recursive convolution. The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
SetIFT_WindowingRelativeBandwidth( double bandwidth )
Specifies the relative bandwidth of the Cosine Bell window, when applying the inverse Fourier transform (IFT) as convolution method. The relative bandwidth is defined as the frequency where the window tapers off to zero in relation to the maximum frequency of interest, to which S-Parameter data is provided. The picture below shows the meaning of the relative windowing bandwidth in spectral domain. The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
SetConvolutionMethod( string method )
Specifies the method used for convolution in transient simulation. The argument can assume the values "Automatic", "MOR", or "IFT". In automatic mode, model order reduction (MOR) is first applied with default settings. If it does not reach the default desired accuracy of 5%, the inverse Fourier transform (IFT) algorithm is applied as a fallback solution. The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
SetConvolutionFmax( double fmax )
Specifies the maximum frequency to which S-Parameters are fitted in model order reduction (MOR) or in convolution via inverse Fourier transform (IFT), used in transient simulation. The argument is in frequency units. If the argument is zero by value, the maximum frequency is calculated automatically, based on the transient excitation. The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
SetUseNaturalImpedances( bool bFlag )
The flag specifies whether natural port impedances are used as reference for the convolution via model order reduction (MOR) or inverse Fourier transform (IFT), used in transient simulation or, if false, whether 50 Ohms is used as reference impedance. Especially in the IFT algorithm, natural port impedances are advantageous, because they tend to lead to shorter impulse responses. The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
SetDefineProbes( bool bFlag )
Activates internal block probes for blocks that define probes.
ResetCombineMonitorFilters
Clears all monitor selection filters.
GetNCombineMonitorFilters int
Gets the number of defined monitor selections.
GetCombineMonitorFilter( int index ) name
Gets the filter string of index "index".
AddCombineMonitorFilter( name filterName )
Adds a monitor selection filter to the internal filter set. The following expressions are allowed:
Filter |
Action |
* |
All monitors are added to the selection |
<MonitorName> |
This monitor is added to the selection |
:farfield: |
All farfield monitors are added to the selection |
:fieldsource: |
All Field source monitors are added to the selection |
:efield: |
All E-field monitors are added to the selection |
:hfield: |
All H-field monitors are added to the selection |
:current: |
All current monitors are added to the selection |
:powerflow: |
All power flow monitors are added to the selection |
:eenergy: |
All E-energy monitors are added to the selection |
:henergy: |
All H-energy monitors are added to the selection |
SetUseHigherOrderInterpolation( bool bFlag )
The flag specifies whether higher-order interpolation is to be used for the S-Parameter data of the block or linear interpolation. The method can only be applied to blocks that able to switch between different interpolation methods. This can be queried by the method CanSelectInterpolationMethod().
DoesExist bool
Checks if a block with the currently selected name already exists.
StartBlockNameIteration int
Resets the iterator for the blocks and returns the number of blocks.
GetNextBlockName name
Returns the next block's name. Call StartBlockNameIteration before the first call of this method.
GetPositionX int
Returns the horizontal position of the center point of a block.
GetPositionY int
Returns the vertical position of the center point of a block.
GetNumberOfPorts int
Returns a block's number of ports (including reference pins).
GetNumberOfNonReferencePorts int
Returns a block's number of ports (without reference pins).
GetPortPositionX ( int index ) int
Returns he horizontal position of a block's internal port specified by the given index. Index must be an integer between 0 and GetNumberOfPorts()-1.
GetPortPositionY ( int index ) int
Returns he vertical position of a block's internal port specified by the given index. Index must be an integer between 0 and GetNumberOfPorts()-1.
GetPortName ( int index ) string
Returns the name of a block's internal port specified by the given index. Index must be an integer between 0 and GetNumberOfPorts()-1.
GetPortLabel ( int index ) string
Returns the label of a block's internal port specified by the given index. Since not all blocks support port labels, this function may return an empty string. Index must be an integer between 0 and GetNumberOfPorts()-1.
FindPortsWithLabel ( name labelname, variant portNames_strArray ) int
Searches the block for ports with a given label. Since labels are not unique, there may exist more than one pin for the given name. The number of found ports is returned.
IsPortConnected( int index ) bool
Checks if the specified port of this block is connected. Index must be an integer between 0 and GetNumberOfPorts()-1.
StartPropertyIteration
Resets the iterator for the properties of a block.
GetNextProperty ( name propertyname, string type, string value )
Returns the name, type and value of the next property. Call StartPropertyIteration before the first call of this method. An empty name is returned if the property iterator is positioned at the end.
CanUseMOR bool
Checks if a block can use model order reduction (MOR) in transient simulation. Those blocks, suitable for MOR, are also suitable for convolution via inverse Fourier transform (IFT). Hence, the return value indicates, whether the set-methods SetMOR_DesiredAccuracy(), SetMOR_InitialPoles(), SetMOR_PoleIncrement(), SetConvolutionMethod(), SetConvolutionFmax(), SetUseNaturalImpedances() and the get-methods GetMOR_DesiredAccuracy(), GetMOR_InitialPoles(), GetMOR_POleIncrement(), GetConvolutionMethod(), GetConvolutionFmax(), GetUseNaturalImpedances() can be called.
GetMOR_DesiredAccuracy double
Returns the desired approximation accuracy of model order reduction (MOR) in transient simulation. The method can only be applied to blocks that can use MOR This can be queried by the method CanUseMOR().
GetMOR_InitialPoles int
Returns the initial number of poles used in model order reduction (MOR) in transient simulation. A return value of 0 indicates that the required number of poles will be calculated automatically. The method can only be applied to blocks that can use MOR This can be queried by the method CanUseMOR().
GetMOR_PoleIncrement int
Returns the pole increment used in model order reduction (MOR) in transient simulation. A return value of 0 indicates that the pole increment will be calculated internally by the MOR algorithm. The method can only be applied to blocks that can use MOR This can be queried by the method CanUseMOR().
GetMOR_PassivationRelativeBandwidth double
Returns the relative passivation bandwidth used in model order reduction (MOR) in transient simulation. For more details, see the description of the method SetMOR_PassivationRelativeBandwidth(). A return value of 0 indicates that passivation of the S-Parameters will be completely disabled in the MOR algorithm. The method can only be applied to blocks that can use MOR This can be queried by the method CanUseMOR().
GetMOR_PassivateToInfinity bool
Indicates whether passivity is enforced to an infinite frequency during model order reduction (MOR) in transient simulation. The method can only be applied to blocks that can use MOR This can be queried by the method CanUseMOR().
GetMOR_DownsampleData bool
Indicates whether downsampling of the input data is applied during model order reduction (MOR) in transient simulation. The method can only be applied to blocks that can use MOR This can be queried by the method CanUseMOR().
GetIFT_TruncationAccuracy double
Returns the truncation accuracy of the impulse response, when applying the inverse Fourier transform (IFT) as convolution method in transient simulation. It is specified in %. The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
GetIFT_WindowingRelativeBandwidth double
Returns the relative windowing bandwidth, when applying the inverse Fourier transform (IFT) as convolution method in transient simulation. For more details, see the description of the method SetIFT_WindowingRelativeBandwidth(). The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
GetConvolutionMethod string
Returns the applied convolution method in transient simulation. The return value can assume values "Automatic", "MOR", or "IFT". The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
GetConvolutionFmax double
Returns the maximum frequency to which S-Parameters are fitted in convolution via model order reduction (MOR) or via inverse Fourier transform (IFT), used in transient simulation. A return value of 0 indicates that the maximum frequency is calculated automatically, based on the transient excitation. The method can only be applied to blocks that can use MOR or IFT. This can be queried by the method CanUseMOR().
GetUseNaturalImpedances bool
The return value indicates whether natural port impedances or 50Ohms are used as reference for the convolution via model order reduction (MOR) or inverse Fourier transform (IFT), used in transient simulation. The method can only be applied to blocks that can use convolution via MOR or IFT. This can be queried by the method CanUseMOR().
CanSelectInterpolationMethod bool
Checks if the user can select between different interpolation methods for the given block. Currently, this is only possible for Touchstone blocks. Hence, the return value indicates, whether the set-method SetUseHigherOrderInterpolation() and the get-method GetUseHigherOrderInterpolation() can be called.
GetUseHigherOrderInterpolation bool
The return value indicates whether higher-order interpolation is used for the S-Parameter data of the block or linear interpolation. The method can only be applied to blocks that able to switch between different interpolation methods. This can be queried by the method CanSelectInterpolationMethod().
GetTypeShortName string
Returns the short "type" name of a block. For example the short type name of a resistor would be "RES".
GetTypeName string
Returns the "type" name of a block. For example the type name of a resistor would be "resistor".
Position (50000, 50000)
With Block
.Reset
.Type ("MicrostripCoupledLinesIrregular")
.Name ("MC2")
Dim sWidth(0 To 3) As String
sWidth(0) = "0.5"
sWidth(1) = "1.1"
sWidth(2) = "2.2"
sWidth(3) = "3.3"
.SetIntegerProperty("Number Of Lines", 4)
.SetDoubleArrayProperty("Widths", sWidth)
.Position(51050, 51000)
.Create
End With
'Modifies an existing block's position and some solver settings
With Block
.Reset
.Name ("MyTLine")
.Position(57000, 50000)
.Rotate (90)
.SetDeembedded (True)
End With
'Searches for all ports with a given label
Dim arrayBSTR As Variant
Dim x As Long
With Block
.Name ("MWSSCHEM1")
.FindPortsWithLabel("MyLabel", arrayBSTR)
End With
For x= LBound(arrayBSTR) To UBound(arrayBSTR)
MsgBox(arrayBSTR(x))
Next