Library Location

For general questions regarding the software and for all questions that do not fit in any of the threads above.
Post Reply
Message
Author
pedro10vitor
Posts: 4
Joined: 17 Nov 2017, 11:31

Library Location

#1 Post by pedro10vitor » 21 Apr 2021, 15:25

Hi. I am currently running Diptrace version 3.3.1.3 and I am faced with a issue. I needed to retore my PC and as such I did a full backup, etc. Bottom line, I saved all my libraries I made all this years, using Diptrace. Now the problem is, during this restoration I changed the computer username from "Estudos" to "Pedro" and doing so, all my schematics and PCB's have lost their library link, because Diptrace searchs using a absolut address, so the component link to the library should be:
  • "C:\Users\Pedro\Documents\DipTrace\My Libraries\USB_Conn.eli"
But is looking at:
  • "C:\Users\Estudos\Documents\DipTrace\My Libraries\USB_Conn.eli"
Is there any way to fiz this? Other than renaming the pc.

Tomg
Expert
Posts: 2028
Joined: 20 Jun 2015, 07:39

Re: Library Location

#2 Post by Tomg » 22 Apr 2021, 09:09

Yes, but it will take a while. Before trying the following procedures, back up all of your schematic and board files.

Schematic
1) Open a schematic to be updated, in the main menu select "File" > "Export" > "DipTrace ASCII..." and save the ASCII file to a convenient location such as the desktop. Give it any file name you want because it will only be used as a universal ASCII work file. Keep the schematic open; you will be returning to it.
2) Open the new ASCII work file in your favorite text editor. Use the text editor's "Replace" tool with its "Match case" option enabled to replace all instances of "Users\Estudos\Documents\DipTrace\My Libraries" with "Users\Pedro\Documents\DipTrace\My Libraries". Depending on the text editor you will probably be choosing something like "Replace All" to accomplish this.
3) Resave the modified ASCII work file (make sure to resave it as an ASCII file) and close the text editor.
4) Return to the open schematic, in the main menu select "File" > "Import" > "DipTrace ASCII..." and open the modified ASCII work file to bring the changes into the schematic. All schematic components should now point to the new library file path root. If everything looks good, resave the schematic file and close it.
5) Repeat steps 1 through 4 for each of the remaining schematics.

PCB
There are two methods for updating library file paths for a PCB's components...
* Open a PCB and apply similar techniques as outlined above.
...OR...
* Use the "Renew Layout from Schematic (By Components...)" tool if the associated schematic file has already been updated.
Tom

User avatar
KevinA
Posts: 639
Joined: 18 Dec 2015, 08:35

Re: Library Location

#3 Post by KevinA » 22 Apr 2021, 10:04

Tomg reply is the only way to fix this 'missing tool' issue, very time consuming and boring. If you have to do this at least setup a system that by-passes the absolute embedded path issues and address a couple of other issues.

Depending on your system: C: drive 970 Pro Nvme m.2 D: drive terabyte hard drive: Move your C:\Users\%USERNAME%\diptrace to D:\diptrace
Inside of D:\diptrace build a structure like:

model3d (diptrace)
3d (imported 3d images)
library (common libraries)
pdf (common pdf files)
archive

project
template (used for new project setup, must run git in the root of each new project to setup versioning)
library
pdf
3d
git
gerber
bom
proj-name1
.git
library
pdf
3d
git
gerber
bom
proj-name2
.git
library
pdf
3d
git
gerber
bom

--------------------------
Move all your libraries to their new D:\diptrace\library location
Use Library manager to rebuild where are libraries are

Build projects for existing projects then move all your existing PCB/Schematics into those projects or archive old projects by zipping them and moving to d:\diptrace\archive

The library and 3d path issue:

In PCB/Schematic Editor you can open a project, right click a component, click it's properties and see the library it uses and that libraries path, you could edit that to point to your new structure or:

Export the project as Diptrace ASCII, edit the project with an editor like Notepad++ configured to not change line endings, Search for C:\User and you will find your first path, do a find and replace on the path part your modifying, save the file, import the diptrace ascii after you have renamed your old project, save the imported files as the project name and move to the next project, with both PCB Editor and Schematic Editor..
(NOTE: Tomg update from schematic sounds easier!)

DipTrace as it comes from the store is not setup to be multi-user or sharable or use any type of versioning software or manage projects, the above file structure allows all this, if I contract for a project one of the deliverables is the source, with this setup it becomes a matter of zipping the project directory, exporting the git, done. Absolute directory paths are a pain but that is what we have so deal with it, build a file structure to minimize the results of absolute paths, no versioning, no project management tools, no archiving tools. If you want all that 'stuff' that are application that provide it for big bucks... $10K a seat.
Note: To run versioning you need to learn git, currently I save the versions manually but I'm working on using python to automate the system, and if Diptace would add python scripting to Diptrace we would all be better off and they would be buried in new orders. :mrgreen:

pedro10vitor
Posts: 4
Joined: 17 Nov 2017, 11:31

Re: Library Location

#4 Post by pedro10vitor » 22 Apr 2021, 11:31

Tomg wrote: 22 Apr 2021, 09:09 Yes, but it will take a while. Before trying the following procedures, back up all of your schematic and board files.

Schematic
1) Open a schematic to be updated, in the main menu select "File" > "Export" > "DipTrace ASCII..." and save the ASCII file to a convenient location such as the desktop. Give it any file name you want because it will only be used as a universal ASCII work file. Keep the schematic open; you will be returning to it.
2) Open the new ASCII work file in your favorite text editor. Use the text editor's "Replace" tool with its "Match case" option enabled to replace all instances of "Users\Estudos\Documents\DipTrace\My Libraries" with "Users\Pedro\Documents\DipTrace\My Libraries". Depending on the text editor you will probably be choosing something like "Replace All" to accomplish this.
3) Resave the modified ASCII work file (make sure to resave it as an ASCII file) and close the text editor.
4) Return to the open schematic, in the main menu select "File" > "Import" > "DipTrace ASCII..." and open the modified ASCII work file to bring the changes into the schematic. All schematic components should now point to the new library file path root. If everything looks good, resave the schematic file and close it.
5) Repeat steps 1 through 4 for each of the remaining schematics.

PCB
There are two methods for updating library file paths for a PCB's components...
* Open a PCB and apply similar techniques as outlined above.
...OR...
* Use the "Renew Layout from Schematic (By Components...)" tool if the associated schematic file has already been updated.
KevinA wrote: 22 Apr 2021, 10:04 Tomg reply is the only way to fix this 'missing tool' issue, very time consuming and boring. If you have to do this at least setup a system that by-passes the absolute embedded path issues and address a couple of other issues.

Depending on your system: C: drive 970 Pro Nvme m.2 D: drive terabyte hard drive: Move your C:\Users\%USERNAME%\diptrace to D:\diptrace
Inside of D:\diptrace build a structure like:

model3d (diptrace)
3d (imported 3d images)
library (common libraries)
pdf (common pdf files)
archive

project
template (used for new project setup, must run git in the root of each new project to setup versioning)
library
pdf
3d
git
gerber
bom
proj-name1
.git
library
pdf
3d
git
gerber
bom
proj-name2
.git
library
pdf
3d
git
gerber
bom

--------------------------
Move all your libraries to their new D:\diptrace\library location
Use Library manager to rebuild where are libraries are

Build projects for existing projects then move all your existing PCB/Schematics into those projects or archive old projects by zipping them and moving to d:\diptrace\archive

The library and 3d path issue:

In PCB/Schematic Editor you can open a project, right click a component, click it's properties and see the library it uses and that libraries path, you could edit that to point to your new structure or:

Export the project as Diptrace ASCII, edit the project with an editor like Notepad++ configured to not change line endings, Search for C:\User and you will find your first path, do a find and replace on the path part your modifying, save the file, import the diptrace ascii after you have renamed your old project, save the imported files as the project name and move to the next project, with both PCB Editor and Schematic Editor..
(NOTE: Tomg update from schematic sounds easier!)

DipTrace as it comes from the store is not setup to be multi-user or sharable or use any type of versioning software or manage projects, the above file structure allows all this, if I contract for a project one of the deliverables is the source, with this setup it becomes a matter of zipping the project directory, exporting the git, done. Absolute directory paths are a pain but that is what we have so deal with it, build a file structure to minimize the results of absolute paths, no versioning, no project management tools, no archiving tools. If you want all that 'stuff' that are application that provide it for big bucks... $10K a seat.
Note: To run versioning you need to learn git, currently I save the versions manually but I'm working on using python to automate the system, and if Diptace would add python scripting to Diptrace we would all be better off and they would be buried in new orders. :mrgreen:
Thank you so much for your answers it works perfectly. I exportedto Diptrace ASCII and eddited using notepad from Windows, nothing fancy. Thanks.

I did something similar to what KevinA suggested, I moved all my libraries to C:\My Libraries.

However, the libraries itself aren't updated, so when I update a particular component from the library, the path for the 3D model is still wrong. So the 3d model path gets updated and now its wrong. I tried to open .eli files but with no success. Is there a similar way to update the libraries itself, so the 3d model points to the new location?

-------------------------------------------------------------------------------

On a side note, I use Google Sync and Backup to keep a resamblence of a history. It allows up to 30 days if I am not mistaken.

User avatar
KevinA
Posts: 639
Joined: 18 Dec 2015, 08:35

Re: Library Location

#5 Post by KevinA » 22 Apr 2021, 11:54

That was the library/3d part:
In parts editor export to ascii and it dumps the entire library
I don't know of an easy way to do components other then dump to ascii and import back perhaps Tomg does.

pedro10vitor
Posts: 4
Joined: 17 Nov 2017, 11:31

Re: Library Location

#6 Post by pedro10vitor » 22 Apr 2021, 13:25

It works exactly like in the schematic editor.

1)Open the Pattern Editor and go to: Library -> Export -> Diptrace ASCII...
2)Save as .asc
3)Open the saved file with Notepad
4)Search and replace the necessary string. For example:
Search for: Model3DFile "C:\AAAA\BBBB\CCCC\
Replace for: Model3DFile "C:\DDDD\EEEE\FFFF\
*Do NOT include the file name in the search nor in the replacement
5)Save the file as .asc
6)Go back to Pattern Editor: Library -> Import -> Diptrace ASCII...
7)Select the .asc file and import.

Post Reply