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

Adding a part with a colon in the name causes creation of invalid symbol #88

Open
itsumimario opened this issue Mar 24, 2023 · 1 comment · May be fixed by #146
Open

Adding a part with a colon in the name causes creation of invalid symbol #88

itsumimario opened this issue Mar 24, 2023 · 1 comment · May be fixed by #146

Comments

@itsumimario
Copy link

itsumimario commented Mar 24, 2023

When adding a part that has a colon in the name, the script creates a symbol that Kicad doesn't like, and will give an error message saying something like "invalid prefix at line 56 offset 14". For example, part C26393 will do this.

The solution is to substitute "{colon}" for ":" in the symbol name.

For example, here is the invalid symbol that the script generates:

(kicad_symbol_lib (version 20220914) (generator kicad_symbol_editor)
  (symbol "MT48LC16M16A2P-6AIT:G" (in_bom yes) (on_board yes)
    (property "Reference" "U" (at 0 38.1 0)
      (effects (font (size 1.27 1.27)))
    )
    (property "Value" "MT48LC16M16A2P-6A IT:G" (at 0 -38.1 0)
      (effects (font (size 1.27 1.27)))
    )
    (property "Footprint" "easyeda2kicad:TSOP-54_L22.2-W10.2-P0.80-LS11.8-BL" (at 0 -40.64 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (property "Datasheet" "https://lcsc.com/product-detail/RAM_Micron_MT48LC16M16A2P-6AIT-G_MT48LC16M16A2P-6AIT-G_C26393.html" (at 0 -43.18 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (property "Manufacturer" "micron(镁光)" (at 0 -45.72 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (property "LCSC Part" "C26393" (at 0 -48.26 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (property "JLC Part" "Extended Part" (at 0 -50.8 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (symbol "MT48LC16M16A2P-6AIT:G_0_1"
      (rectangle (start -8.89 35.56) (end 8.89 -35.56)
        (stroke (width 0) (type default))
        (fill (type background))
      )
      (circle (center -7.62 34.29) (radius 0.38)
        (stroke (width 0) (type default))
        (fill (type none))
      )
... blah blah blah
    )
  )
)

But it will work if you substitute two of the ":" instances with "{colon}" like this:

(kicad_symbol_lib (version 20220914) (generator kicad_symbol_editor)
  (symbol "MT48LC16M16A2P-6AIT{colon}G" (in_bom yes) (on_board yes)
    (property "Reference" "U" (at 0 38.1 0)
      (effects (font (size 1.27 1.27)))
    )
    (property "Value" "MT48LC16M16A2P-6A IT:G" (at 0 -38.1 0)
      (effects (font (size 1.27 1.27)))
    )
    (property "Footprint" "easyeda2kicad:TSOP-54_L22.2-W10.2-P0.80-LS11.8-BL" (at 0 -40.64 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (property "Datasheet" "https://lcsc.com/product-detail/RAM_Micron_MT48LC16M16A2P-6AIT-G_MT48LC16M16A2P-6AIT-G_C26393.html" (at 0 -43.18 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (property "Manufacturer" "micron(镁光)" (at 0 -45.72 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (property "LCSC Part" "C26393" (at 0 -48.26 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (property "JLC Part" "Extended Part" (at 0 -50.8 0)
      (effects (font (size 1.27 1.27)) hide)
    )
    (symbol "MT48LC16M16A2P-6AIT{colon}G_0_1"
      (rectangle (start -8.89 35.56) (end 8.89 -35.56)
        (stroke (width 0) (type default))
        (fill (type background))
      )
      (circle (center -7.62 34.29) (radius 0.38)
        (stroke (width 0) (type default))
        (fill (type none))
      )
... blah blah blah
    )
  )
)
@boromyr
Copy link

boromyr commented Sep 24, 2023

I also encounter this problem

@archiecarrot123 archiecarrot123 linked a pull request Aug 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants