On 25/02/2025 10:29, j.bernabe1 via
groups.io wrote:
Good
morning, I have a question about symbols.
Could a symbol be automatically generated from a (.lib) or
(.sub) file??..
In this case it would be a comparator.
?
If so, how could I generate it?
Yes, symbols can be automatically generated from any text file
containing a valid .subckt. It doesn't matter what the name of the
file is. It can be a .lib or .sub file, but it doesn't have to be.
The procedure is simple.
- Open the file in LTspice. this most easily done by dragging
the file from Explorer into LTspice.
- Right-click with the mouse on the .subckt line.
- From the drop-down menu, choose Create Symbol.
- Save.
Whether this is a good idea, or not, is another matter. You will get
a rectangular box with the correct pin names, but not necessarily in
appropriate places. Nobody will know for sure what kind of component
it is. You could delete the box and draw a proper comparator
outline, for example, and re-arrange the pin positions. But many
people don't bother, and it is often difficult to figure out what a
schematic does that uses them.
So, here are some alternatives:
- Look for an LTspice standard symbol that is appropriate for
the type of component.
- If it also has the correct pin configuration, use it with
modification.
- If it doesn't you can make a copy of the standard symbol, and
edit it to have the correct pin configuration.
- Draw a new symbol from scratch.
--
Regards,
Tony