Electronic – have two (or more) different symbols for the same LTspice schematic? How

ltspiceschematicssymbol [~]

I have two components in my top-level schematic and noticed that the schematics of these components are actually the same. To avoid any duplication of changes done to these subcircuits, it would be nice to just keep one of them and have the other component just use a different symbol but actually point to the same schematic.

I tried changing the Type field of one of the components to have the same name as the other component, but by doing that, LTspice doesn't open the schematic on double-click any more and the "Navigate/Edit Schematic Block" dialog that pops up when right-clicking on a component is now the generic "Component Attribute Editor" for that component.

Note that I need to keep different symbols for that shared schematic for readability reasons at the top-level.

Edit 1:

Just tried to generate a netlist with the changed Type string, it causes an…

>>> ERROR: Couldn't find schematic for symbol: alternative_symbol_name

Best Answer

You can make one symbol without any names, that is, no "hardcoded" edits from within the symbol editor. Edit the attributes but not the names. Then, when placing that symbol in the schematic, simply rename its instance name to whatever subcircuit you have. Then place the other and do the same for the other subcircuit, while adding proper .inc or .lib cards on the schematic. Of course, this implies the same number of pins in both cases, but there can be a cheat for this: if thte 1st subcircuit has 3 pins and the other 4, then simply add a dummy pin to the 3 pin subcircuit.

If you need to have two symbols at the and of it, no problem, just use only one symbol and change the instance name, the other symbol will be there, ready to be used. The greatest hint for hierarchical schematics (by your words I'm guessing this is what you have) is not to make the name of the symbol hardcoded -- that makes it unique to a certain subcircuit --, unless that is your purpose from the beginning.


Edit: Just to be sure I spell it all out, using two symbols for the same subcircuit, or hierarchical schematic, means simply placing a symbol on the schematic, renaming its instance name, then placing the other (or the same) symbol and doing the same renaming reflecting the desired subcircuit's, or hierarchical schematic's name. All these while taking care that the symbol itself doesn't have a builtin (edited, hardcoded) instance name -- easily taken care of when editing the symbol.


Edit 2: I got home and I realized I omitted another possibility, that deals with hierarchical schematics. The symbols and the schematics can only share one name, case insensitive, so, if you need two symbols pointing to the same schematic (avoiding duplicates of the schematic but keeping more than one symbol), you can simply make the second symbol with a similar name as the first (say hierarchical.asy and hierarchical2.asy), and make a symlink to the lower level schematic (say hierarchical.asc and the symlink hierarchical2.asc). It should be a fairly simple task whether you're in Linux, Mac, or Widows. I'm on Linux -- ln -s file link --, never been on a Mac -- I understand it's about the same thing --, and used a small freeware utility in Windows -- hard link shell ext or something like that, but you can use command prompt, too.