I have downloaded the Spice file for the TLV9062 here. I have now created a custom symbol LTV9062 that lives in my AutoGenerated folder and links to the TLV9062.cir file for the Spice model.

When I make a schematic it runs fine on the original machine but won't work on any other computer because the folder path is different for the symbol and the circuit. Is there some way I can include this symbol and circuit such that it takes it from the same directory as my schematic?

What I want to do is to be able to zip my schematic and all custom circuits that it uses into a single folder. When I email it to someone I want them to be able to run the schematic without having to relink all these parts.

I tried looking at libraries but am still confused.


2 Answers 2


Simplest Approach

That .CIR file looks like what could also be .LIB or .MOD (or whatever, really.) It's just a text file with SUBCKTs and MODELs. And like any other part of a Spice deck, you can insert this directly into the schematic. Doing so may be distracting because there will be a LOT of text now appearing in your schematic. But doing it this way guarantees that the MODELs and SUBCKTs follow the schematic since the entire text is included in the schematic. That means it is really easy -- just copy and send the schematic.

You may complain at this point that you also built a custom schematic symbol, as well. If so, my response would be to point out that there was no need to do so for an opamp like this. There already is a customizable symbol located in every LTspice installation. Just hit F2, select the [Opamps] folder there and scroll over until you see the symbol name, "opamp2", located towards the end. Use that symbol and paste it into your schematic. Now, just right-click carefully over the word "opamp2" that appears near the symbol and edit it so that it says "TLV9062".

If you follow the above process, then your schematic will completely contain all of the spice deck required to run the schematic. It will be built into the schematic. So you won't even need to transfer a folder of files. You can simply hand out the single schematic file. It will run in any plain vanilla installation of LTspice.

If you have more such models to include, that just means lots more text on your schematic. But you can re-arrange things so that it is still readable for anyone.

Of course, if it turns out that you really do need to create custom symbols (and there is a need for that), then this is no longer workable. Symbols require a symbol file (extension is .ASY) and so now it would be appropriate to take the next step.

Schematics with Custom Symbols

If you need to use custom symbols (which can apply to an hierarchical schematic in a .ASC file of the same name or can apply to any SUBCKT you write), then you will need to save these symbols as files so that LTspice can find them and apply them.

Any symbol you create can also include the file name containing the model. There is a special attribute called "ModelFile" which you can include and modify, specifying the name of the file containing one or more models and subcircuit definitions. If you do NOT use this method, then you probably will need to include a ".INCLUDE" Spice statement on your schematic that includes some specific file containing these models and subcircuits.

In your case, you are provided with a .CIR file. So just save it inside the same folder where you keep your schematic. Then just use .INCLUDE and give that file name. No need to add a directory. LTspice will find it if the file is in the same folder with the schematic it is working on.

If you use the ModelFile attribute, again do not include a directory. Just the file name for the .CIR file. (Include the extension, .CIR, though.) LTspice will find the model file, as well.

This way, you can just transfer the folder and all needed, related files. Anyone should be able to run the schematic.


LT spices search path looks at the directory of the .asc file first. Then the LT spice directories lt spice\sub

Push the .op button and put this statement into your lt spice file

.include C:\directory\subdirectory\TLV9062.cir

if you did it right you should be able to right click on the statement and see an open and browse button, if you click on the open button it should open the file.

The user will then need to unzip the file to the exact location.

Another option is running the file from the same directory as the library file, which (I haven't tried this) should look in the directory of the .asc file first for the library. So as long as you put all of your included files in the same directory as your .asc file it should run fine

.include TLV9062.cir

The last option is LT spice XVII has the ability to add search file paths (the last time I checked anyway, I don't have it in front of me right now)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.