Gears and transmission
Alternating Tooth Gear
- Bounding box
- 10.0 × 10.0 × 17.0 mm
- Engine
- Precision B-rep
- Parameters
- 10
- Published
- August 11, 2026
Download
Free to download and use. See the terms.
The prompt
Please write a SolidWorks VBA macro to automatically generate a custom 3D gear with the following exact specifications. The macro should create the sketches and extrusions step-by-step in a new part document. Gear Specifications: - Number of teeth: 8 - Outer diameter: 10 mm - Root diameter: 7.5 mm - Center bore (hole) diameter: 4 mm - The gear has an alternating tooth height pattern (4 long teeth and 4 short teeth, alternating). - Base extrusion height for all teeth: 10 mm - Long teeth height: 13 mm (so 4 alternating teeth extend 3 mm higher than the rest). - Hub/Shaft height: 4 mm extending from the bottom center (or adjust as a central cylindrical base). Steps the macro should follow: 1. Create a new part and sketch on the Front Plane. 2. Draw the root circle (7.5mm) and outer circle (10mm). 3. Draw the profile of a single tooth and use a circular pattern to create 8 teeth. 4. Trim unnecessary lines to form a closed gear profile. 5. Extrude the base profile to 10 mm. 6. Create a new sketch on the top face of the extrusion, project (Convert Entities) the faces of 4 alternating teeth, and extrude them by an additional 3 mm. 7. Create the center bore (4mm diameter) using an Extruded Cut through all. 8. Add a central hub (if necessary based on the standard gear shape). Please provide clear, fully commented VBA code and instructions on how to run this macro in SolidWorks.
Parameters
| Name | Value | Range |
|---|---|---|
| Number of Teeth | 8 | 3 – 100 |
| Outer Diameter | 10 mm | 2 – 200 |
| Root Diameter | 7.5 mm | 2 – 200 |
| Bore Diameter | 4 mm | 0.5 – 100 |
| Base Tooth Height | 10 mm | 1 – 100 |
| Long Tooth Extra Height | 3 mm | 0 – 50 |
| Hub Height | 4 mm | 0 – 50 |
| Hub Diameter | 6 mm | 2 – 100 |
| Tooth Angle (deg) | 20 deg | 1 – 50 |
| Number of Long Teeth | 4 | 1 – 8 |
Every value above is a live dimension. Open a model like this in the editor and each one becomes a slider you can drag before exporting.
More models
Browse the full gallery →Spur Gearbox
design gearbox
Spur Gear (12 Teeth)
Built a gear with 12 teeth
Involute Spur Gear with Keyway
Precision Involute Spur Gear with Hub and Keyway: Module (m) of 2.0 mm, 40 teeth (z), Pitch Circle Diameter (d) of 80.00 mm, 20° pressure angle (\alpha), 15.00 mm face width (b), a
