Post Go back to editing

List and Count All Component Instantiation

Thread Summary

The user asked if LTspice can export a list of all hierarchically instantiated components and count primitives across all blocks. The final answer indicates that LTspice does not have this feature, but suggests using the netlist or expanded netlist and parsing it with a script. The user confirmed using a Python script to extract hierarchical counts from the netlist.
AI Generated Content
Category: Software
Software Version: Version (x64): 26.0.1

This question is regarding LTspice itself.

I have a hierarchical LTspice schematic where I can descend to sub-blocks.

With the TOP level schematic opened, is there a way to:

  1. Export a list of all components instantiated hierarchically, down to the primitives?
  2. Count the number of all primitives instantiated across all hierarchies and blocks?
  3. Tabulate the list separating instances of items with the same schematic symbol but with different/ unique models? 

The closest function would be the "Bill of Materials" feature, but I observed that:

  1. It only prints the components instantiated on the current view/block opened
  2. It does not seem to list items with non-standard RefDes such as X*, Xinput[*], etc.

Thank you for any answers.

Edit Notes

Fixed comment regarding BOM list generated
[edited by: AIGen at 1:21 AM (GMT -5) on 22 Jan 2026]
  • Hi  ,

    I don't believe there is. 

    There may be some trick using the netlist, or expanded netlist, and then parsing the former by leading line character, and the latter by looking for "Symbol"? Note that you cannot peer into encrypted models.

    Unfortunately, LTspice does not dynamically look for hierarchy in the schematic, as it would have to do this for every action you take: as you add and subtract or modify components, or add and subtract, or modify directives, or you modify a hierarchical block it would have to recognize that change at the higher level. LTspice simply waits until you run the simulation to traverse the hierarchy and produce a flattened netlist. This feature is on our list of longterm possibilities.

    mike

  • Thank you  .

    What I did is for now is to netlist from the top level schem and use a Python script to extract the hierarchical count of instances, but I still need to check the validity of the extracted count.

    Hope this feature gets implemented soon!

    Kind regards,
    Gen