.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\00-EDB\02_edb_to_ipc2581.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_00-EDB_02_edb_to_ipc2581.py: EDB: IPC2581 export ------------------- This example shows how you can use PyAEDT to export an IPC2581 file. .. GENERATED FROM PYTHON SOURCE LINES 8-11 Perform required imports ~~~~~~~~~~~~~~~~~~~~~~~~ Perform required imports, which includes importing a section. .. GENERATED FROM PYTHON SOURCE LINES 11-15 .. code-block:: default import os import pyaedt .. GENERATED FROM PYTHON SOURCE LINES 16-19 Download file ~~~~~~~~~~~~~ Download the AEDB file and copy it in the temporary folder. .. GENERATED FROM PYTHON SOURCE LINES 19-30 .. code-block:: default temp_folder = pyaedt.generate_unique_folder_name() targetfile = pyaedt.downloads.download_file('edb/ANSYS-HSD_V1.aedb', destination=temp_folder) ipc2581_file = os.path.join(temp_folder, "Ansys_Hsd.xml") print(targetfile) .. rst-class:: sphx-glr-script-out .. code-block:: none D:\Temp\pyaedt_prj_2LL\edb/ANSYS-HSD_V1.aedb .. GENERATED FROM PYTHON SOURCE LINES 31-34 Launch EDB ~~~~~~~~~~ Launch the :class:`pyaedt.Edb` class, using EDB 2023 R2 and SI units. .. GENERATED FROM PYTHON SOURCE LINES 34-38 .. code-block:: default edb = pyaedt.Edb(edbpath=targetfile, edbversion="2023.2") .. GENERATED FROM PYTHON SOURCE LINES 39-42 Parametrize net ~~~~~~~~~~~~~~~ Parametrize a net. .. GENERATED FROM PYTHON SOURCE LINES 42-47 .. code-block:: default edb.modeler.parametrize_trace_width( "A0_N", parameter_name=pyaedt.generate_unique_name("Par"), variable_value="0.4321mm" ) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 48-51 Cutout ~~~~~~ Create a cutout. .. GENERATED FROM PYTHON SOURCE LINES 51-65 .. code-block:: default signal_list = [] for net in edb.nets.netlist: if "PCIe" in net: signal_list.append(net) power_list = ["GND"] edb.cutout(signal_list=signal_list, reference_list=power_list, extent_type="ConvexHull", expansion_size=0.002, use_round_corner=False, number_of_threads=4, remove_single_pin_components=True, use_pyaedt_extent_computing=True, extent_defeature=0, ) .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 66-69 Plot cutout ~~~~~~~~~~~ Plot cutout before exporting to IPC2581 file. .. GENERATED FROM PYTHON SOURCE LINES 69-72 .. code-block:: default edb.nets.plot(None, None, color_by_net=True) .. image-sg:: /examples/00-EDB/images/sphx_glr_02_edb_to_ipc2581_001.png :alt: main :srcset: /examples/00-EDB/images/sphx_glr_02_edb_to_ipc2581_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 73-76 Create IPC2581 file ~~~~~~~~~~~~~~~~~~~ Create the IPC2581 file. .. GENERATED FROM PYTHON SOURCE LINES 76-80 .. code-block:: default edb.export_to_ipc2581(ipc2581_file, "inch") print("IPC2581 File has been saved to {}".format(ipc2581_file)) .. rst-class:: sphx-glr-script-out .. code-block:: none IPC2581 File has been saved to D:\Temp\pyaedt_prj_2LL\Ansys_Hsd.xml .. GENERATED FROM PYTHON SOURCE LINES 81-84 Close EDB ~~~~~~~~~ Close EDB. .. GENERATED FROM PYTHON SOURCE LINES 84-86 .. code-block:: default edb.close_edb() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 9.031 seconds) .. _sphx_glr_download_examples_00-EDB_02_edb_to_ipc2581.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 02_edb_to_ipc2581.py <02_edb_to_ipc2581.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 02_edb_to_ipc2581.ipynb <02_edb_to_ipc2581.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_