I am doing automation of LTSpice using PyLTSpice library in Python.
I need to know the types of the components in the netlist or in the raw file.
How can I know programmatically that
R1corresponds to a resistor, and that
C1is a capacitor?
And how does the LTSpice solver "knows"?
The netlist is built as follow (simple example):
* C:path_to_folder\example\example.asc R1 voltage N001 1e3 V1 N001 0 PULSE(0 5 0.1 0.1 0.1 0.1 0.5 1) C1 voltage 0 10e-6 .tran 1 .backanno .end
and the raw file looks like this:
Title: * C:path_to_folder\example\example.asc Date: Mon Jun 05 10:34:20 2023 Plotname: Transient Analysis Flags: real forward No. Variables: 6 No. Points: 69 Offset: 0.0000000000000000e+000 Command: Linear Technology Corporation LTspice XVII Variables: 0 time time 1 V(voltage) voltage 2 V(n001) voltage 3 I(C1) device_current 4 I(R1) device_current 5 I(V1) device_current Binary: 馚香香㾹 飸荌뵹뾹떲㣁㝵㳠㘷똷똷顖泿㾹㦾 ...