- Published: Friday, 17 May 2013
- Written by Jon Chandler
- Hits: 4537
Creating a circuit board to fit a specific enclosure can be a challenge even though vendors are often providing drawings with the recommended board dimensions. Many enclosures use boards shaped like the one shown here — basically a cross shape with rounded corners. Even with dimensions given, laying out a board this shape in Eagle or another CAD program is tedious and subject to errors because of the many calculations that must be made.
To simplify the process, I developed the Eagle Board Layout Assistant using Visual Basic 6, which will run on Windows computers. Three x dimensions, three y dimensions, the mounting hole diameter and the inside corner radius must be entered in the simplest case and the program creates a script file that may be run in Eagle to create the board layout. The script may be run in a new blank board or may be run inside the library editor to create a new component that can be used again in the future.
The program also has the option to create pairs of holes on the x-axis centerline and y-axis centerline and to round the external corners of the board. The Eagle board for the above drawing created using a script from Eagle Board Layout Assistant shown below.
This arrangement may not be complete for every possible board design but should provide an easily edited starting point for most boards.
The program will also generate rectangular boards with mounting holes if the smaller x and y dimensions are set to the same size as the largest dimension in each direction.
The program has a minimum error detection features. Create a board from the script; if it's not what you expected, check the entered dimensions and click [Create Script] again.
Using Eagle Board Layout Assistant
Launch the exe file. No installation is required. VB6RUN.DLL is required to run the Visual Basic 6 program. It's installed on most computers using Microsoft Office or other Microsoft programs.
Fill in the appropriate boxes on the screen as shown above and click [Create Script]. An Eagle script will be created in a text box on the right side of the screen.
Copy the script from the text box and paste it into Notepad or another text editor and store it with the extension of scr. Using Notepad, you'll have to enclose the desired name and extension in quotes to override the normal txt extension.
Open a new library in Eagle and create a PACKAGE with the appropriate name or open a new board if you don't want to create the board as a component for future use. Under the Eagle File menu, select script and select the newly created file. The new board outline will be created in the blink of an eye. Note, if you're running the script to create a new board, there will be an error message about the Description Command, which is valid when creating a library part only. Click [OK] to acknowledge the error and the script will complete properly.