Even Pattern VBA Macro for SolidWorks 2001 Version 1.0 Copyright 2001, Rhapsody Design Solutions (RDS). All rights reserved. Introduction ------------ How many times have you had to design a hole pattern that was evenly spaced along an edge? Do you just calculate the hole "pitch" manually after you change your part dimension, or do you go ahead and figure out the equation, enter in all the dimensions, etc. Either method is quite cumbersome. Enter "Even Pattern". This is an easy to use SolidWorks macro with a very simple GUI which will automate the task of creating this equation for you. Simply start the macro, "grab" the necessary dimensions, then press one button to build the equation that will set the hole pitch so that the pattern is evenly spaced across the part length. There is even a provision for having the last hole a different dimension from the edge than the first hole. Features -------- 1. The Even Pattern Macro is very easy to use - the intuitive GUI is straightforward and logically planned. 2. You can enter a dimension for the edge offset for the last pattern member (if it has to be different from the first pattern member). 3. Once the equation is created, you can change the part dimension, edge offset, or number of holes and the pattern will remain even across the length specified. 4. The Even Pattern Macro is supplied in native VBA format, which means it can be easily customized to fit your specific needs. 5. IT'S FREE!!! Requirements ------------ This macro currently runs only under SolidWorks 2001, which has full VBA implementation. Installation ------------ 1. Save the EVEN_PATTERN.EXE file somewhere on your hard drive, 2. Run the EVEN_PATTERN.EXE self-extracting file. This will extract the EVEN_PATTERN.SWP file in the same directory. 3. Move the newly created EVEN_PATTERN.SWP file to a directory used for saving your SolidWorks Macros, preferably in your \Macros\ folder, which should be in your SolidWorks working directory. *Note: if you do not currently have a central location for your SolidWorks macros, it is advisable to make it in a folder called "Macros" which needs to be in your SolidWorks working direcory. For example: "C:\Program Files\SolidWorks_2001\Macros" The reason for this is because this is the only location that can be used if you intend to make a keyboard shortcut for this and any other macro. 4. Start the macro by using the menus in SolidWorks... Tools---> Macro---> Run... Then choose the EVEN_PATTERN from the location you chose above. Using this Software ------------------- Using this macro is pretty straightforward. You have to have an existing pattern BEFORE you can use this program - EVEN_PATTERN will not create the pattern - only the equation. Here are the general steps: 1. Start the EVEN_PATTERN macro. 2. Double-click the feature and/or pattern so that you can see the dimensions on your SolidWorks Part or Assembly. 3. Click one of the dimensions so that it is highlighted, then press the cooresponding "Grab" button on the macro interface. You should see the resulting dimension name in the label near the grab button. You MUST have all the required dimensions "grabbed" before pressing the "Create Equation" button. Choose the "Unequal Offset" option button to enter a dimension from the opposite end of the pattern if it is to be different from the offset at the other end. 4. Click on "Create Equation" - this does what it says. The equation drives the distance between pattern members (pitch) so that they are always evenly spaced between the ends of your part/assembly. Customizing this Program ------------------------ Since this program is supplied in a SolidWorks VBA SWP file, you now have the entire source code to modify as you wish. To edit the source code, simply go to "Tools--->Macro--->Edit" in SolidWorks and choose the even_pattern.swp file for editing. Once you have this file in the Microsoft VBA editor, you can make any modifications you wish. You will find that most subro -rw-rw-r-- 1 1676810 1000000 96768 Feb 27 20:15 component-new-instance.swp -rw-rw-r-- 1 1676810 1000000 822 Feb 27 20:15 component-replace.bmp -rw-rw-r-- 1 1676810 1000000 20992 Feb 27 20:15 concentric.swp -rw-rw-r-- 1 1676810 1000000 822 Feb 27 20:15 configurations-to-prt.bmp -rw-rw-r-- 1 1676810 1000000 25088 Feb 27 20:15 design-black-display.swp -rw-rw-r-- 1 1676810 1000000 28672 Feb 27 20:15 design-working-display.swp -rw-rw-r-- 1 1676810 1000000 238 Feb 27 20:15 display-black.bmp -rw-rw-r-- 1 1676810 1000000 238 Feb 27 20:13 display-design.bmp -rw-rw-r-- 1 1676810 1000000 238 Feb 27 20:13 display-page.bmp -rw-rw-r-- 1 1676810 1000000 20992 Feb 27 20:14 distance.swp -rw-rw-r-- 1 1676810 1000000 104448 Feb 27 20:14 even_pattern.swp -rw-rw-r-- 1 1676810 1000000 111670 Mar 5 13:08 even_pattern_large.jpg -rw-rw-r-- 1 1676810 1000000 27648 Mar 5 13:05 fm_toggle.swp -rw-rw-r-- 1 1676810 1000000 30720 Mar 5 13:05 in_unit.swp -rw-rw-r-- 1 1676810 1000000 238 Feb 27 20:14 inch-units.bmp -rw-rw-r-- 1 1676810 1000000 30720 Feb 27 20:14 inch_unit.swp -rw-rw-r-- 1 1676810 1000000 774 Feb 27 20:14 mm-units.bmp -rw-rw-r-- 1 1676810 1000000 27648 Feb 27 20:14 mm_unit.swp -rw-rw-r-- 1 1676810 1000000 33280 Feb