1
\$\begingroup\$

How do I duplicate a package in my Eagle library (without grouping, and copying and pasting the contents or opening up the XML of the library in a text editor)?

I know I can copy between libraries, but I can't see how to do it within the same library as there is no option to change the name.

Thanks Thomas

\$\endgroup\$
  • \$\begingroup\$ Which version of EAGLE do you have? As mentioned below - the context menu in the Table of Contents view of the library has a 'duplicate' option in v7.4.0 and above. \$\endgroup\$ – KnightsValour Jan 5 '16 at 18:55
1
\$\begingroup\$

Actually I just checked, and you can right-click on the package in the table of contents (icon looks like a book)

enter image description here

, then choose Duplicate which asks for the new name:

enter image description here

\$\endgroup\$
  • \$\begingroup\$ This is a new feature that was introduced in v7.4.0 and onwards, FYI. \$\endgroup\$ – KnightsValour Jan 5 '16 at 18:53
0
\$\begingroup\$

The lbr file is actually an XML file. Packages are in elements (See example below.) Open the file in a text editor (e.g. Notepad++), make a duplicate of the package element (e.g. right under the original one), change the name and save.

<package name="RFM69HCW">
<wire x1="-8.09" y1="-7.95" x2="7.91" y2="-7.95" width="0.127" layer="21"/>
<wire x1="7.91" y1="-7.95" x2="7.91" y2="8.05" width="0.127" layer="21"/>
<wire x1="7.91" y1="8.05" x2="-8.09" y2="8.05" width="0.127" layer="21"/>
<wire x1="-8.09" y1="8.05" x2="-8.09" y2="-7.95" width="0.127" layer="21"/>
<wire x1="-4.99" y1="5.95" x2="-0.09" y2="5.95" width="0.127" layer="21"/>
<wire x1="-0.09" y1="5.95" x2="-0.09" y2="2.05" width="0.127" layer="21"/>
<wire x1="-0.09" y1="2.05" x2="-5.09" y2="2.05" width="0.127" layer="21"/>
<wire x1="-5.09" y1="2.05" x2="-5.09" y2="5.95" width="0.127" layer="21"/>
<smd name="DIO2" x="6.91" y="7.05" dx="3" dy="1.2" layer="1"/>
<smd name="DIO1" x="6.91" y="5.05" dx="3" dy="1.2" layer="1"/>
<smd name="DIO0" x="6.91" y="3.05" dx="3" dy="1.2" layer="1"/>
<smd name="3.3V" x="6.91" y="1.05" dx="3" dy="1.2" layer="1"/>
<smd name="DIO4" x="6.91" y="-0.95" dx="3" dy="1.2" layer="1"/>
<smd name="DIO3" x="6.91" y="-2.95" dx="3" dy="1.2" layer="1"/>
<smd name="GND_3" x="6.91" y="-4.95" dx="3" dy="1.2" layer="1"/>
<smd name="ANT" x="6.91" y="-6.95" dx="3" dy="1.2" layer="1"/>
<smd name="GND_1" x="-7.09" y="7.05" dx="3" dy="1.2" layer="1"/>
<smd name="MISO" x="-7.09" y="5.05" dx="3" dy="1.2" layer="1"/>
<smd name="MOSI" x="-7.09" y="3.05" dx="3" dy="1.2" layer="1"/>
<smd name="SCK" x="-7.09" y="1.05" dx="3" dy="1.2" layer="1"/>
<smd name="NSS" x="-7.09" y="-0.95" dx="3" dy="1.2" layer="1"/>
<smd name="RESET" x="-7.09" y="-2.95" dx="3" dy="1.2" layer="1"/>
<smd name="DIO5" x="-7.09" y="-4.95" dx="3" dy="1.2" layer="1"/>
<smd name="GND_2" x="-7.09" y="-6.95" dx="3" dy="1.2" layer="1"/>
<text x="-0.09" y="0.05" size="1.27" layer="25" align="center">&gt;NAME</text>
<text x="-0.09" y="-1.95" size="1.27" layer="27" align="center">&gt;VALUE</text>
</package>
\$\endgroup\$
  • \$\begingroup\$ This is how I currently do it, I am looking to see if Eagle has it as functionality, or whether I have to continue this hack. Thanks \$\endgroup\$ – holmeswatson Jan 4 '16 at 15:27
0
\$\begingroup\$

This can be done using the Eagle copy command in the library editor in all version of Eagle (at least ones since 5.x). This command should be run from the library editor with the library you want to copy a package in to open. The syntax of the command is:

copy packagename.pac@libraryname newpackagename

Where:

  • packagename is the name of the package to copy. If you want to copy a device as well, you can put .dev instead of .pac.
  • libraryname is the name of the library to copy it from (including the currently open one). If the library is not currently in Eagles library search paths, you can use a full file path as the library name AFAIK.
  • newpackagename is optional, and not used when you use the copy to library function in the Eagle control panel. This is the argument you need to do what you want. If supplied, this is the name that will be given to the copy in the library.
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.