I’m just cleaning up an imported schematic (Orcad via export to Altium and then import in KiCad). Many symbols contain fields that I’d never use. So I deleted superfluous fields globally in the fields table. However, in the schematic file, those deleted fields appear in the big schematic section that begins with (lib_symbols.
Within the actual symbol in the schematic, those fields are indeed no longer present.
What I find intriguing: that copy of the symbol within the (lib_symbols ...) contain the same “Reference” ID as the actual symbol in the visible schematic.
When I export the schematics symbols to a separate (project) library file, its contents is filled with the same information as in the schematics (lib_symbols section. Including those removed fields like ARROW PART NUMBER. It also contains a valid reference ID including a number, where only the symbol type letter should be present.
What can I do? When I remove the section (lib-symbols I guess that an export file created hereafter is empty…
Having schematic symbols cached inside the schematic file is a relatively new feature (Introduced in KiCad V6), and most people are likely to add symbol fields, not remove them, which makes it plausible there are some bugs in KiCad in this area. I am also not sure what the intended behavior is here.
A method that probably works:
Schematic Editor / File / Export / Symbols to new Library (And add it to the library table, Force KiCad to update the links to this new library)
Edit this new library in the Library Editor.
Update the schematic with the symbols in your modified library.
Thanks for doing your suggestion. But this approach would mean that in every symbol that’s exported to a library file I had to manually remove symbol fields. Because in the symbol library editor there is no such thing as a global edit&remove tool, in contrast to the symbol field table in eeschema.
Because the built-in copy of used library symbols since v6 (instead of the former cache file) I just tried with a deleted (big) section (lib_symbols …) in an eeschema file of my project, but then upon opening, eeschema&project window both close immediately - crash.
You’re right that in normal use cases, symbol fields would be added. But in the case of imported sheets (not only the Orcad originated parts of the schematic, but also from another source), the former one (NXP) has the habit to use its own custom fields, while the latter source (TI) is as individual as the former one… Result: bloated number of unique symbol fields (in my case over 130!).
Generally: I wonder why the symbols in the schematic, and thus in the eeschema file are duplicated as lib sourced entries. Formerly you only had the local cache file and no symbols at all in the eeschema file. The cache file represented a sort of insurance…
I’d consider the built-in symbols simply as the replacement of the former cache. Hence I’m unsure why all used symbols in a certain sense exists double in an eeschema file.
Since almost all symbols from the imported schematics are remained as is, there will (in my case) never be a need to update schematic symbols from the imported library file (what would restore the former symbol field set). As such I don’t see real problems. It’s only the fact that I simply worry about the fact that the eeschema file still contains a lot of (no longer used) symbol fields.