Eagle editor command: "ADD" says "Device not

I want to build up a schematic procedurally via scripting but I cannot seem to add any parts via the command line.

ADD 'C1' 'G$1' C-USC0603@rcl R0.000 (2.500 3.100);

pasted into the input warns “Device not found: C1”

I assumed it was a library issue but when I go to add a part using the GUI button I am presented with a full library, and more importantly - the “rcl” is listed too - it didn’t get “dropped” or anything.

Additionally any variation of ADD via command line fails, including every example string in that section of the documentation. The googles do nothing, at least for “eagle pcb device not found add” so I had to ask here.

Once I get over this hurdle my BOM application should theoretically be able to export an entire parts list into a SCH file (no netlists. yet.)

Eagle’s help says (HELP ADD):

ADD package_name[@library_name] [name] [orientation] •…

Reverse your C1 and the device name :slight_smile:

And that works, thanks!

Can I say though that what got me off track (and simultaneously inspired me) was the ULP called “export-schematic.ulp” from the Cadsoft downloads page that gathers your current SCH file up into an SCR that can recreate your design. It appears the values are swapped there and then I ran with this as my example, which appears incorrect for this version of Eagle.

so regarding export-schematic.ulp, I swapped out this line 90:

printf("ADD '%s' '%s' %s@%s %s%5.3f (%5.3f %5.3f);\n", PAR.name, PARINS.gate.name, PAR.device.name, PAR.device.library, options, PARINS.angle, u2inch(PARINS.x), u2inch(PARINS.y));

with this:

printf("ADD %s@%s '%s' '%s' %s%5.3f (%5.3f %5.3f);\n", PAR.device.name, PAR.device.library, PAR.name, PARINS.gate.name, options, PARINS.angle, u2inch(PARINS.x), u2inch(PARINS.y));

and it works too! It’s a curious error, it may have been a valid command in past Eagle versions. Perhaps I should upload the patched version, or maybe contact the author.