.. 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_89I\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 [[0.010419265503311216, 0.04198192227822067], [0.010460827148201247, 0.04177297777950732], [0.010508394252349874, 0.04160868358656615], [0.011378955665958661, 0.039345987891904084], [0.011481104429354762, 0.03914889754796645], [0.011613614198034717, 0.03895058246243907], [0.011738277022225034, 0.03879868020873362], [0.013993114009542158, 0.03654384060066575], [0.021723676859529008, 0.02881328031371329], [0.021875579015058783, 0.028688617457459438], [0.022142311790681247, 0.02851039231475559], [0.022498901023239357, 0.028361153409415505], [0.0501081997161374, 0.022658443118289424], [0.050115389883144214, 0.022656985466385306], [0.05024405459822067, 0.022631392463311216], [0.05043961576046106, 0.022612131370000003], [0.056204646439538916, 0.022612131370000003], [0.05640020760177925, 0.02263139246331121], [0.056580308047582455, 0.022667216669352046], [0.05668897431368785, 0.022695247080691455], [0.06716106242493838, 0.02603293367394693], [0.06722884511408374, 0.026057258249349364], [0.07246895216307161, 0.028153570607566375], [0.07280808931839765, 0.02837720713327149], [0.07316535186536138, 0.02873446968023509], [0.07342865686053635, 0.029190527309764774], [0.07354078107549526, 0.029608980576750453], [0.07357500163, 0.029868911494369585], [0.07357500163, 0.030067860929093797], [0.07357500153781718, 0.030068290307276504], [0.07357236964157587, 0.03619784264682524], [0.07350964817259248, 0.036547407037203675], [0.07286766739910838, 0.03828106548337578], [0.07276100213239857, 0.03849009301684572], [0.07262496955638041, 0.038693680154024815], [0.07250030658211681, 0.03884558242767533], [0.06923416782767555, 0.04211172118211658], [0.0690822655540256, 0.04223638415637981], [0.06891128756716963, 0.042350627994751505], [0.0687750106459916, 0.042427029682916874], [0.06457857080039528, 0.04436633092671103], [0.06455011001328882, 0.044378949674346774], [0.03731543182981512, 0.05595023588676457], [0.037118962655707244, 0.056010807858163314], [0.0368930736417795, 0.056055739976688765], [0.03669751247953899, 0.056075001070000005], [0.016627488820461125, 0.056075001070000005], [0.01643192765822088, 0.05605573997668881], [0.016113662838625083, 0.055992433167969397], [0.015749686071864895, 0.05584166905478863], [0.015479874185974789, 0.055661386516380106], [0.015327971912324545, 0.05553672354211668], [0.013513280597883254, 0.05372203222767539], [0.013388617623619748, 0.05357012995402501], [0.013291281391863361, 0.05342445598866224], [0.013242137524933176, 0.05334272651686749], [0.011218869861076723, 0.049583054764648575], [0.01113324211279165, 0.049367262126055834], [0.011088479294635446, 0.04920020501440689], [0.011079768081486809, 0.04916517771943696], [0.010453155795310887, 0.04643625086590004], [0.010447006513881935, 0.04640754503977299], [0.010419265503311206, 0.04626808156177926], [0.01040000441, 0.04607252039953892], [0.01040000441, 0.04217748344046106]] .. 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_89I\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.125 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 `_