Post Go back to editing

How to convert a LTspice schematic file (.asc) to a .lib file?

Category: Software
Product Number: LTspice
Software Version: 24.1.5

Hi, I have built a model using LTspice with schematic file (.asc), and I need to convert the .asc file to .lib file so that others could only see the netlist information instead of detailed circuits.

I have tried clicking the "VIEW"-->click "Spice Netlist" and copy the netlist to create a .lib file. Then, i use LTspice to import this .lib file and create a symbol (.asy). It turned out that the symbol file does not work, and i can't figure out.

Could anyone tell me the right way? many appreciate!

  • i did it by copying the subcircuit

    .subckt ... .ends

    from the netlist to its own .sub modelfile and save it in a new folder

    then i openend the hierarchical symbol,

    which i defined for my subcircuit and which doesnt have any attributes defined

    and edited the attributes

    Prefix

    Value

    Modelfile

    accordingly

    save this .asy symbol file in the folder together with the .sub modelfile 

    then you can copy your .asc maincircuit file to this folder and it should work

    here is the complete project

    asc ... hierarchical subcircuit version

    sub ... modelfile version

    dreipunktregler.zip

    hth steve

  • Hi steve,

    I have tried what you did and it works, tks very much.

    Besides, the method i post also works now. I had a mistake that i just convert the whole maincircuit schematic to .lib file. The right way is to build a sub-circuit (hierarchy) first and then copy the spice netlist of the sub-circuit to the ceated .lib file. 

  • i'm glad you got it to work ;-)

    you are right, it doesnt matter which extension the modelfile has.

    you can use .lib .mod .sub (which are commonly used therefore)
    or any other extension you like, as long as you type the correct file name 
    into the Attribute ModelFile

    brgds steve