Gears and transmission
Custom 8-Tooth Gear with Hub
- Bounding box
- 6.0 × 6.0 × 8.5 mm
- Engine
- Precision B-rep
- Parameters
- 9
- Published
- August 11, 2026
Download
Free to download and use. See the terms.
The prompt
Write a SolidWorks VBA macro to model a custom non-standard 8-tooth plastic gear with a hub. CRITICAL INSTRUCTION: DO NOT use standard involute gear math or equations (it will cause undercutting for 8 teeth). You must draw the gear profile by explicitly sketching lines/arcs for a single tooth, patterning it 8 times, and trimming to create a closed profile. Use the following exact dimensions (in millimeters): - Number of Teeth: 8 - Outer Diameter: 6.0 mm - Root Diameter (inner circle of teeth): 3.5 mm - Central Bore (Through Hole) Diameter: 2.0 mm - Gear Extrusion Thickness: 4.0 mm - Hub Diameter: 4.0 mm - Hub Extrusion Length: 4.5 mm (Extruding from the face of the gear, making total length 8.5 mm) Macro Steps to automate: 1. Create a new part document. 2. Create a sketch on the Front Plane. 3. Draw a circle for the Root Diameter (3.5 mm). 4. Draw a single tooth profile manually. The tooth should start at the root circle and go up to the Outer Diameter (6.0 mm). Use arcs or angled lines so the tooth is thick at the base and slightly tapered at the top (like small plastic toy gears). 5. Use Circular Sketch Pattern to array this tooth profile 8 times around the origin. 6. Create a closed contour for the gear shape. 7. Extrude the gear profile by 4.0 mm. 8. Select the front face of the new gear, create a new sketch, draw a circle for the Hub (4.0 mm diameter), and extrude it by 4.5 mm. 9. Select the front face of the hub, create a sketch, draw a circle for the Bore (2.0 mm diameter), and create an Extruded Cut "Through All". Ensure the VBA code is complete, uses correct SolidWorks API methods (like IModelDoc2, ISketchManager, IFeatureManager), and runs without syntax errors.
Parameters
| Name | Value | Range |
|---|---|---|
| Number of Teeth | 8 count | 6 – 16 |
| Outer Diameter | 6 mm | 4 – 30 |
| Root Diameter | 3.5 mm | 2 – 12 |
| Gear Thickness | 4 mm | 1 – 20 |
| Hub Diameter | 4 mm | 2 – 15 |
| Hub Length | 4.5 mm | 1 – 20 |
| Bore Diameter | 2 mm | 0.5 – 10 |
| Tooth Root Half Angle | 16 deg | 2 – 20 |
| Tooth Tip Half Angle | 7 deg | 1 – 15 |
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
