10.010.017.0
Loading the interactive model…
Interactive 3D model of Alternating Tooth Gear

Gears and transmission

Alternating Tooth Gear

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

NameValueRange
Number of Teeth83 – 100
Outer Diameter10 mm2 – 200
Root Diameter7.5 mm2 – 200
Bore Diameter4 mm0.5 – 100
Base Tooth Height10 mm1 – 100
Long Tooth Extra Height3 mm0 – 50
Hub Height4 mm0 – 50
Hub Diameter6 mm2 – 100
Tooth Angle (deg)20 deg1 – 50
Number of Long Teeth41 – 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.