How to add 2n7000 to LT Spice?

Thread Starter

pdavis68

Joined Nov 27, 2013
46
I've looked at posts here, I've watched videos, I've looked at posts on other sites, and I'm stumped. In fact, I took the model from this page here on All About Circuits. Restarted LT Spice and no dice.
I've tried adding several models. I've tried using .lib files and including them in the model as per a video where this was demonstrated, but it says it can't find the model file.

2n7000.PNG

What makes it all particularly frustrating, to me, is that I'm a software developer and the fact that you can't point it to a .lib file and click a button to import it, so you don't have to jump through these kinds of manual hoops, frankly, seems kind of stupid. I mean seriously, how hard could it be to add an "import" function?
 

Papabravo

Joined Feb 24, 2006
19,617
The root of the problem is that there exist multiple locations for a file of a particular name on a machine, and it is entirely possible you are modifying a file of the correct name except it is in the wrong location. It does not help that LTspice has been around longer than any particular version of Windows or MacOS. Each time the OS paradigm changes LTspice must adapt, and it has. Once you have the secret decoder ring or an alternative workaround your anxiety should be relieved.

FYI: The paradigm is changing again even as we speak. LTspice 17.1.5+ (Beta) has changed the default location for the libraries to a folder which is normally hidden! How is that for purposeful obscurity!
 

Thread Starter

pdavis68

Joined Nov 27, 2013
46
I just installed it prior to adding the model. I installed it in D:\Program Files\ and I edited the standard.mos in D:\Program Files\LTC\LTspiceXVII\lib\cmp. So are you saying there's someplace else I need to go looking for it? I actually looked for it in C:\Program Files and the X86 versions on both drives and can't find any other places, on the premise that perhaps there was another copy hiding out somewhere.
But you'll also notice that one of the models they include, AO6407 isn't showing up, but AO6408 is.
 

Papabravo

Joined Feb 24, 2006
19,617
I just installed it prior to adding the model. I installed it in D:\Program Files\ and I edited the standard.mos in D:\Program Files\LTC\LTspiceXVII\lib\cmp. So are you saying there's someplace else I need to go looking for it? I actually looked for it in C:\Program Files and the X86 versions on both drives and can't find any other places, on the premise that perhaps there was another copy hiding out somewhere.
But you'll also notice that one of the models they include, AO6407 isn't showing up, but AO6408 is.
Yes. \Program Files is definitely the WRONG place to go. In many Windows installations, especially on corporate systems this folder CANNOT be modified.

There are at least two main alternative locations for the library:
  1. C:\Users\%SOMEUSERNAME%\Documents\LTspiceXVII\lib
  2. C:\Users\%SOMEUSERNAME%\AppData\Local\LTspice\lib
The drive letter may change and %SOMEUSERNAME% is a placeholder for wherever your Documents or AppData might be located.

This should be a simple exercise to verify.

The better solutions to modifying the library files are to:
  1. Include the .model card on the schematic as a spice directive
  2. use the .inc or the .lib spice commands to include the .model card or the subcircuit in addition to your netlist.
Either of these two alternatives makes your project portable, so it should work on any machine.
1669583525471.png
1669583628286.png
 

Thread Starter

pdavis68

Joined Nov 27, 2013
46
  1. C:\Users\%SOMEUSERNAME%\Documents\LTspiceXVII\lib

That was it. Thank you for the help. I really appreciate it.

Just one more reason there should be a push-button import of models instead of having to do this ridiculous stuff. Honestly, what makes sense to me, is for them to have a list of URLs that can be "component repositories" and then let users download components directly from those repository sites and import them directly in.

It would be trivial for a competent programmer to add such functionality.
 

Papabravo

Joined Feb 24, 2006
19,617
  1. C:\Users\%SOMEUSERNAME%\Documents\LTspiceXVII\lib

That was it. Thank you for the help. I really appreciate it.

Just one more reason there should be a push-button import of models instead of having to do this ridiculous stuff. Honestly, what makes sense to me, is for them to have a list of URLs that can be "component repositories" and then let users download components directly from those repository sites and import them directly in.

It would be trivial for a competent programmer to add such functionality.
No problem, but that user functionality, obvious to you, might have conflicted with the original purpose of LTspice which evolved over time. There are several problems with your proposal and the most obvious is that there are no "official repositories". There are unofficial ones of course, but there is no central authority that will verify and apply a "stamp of approval" to any model or subcircuit. For example, I have over two dozen models of the TIP31C power transistor. Most of them are trash and of dubious provenance. Four of them I consider useful. The second, less obvious, reason is the expense of creating and maintaining such repositories. Nobody is really eager to bear that expense and the headache of maintenance. All things considered it is hard to complain about what you get for the price. Of course, you are free to bitch, moan, and complain to your heart's content, not that it will do you much good.
 

Thread Starter

pdavis68

Joined Nov 27, 2013
46
There are several problems with your proposal and the most obvious is that there are no "official repositories".
But I don't see why that matters. I'm not trying to make official repositories. I simply want the ability to be able to CHOOSE which repositories I add and then have installing the models be automated instead of having to edit files and copy files into hard to get to directories and stuff like that. If companies choose to set up "official" repositories, that's great. If they don't they don't. That's not the problem I'm trying to solve. The problem I'm trying to solve is simply making it easier to install them.
It's stupid to be editing data files used by an application. People mistype stuff, accidentally paste the wrong stuff, etc, and corrupt things.
Instead of bitch moan and complain, I think I'll just write the software to download and install the models and let users set up repositories and it doesn't even have to be part of LT Spice. It can be a completely separate app. Already put it on my to-do list earlier today.
 

Papabravo

Joined Feb 24, 2006
19,617
But I don't see why that matters. I'm not trying to make official repositories. I simply want the ability to be able to CHOOSE which repositories I add and then have installing the models be automated instead of having to edit files and copy files into hard to get to directories and stuff like that. If companies choose to set up "official" repositories, that's great. If they don't they don't. That's not the problem I'm trying to solve. The problem I'm trying to solve is simply making it easier to install them.
It's stupid to be editing data files used by an application. People mistype stuff, accidentally paste the wrong stuff, etc, and corrupt things.
Instead of bitch moan and complain, I think I'll just write the software to download and install the models and let users set up repositories and it doesn't even have to be part of LT Spice. It can be a completely separate app. Already put it on my to-do list earlier today.
You can do it all without editing anything, but you do you.
 
Top