Electronic – Eagle cad replace command using command line

cadeaglepcbreference

I am using Eagle Cad and changed my libraries to another folder. I needed quicker access. Now I have to update my components in my schematic and wanted to use the replace command from the command line.

I read the manual but it lacks at providing syntax for this command. I have tried many different variations and I get many different errors. I was wondering if anyone knew the correct syntax and could post a working reference?

P.s. Also, there are spaces and quotes in some of my components. Example of failed attempts:

REPLACE C "BUTTON-CONDUCTIVESMD-0.1" (BUTTON-CONDUCTIVE)@MyLibrary" BUTTON-TRACE@000_Mylib"

Error:Invalid point:(BUTTON-CONDUCTIV...

P.p.s. Also I have looked at the set command as a possible alternative, but haven't tried it out. Is it a viable option? If yes, please provide a working reference as well!

Best Answer

Given that the brd and sch files are in XML I'd like to suggest editing it and changing the directly but maybe that's not always a good idea! You could try it with a copy if you were brave enough!

It looks like Replace has two options:

REPLACE device_name[@library_name] •..
REPLACE part_name device_name[@library_name] ..

The first you just type REPLACE "mycomponent@mylibrary" and go around clicking the appropriate components.

The second is the same but you given the part name first.

Neither are particularly great options. I thought it would be easy to, say, group all components of a particular package and replace them but I can't see how. You likely have to use a script to do it. This isn't really an answer I guess.