Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Best or easy way to make Autogenerated LTSpice symbols portable?
Hello,
The problem: Moving .asc schematics with Autogenerated symbols between different computers stops them working. The .lib files are not in the same path and can not be located It appears the symbol files store an absolute patch for the .lib file but this path depends on the computer username and the LTXSpice installation. I tried to convert them to relative paths manually by could not get that to work. What would be the correct way to fix this problem? Best regards Bernt |
Sadly, many people are lured into autogenerating symbols. We've highlighted the drawbacks here frequently. The first question is: do you need a new symbol? In many cases, the answer is "no". LTspice provides many "standard" symbols for common part types. Use them. However, faced with existing auto-generated symbols, how can we make them portable? The first thing to do, is open the symbol in the symbol editor. Then, press ctrl-A, to open the Attribute Editor. At the bottom, is the "ModelFile" Attribute. It will have the full path to the model file in it's current location. Delete that. Then, save the edited symbol somewhere else - wherever it's used, is a good start. (Later, you might figure out a system for keeping custom symbols.) In schematics where you place the new symbol, you should add a ".lib modelfile.sub" directive, where "modelfile.sub" is its actual name. Keeping symbols and models with the schematics that use them is the best way of assuring portability. -- Regards, Tony? On 15 May 2024 00:11, "Berntd via groups.io" <berntau@...> wrote: Hello, |
开云体育In that path, delete all except the filename
and its extension. On 2024-05-14 23:11, Berntd via
groups.io wrote:
Hello, --
OOO - Own Opinions Only Best wishes John Woodgate, Rayleigh, Essex UK Keep trying |
开云体育And be sure that the llibrary/model/subcircuit file is in the same directory [folder] as the schematic file. Donald. On 2024-05-14 18:53, John Woodgate
wrote:
|
I am trouble with this right at this moment.
I am not sure where to put the .lib files. On the previous install, it seemed to be wanting them in the .lib main folder. And, the next issue now on a new install of v17, it is looking for them in the Autogenerated folder. The error message is: Could not open '%HOMEPATH%\Documents\LtSpiceXVII\lib\sym\Autogenerated\INA826.lib On this new install however, it puts the libs into c:\\username\AppData\Local\LTspice\lib\lib\Autogenerated Are all the previously created symbols now useless unless each one is edited manually between machines? I am also stumped that the default lib top folder is not selectable for LTSpice. That seems crazy. Best regards Bernt |
On Tue, May 14, 2024 at 03:53 PM, Tony Casey wrote:
Hi Tony, I am not sure how one would keep symbols with schematics. To place them, they come from the Autogenerated folder or some other folder in the .lib top folder (which is not changeable)? I agree, that making a folder for a project and then keeping everything related in there would be best but I have no idea how that can be achieved. Regards Bernt |
开云体育Just move the symbol and/or library files from wherever they are now to the folder or directory where the schematic is, using the operating system's file browser (or whatever they call it), or the command line, whichever suits you. Then edit the symbol and schematic, per Tony's instructions. All done. Donald. On 2024-05-14 20:10, Berntd via
groups.io wrote:
On Tue, May 14, 2024 at 03:53 PM, Tony Casey wrote: |
On 15/05/2024 02:05, Berntd via groups.io wrote:
I am trouble with this right at this moment.Yes, the location for libraries and examples was changed on 17.1 for reasons that were explained at the time, but didn't get everyone's approval. I think you have the new location slightly wrong: c:\\username\AppData\Local\LTspice\lib\lib\Autogenerated ..should be c:\users\<username>\AppData\Local\LTspice\lib\sym\Autogenerated However, the new 17.1 install may have deleted the contents of the '%HOMEPATH%\Documents\LTspiceXVII\lib folder. I can't remember. See if you can locate it in Explorer. If it's still there, you should be able to find the symbol library and copy the contents somewhere else. If it's all missing, it will be a salutory lesson that things should be BACKED UP, before anything major is done that might affect valuable data. When 17.1 was first announced, it was, after all, tagged as a "beta". Anyway, things have changed again for the new V24. The "standard" libraries and examples are still in the AppData location, but I think with the exception of the Autogenerated folder, anything that you add there will be removed on the next "Component Update". This seems a bit draconian, but is designed to end the situation with users adding their own stuff to the standard libraries, which results in everyone's being different. To mitigate this, users can now keep all their own stuff in: c:\users\<username>\Documents\LTspice ..and LTspice won't touch them. This still doesn't address the problem of users forgetting where custom symbols and models are located for schematics that they want to be portable. That's why the usual suggestion here is that they be placed in the same folder as the schematic(s) that use them. The other lesson is that you really shouldn't use stuff in the autogenerated folder. Instead, if you insist on using autogenerated symbols, immediately save or copy them somewhere else and delete (or edit) the ModelFile attribute, as previously described. -- Regards, Tony |
Project schematics located in:
C:\Users\username\Documents\LTspiceXVII\Bernt_Projects\Force Sensor symbols located: C:\Users\username\Documents\LTspiceXVII\Bernt_Projects\Force Sensor\Lib and then .lib dols located in separate folders under the above such as: C:\Users\username\Documents\LTspiceXVII\Bernt_Projects\Force Sensor\Lib\INA826 The .sym files still have the old path from my other installation as in: SYMATTR ModelFile %HOMEPATH%\Documents\LTspiceXVII\lib\sym\AutoGenerated\INA826.lib I am confused now what that must change to for this to work and to work on different installations of LTspice |
I don't know if this was answered.? Bernt wrote, "However, what I do not understand is how to then place my symbols. In the Place component, it only shows stuff from the .lib (which includes Autogenerated) but nothing else so it is not possible to see other folders and components there."
When you first open the (Add) Component menu, it has things on the top half and the bottom half of its pop-up window.? At the very top of that pop-up menu, there is a choice for "Top Directory".? That is how you can select between the current directory (the one that holds the schematic you are editing), and LTspice's libraries. Click that to change it to the current directory, and now the bottom half should show only the symbols in the current directory.? If you have not yet saved the current schematic, you may need to save it once first, so that LTspice knows what is the current directory. Click that "Top Directory" choice at the top of the pop-up window again, when you want to change it back to LTspice's libraries. The only choices for the "Top Directory" are LTspice's libraries, the user-defined library path that you optionally told LTspice about, and the current working directory with the schematic being edited. Andy |
Bernt wrote:
The .sym files still have the old path from my other installation as in:
SYMATTR ModelFile %HOMEPATH%\Documents\LTspiceXVII\lib\sym\AutoGenerated\INA826.lib
I am confused now what that must change to for this to work and to work on different installations of LTspice
To be portable, the "ModelFile" attribute must NOT have any of the "path".? In MS-Windows, the path is the directory structure, leading up to the filename itself.? (Some would say that it includes the filename, but I'm ignoring that for purposes of this.)? Your ModelFile attributes should have ONLY the filename.ext, so in this case it should be "INA826.lib" and nothing else. To change that, DO NOT open the symbol file in any text editor where you see lines starting with "SYMATTR".? Don't do that.? Instead, open that symbol file in LTspice itself.? If you double-click on the symbol file, it should open it directly in LTspice.? Once it is open in LTspice, then press Ctrl-A (hold down the Ctrl key and click the A key), and then edit only the ModelFile attribute, which is the bottom line.? Edit that line so that the contents have just the filename.ext (such as INA826.lib).? Then click OK, and then Save. Tony offered another alternative, which is to delete the ModelFile attribute completely, and add a ".lib filename.ext" to each schematic that uses that symbol.? That works perfectly well too.? It is very slightly more complicated because you would need to edit the schematics to add the ".lib" command to every schematic that uses that symbol. Either way, the purpose of the ".lib" command and of the ModelFile attribute are the same.? Both Either of them loads the model file into LTspice for the simulation.? Your schematic and symbol combination should use one or the other, not both. Andy |
to navigate to use esc to dismiss