6.06.08.5
Loading the interactive model…
Interactive 3D model of Custom 8-Tooth Gear with Hub

Gears and transmission

Custom 8-Tooth Gear with Hub

21 views
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

NameValueRange
Number of Teeth8 count6 – 16
Outer Diameter6 mm4 – 30
Root Diameter3.5 mm2 – 12
Gear Thickness4 mm1 – 20
Hub Diameter4 mm2 – 15
Hub Length4.5 mm1 – 20
Bore Diameter2 mm0.5 – 10
Tooth Root Half Angle16 deg2 – 20
Tooth Tip Half Angle7 deg1 – 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.