Help Center
  • FAQ
    browse most common questions
  • Live Chat
    talk with our online service
  • Email
    contact your dedicated sales:
  • Call Us
    9:00 - 18:00, Mon.- Fri. (GMT+8)
0

How to Create Eagle Scripts

Published on 2/13/2017 6:48:48 AM

Description

<style>.e_editor{font:14px/24px Arial,'microsoft yahei','Times New Roman','b8bf53';}.e_editor div,e_editor p,e_editor td,e_editor th,e_editor li{font-weight:inherit;font-size:inherit;font-style:inherit;font-family:inherit;}.e_editor ul{margin:-10px 0 20px;}.e_editor li{padding:5px 0;}.e_table{width:96%;border-collapse:collapse;empty-cells:show;}.e_table th,.e_table td{padding:5px;border:2px solid #eee;}.e_img{padding:10px 0;text-align:center;}.e_p{line-height:20px;padding:0 0 20px;text-indent:0em;}</style> <div class="e_editor"> <div class="e_p"> Eagle scripts are text files with eagle commands. You use them for automating tasks such as changing the width of all the traces on a board, changing board size, or drawing a specific pattern. </div> <div class="e_img"> <img src="https://file.allpcb.com/bbs/p/wwwbuild-electronic-circuitscom/wwwbuild-electronic-circuitscomc20170227181845847.png" /> </div> <div class="e_p"> <h2> How does eagle scripts work? </h2> </div> <div class="e_p"> To run an eagle script you simply enter “SCRIPT scriptname” (exchange scriptname with the name of the script you want to run) into the Eagle command line. </div> <div class="e_p"> To be completely honest, I really don’t use scripts much. But I do think they can be really useful, so I am going to try to use them more in the future.. </div> <div class="e_p"> <h2> Where to find information about commands? </h2> </div> <div class="e_p"> In a script you can use all the commands that are available to run from the command line. A list of available commands can be found in “Editor Commands” in Eagle’s Help function from the menu. </div> <div class="e_img"> <img src="https://file.allpcb.com/bbs/p/wwwbuild-electronic-circuitscom/wwwbuild-electronic-circuitscomc20170227181847197.png" /> </div> <div class="e_p"> If you click on one of the commands you will get detailed information about how to use that command and which parameters it accepts. </div> <div class="e_img"> <img src="https://file.allpcb.com/bbs/p/wwwbuild-electronic-circuitscom/wwwbuild-electronic-circuitscomc20170227181847686.png" /> </div> <div class="e_p"> <h2> An example script </h2> </div> <div class="e_p"> Let’s say that we want to create a script to automatically set the board size to 5cm x 5cm. Some of the <a href="https://www.allpcb.com/cheap_fast_pcb_prototype.html" target="_blank">cheap prototype</a> manufacturers use this size as a standard, so it is convenient to have a script for this.The board size is determined by the board outline which is set by lines in the “20 Dimension” layer. Since these lines does not have any name, we can’t move them with the MOVE command. Therefore I will create a script that creates a new board outline. The old one must be deleted manually before we run the script. </div> <div class="e_p"> <h3> Set grid </h3> </div> <div class="e_p"> First, I need to ensure that we are using a millimeter grid (to be able to set the outline to 50 mm). We use the “GRID” command for this:GRID MM; </div> <div class="e_p"> <h3> Set layer </h3> </div> <div class="e_p"> Then I will select the correct layer. “20 Dimension” is the layers we want, so we can select it by typing:LAYER 20; </div> <div class="e_p"> <h3> Draw lines </h3> </div> <div class="e_p"> Now, all we have to do is to draw four lines that will make up the board outline. </div> <div class="e_p"> “WIRE 0” means a wire (or line) with a width of 0. Then we define the start and stop point for the line “(0 0) (0 50)”: </div> <div class="e_p"> <strong>WIRE 0 (0 0) (0 50)</strong> </div> <div class="e_p"> <strong>WIRE 0 (0 50) (50 50)</strong> </div> <div class="e_p"> <strong>WIRE 0 (50 50) (50 0)</strong> </div> <div class="e_p"> <strong>WIRE 0 (50 0) (0 0)</strong> </div> </div>

24

comment

All comments

Unknown

5213

0

24

Go to Order My Own PCB

Rules about cashback: 1. Valid time: ALLPCB cashback activity will end on April 1st. 2. Capped amount: The capped amount of cashback for each account is $5,000. Each order can get a maximum of $2,000 cashback. That means every author can get $5,000 max. 3. Cashback range: The cashback activity only covers the corresponding PCB order. The order amount for other combined payment products will be invalid. 4. Clicking your own promotional link will be invalid. The same email address, shipping address, contact information, and phone number are all recognized as the same account. 5. ALLPCB has the final interpretation right of the cashback activity.

ALLPCB will donate 2% to the author for this promotion link.

Other Projects

Home / Industrial Automation low Cost with Arduino an ESP01

2460

0

314

Alternate Text josemarjr