Adding Programmatic EDB Cells to HFSS 3D Layout
- From the Project Manager window, expand Definitions and right-click Components.
- Choose Add Scripted Component.
- From the explorer window, click one or more Python script files (.py) to generate a set of component, footprint, and symbol definitions.
Each Python script file must possess two elements:
- A component, “MyNewComponent”, that is derived from IScriptedComponent. The IScriptedComponent file is located in the executables directory in PythonFiles\HFSS3DLayoutDesign\ScriptedComponent\IScriptedComponent.py either within Win64 or Linux64.
- A function similar to the following that returns an instance of the new component class:
def GetComponent():
return MyNewComponent()
Issues that arise upon import are reported through the Message Manager.
Creating a Component
Define all functions that return “NotImplementedError”.
- GetVersion: Should return a floating point number.
- GetParameters: Returns a list of Property objects (defined in the IScriptedComponent.py folder).
- Property: Is in the list returned by GetParameters.
- MenuProperty: Is in the list returned by GetParameters. MenuProperty expects a list of values as its argument list — not a list of strings. These are the default values used to generate the footprint, component and symbol. You can also edit these values at the Component Instance level. MenuProperty is a class derived from "Property". Both "Property" and "MenuProperty" are in the list returned by GetParameters.
- GetTerminalNames: Returns a list of terminal names that are used to establish the terminal order for the resulting component.
- CreateMaterialDefinitions: Must be defined even if the plan is to use the default definitions. Materials are created at the project level.
- CreatePadstackDefinitions: Must be defined even if it does nothing but “return”. Padstack definitions are added at the project level.
- GetLayerList: Should return a list of StackupLayers in order from top to bottom.
- CreateFootprint: where the data is available to use. Add geometry, padstacks, ports, etc. The ports should match up with the terminal list. The behavior is not well defined if that is not the case.
Editing the Python Script
Under Footprints, double-click or right-click to edit the footprint. This modifies the main menu. Then select Footprint and Edit Script. This allows modification of the Python script that is saved in the project. When finished making edits, select “Save/Run Script” under “Script” and all elements of the component are regenerated, as are component instances. Scripting issues are reported through the Message Manager.
Saving to Libraries
EDB Scripted Components can be saved just like any other component, footprint, or symbol. However, hand editing these libraries is not recommended.
Component Instances
Just like when any parametrized component is edited, modifying the parameters of the component are reflected in the component instance. If the “VerifyParameters” function is overloaded, any invalid parameter results in the parameter reverting to its previous state. This are reported through the Message Manager.