Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing "lib_name" field in schematicSymbols #46

Closed
FutureEngineeer opened this issue Feb 7, 2023 · 3 comments · Fixed by #54
Closed

Missing "lib_name" field in schematicSymbols #46

FutureEngineeer opened this issue Feb 7, 2023 · 3 comments · Fixed by #54

Comments

@FutureEngineeer
Copy link

Description: The optional field "lib_name" is missing in schematicSymbols and is used to create alternative symbols directly in the schematic. As a result, components modified in the schematic are not displayed.

Example from schematic file: (symbol (lib_id "") (lib_name "USBLC6-4SC6_1") (at 43.18 135.89 0) (unit 1)

Solution: The field can be added by adding the following code to the class SchematicSymbol() in schitems.py:

libraryName: str = ""

if item[0] == 'lib_name': object.libraryName = item[1] 
# in from_sexpr

f'(lib_name "{dequote(self.libraryName)}") 
# after f'{indents}(symbol (lib_id "{dequote(self.libraryIdentifier)}")
@mvnmgrx
Copy link
Owner

mvnmgrx commented Feb 13, 2023

Can't find this token in the KiCad documentation for schematic symbols ..

What KiCad version your file belongs to? In KiCad 6, the lib name might be insoide of "lib_id", we are currently discussing similar changes for the Library Symbol class in #41

Can you provide a full example of what you are trying to parse?

@FutureEngineeer
Copy link
Author

FutureEngineeer commented Feb 13, 2023

SWD_via_USB-C.zip
When creating an alternative version of a symbol directly in the schema (KiCad 6), it adds an additional prefix _1 or higher to the lib id, depending on the number of variations of the modified library symbols in the schema. If the libname field is missing, then such components are no longer displayed in the schema after saving. After these changes in the code, the problem was solved

@mvnmgrx
Copy link
Owner

mvnmgrx commented Feb 14, 2023

It wouldn't be the first time that a token is missing in the KiCad documentation. I'm going to take a closer look on this later this week, thanks for sharing the example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants