Author Topic: KiCAD misplaces symbols in schem editor  (Read 2345 times)

0 Members and 1 Guest are viewing this topic.

Offline opampsmokerTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
KiCAD misplaces symbols in schem editor
« on: October 28, 2020, 09:40:34 pm »
Hi,
I work on Kicad on a computer in the office. Then when i go home, i copy the kicad project and libraries...and load them on my computer at home. For some reason it  then looses a lot of the symbols in the schem when i re-open the kicad schem at home.
It must know what they are because it puts a question mark in the schem and writes down in words exactly what the symbol was (the 'value' field).

I can individually click each question mark and then get the correct symbol put back in there...but this takes a lot of time.

Do you know how i can avoid this happening?
 

Offline nuclearcat

  • Supporter
  • ****
  • Posts: 382
  • Country: lb
Re: KiCAD misplaces symbols in schem editor
« Reply #1 on: October 28, 2020, 11:21:19 pm »
Usually when it loses symbol - it shows error why it loses them and offer to repair. All such messages can be helpful.
Check also if you have any custom libraries, make sure path to them relative, not absolute.
 
The following users thanked this post: opampsmoker

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3871
  • Country: de
Re: KiCAD misplaces symbols in schem editor
« Reply #2 on: October 28, 2020, 11:37:08 pm »
This mostly happens when you don't have the libraries in the same place and use absolute path as @nuclearcat mentioned above.

It can also happen if you are using two different versions of KiCAD and the libraries are not the same between the two.
 
The following users thanked this post: opampsmoker

Offline opampsmokerTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: KiCAD misplaces symbols in schem editor
« Reply #3 on: October 29, 2020, 07:13:50 am »
Thanks, presumably by "relative" path you mean it needs to be a "${...}" type path.
In the symbol libraries dialog box it has made a name called "${KIPRJMOD}"......so i have to make up some word like this?

Surely there is some quick way of using an absolute library address, and then i can just hit some command like "update symbols from library"?
« Last Edit: October 29, 2020, 07:15:35 am by opampsmoker »
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3871
  • Country: de
Re: KiCAD misplaces symbols in schem editor
« Reply #4 on: October 29, 2020, 09:35:47 am »
Thanks, presumably by "relative" path you mean it needs to be a "${...}" type path.

No that is most likely still absolute path (depends on what is in the variable).

https://en.wikipedia.org/wiki/Path_(computing)#Absolute_and_relative_paths

In the symbol libraries dialog box it has made a name called "${KIPRJMOD}"......so i have to make up some word like this?

That thing between ${} is an environment variable that gets replaced into the entry in the box. So if you are in Windows, you need to make sure it is not set to e.g. C:\blah\foo\Kicad\something (which is likely different on each of your computers). You can see these in Preferences->Configure Paths.

Either you must set the variables (and have the software installed!) the same on both computers or you will need to use relative paths that don't use these variables and are relative to the project directory.


Surely there is some quick way of using an absolute library address, and then i can just hit some command like "update symbols from library"?

And how would you imagine the computer knowing automatically that at work you have a library X at a place Y but now it is in a folder Z (and that it is the same library)?

If you want to try to automate this sort of hack, you could make a script that will replace the paths for you (while KiCAD isn't running, obviously).

They are stored in the following files:

Assuming your system-wide config is in:
C:\Users\<username>\AppData\Roaming\kicad

  • Variables - in kicad_common
  • Paths/list of libraries to schematic symbols - sym-lib-table
  • Paths/list of footprint libraries - fp-lib-table

The sym-lib-table and fp-lib-table are both in the system-wide directory (the libraries shipped with KiCAD) and in the project directory (the project-specific libraries you have added to the project). Those are likely the ones you will need to change.

All those files are plain text but make sure to keep the format or KiCAD will get confused. Once you fix the paths in there, start KiCAD and it should find your symbols.


You can avoid this issue by using a proper project "hygiene" - put a copy of any third-party libraries (stuff that isn't shipped with KiCAD) that you are using inside of your project directory and add them using a relative path (i.e. one that does not start with a "/" or drive letter!). Then the above "massage" won't be necessary.
« Last Edit: October 29, 2020, 09:38:40 am by janoc »
 

Offline opampsmokerTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 154
  • Country: gb
Re: KiCAD misplaces symbols in schem editor
« Reply #5 on: October 29, 2020, 11:13:17 am »
Quote
And how would you imagine the computer knowing automatically that at work you have a library X at a place Y but now it is in a folder Z (and that it is the same library)?
Thanks, oh sure, i agree i still have to re-define where the relevant library is when i move to the new machine...but i've done that, and  kicad  still cant find the library.
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3871
  • Country: de
Re: KiCAD misplaces symbols in schem editor
« Reply #6 on: October 29, 2020, 02:15:09 pm »
Quote
And how would you imagine the computer knowing automatically that at work you have a library X at a place Y but now it is in a folder Z (and that it is the same library)?
Thanks, oh sure, i agree i still have to re-define where the relevant library is when i move to the new machine...but i've done that, and  kicad  still cant find the library.

Verify the paths in the files I have mentioned to make sure there is nothing forgotten there. You have also not said whether it is one of the stock KiCAD libraries which is missing or one of yours - the solution could be different for each.

So it is difficult to help you like this because it is only on your computer. You need to provide more information, we really don't read minds.
 

Offline julian1

  • Frequent Contributor
  • **
  • Posts: 769
  • Country: au
Re: KiCAD misplaces symbols in schem editor
« Reply #7 on: October 29, 2020, 11:23:58 pm »
Quote
"${KIPRJMOD}"......so i have to make up some word like this?

That env variable is supplied by kicad, and always points at the project directory.

So you can appropriate it, and use it for relative paths.

Eg. I use it to point at my common library that gets shared across different projects. eg. like this.

${KIPRJMOD}/../../lib/mylibrary.lib

That way my library and projects always travel and reference each other correctly.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf